/* ================================================================
   Modern Dark Theme Design
================================================================ */
* {
  box-sizing: border-box;
}
/* Position the dialer header as a flex container */
.dialer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Style the main heading */
.dialer-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Style the download checkbox container */
.download-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

/* Style the checkbox */
.download-checkbox input[type="checkbox"] {
  cursor: pointer;
}

/* Style the label */
.download-checkbox label {
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

/* Optional: Add some hover effect */
.download-checkbox:hover label {
  color: #007bff;
}
/* Voice Selector Styles */
.voice-selector-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-selector-section label {
  font-size: 0.9rem;
  color: #a0a0a0;
  min-width: 45px;
}

.voice-select {
  flex: 1;
  padding: 0.5rem;
  border-radius: 6px;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.voice-select:hover {
  border-color: #667eea;
  background: rgba(40, 40, 40, 0.9);
}

.voice-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.voice-select optgroup {
  background: #1a1a1a;
  color: #a0a0a0;
  font-weight: bold;
}

.voice-select option {
  background: #2a2a2a;
  color: #ffffff;
  padding: 0.5rem;
}

.voice-select option:hover {
  background: #3a3a3a;
}

#btnVoicePreview {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

#btnVoicePreview:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#btnVoicePreview:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .voice-selector-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .voice-selector-section label {
    margin-bottom: 0.25rem;
  }
  
  #btnVoicePreview {
    justify-content: center;
  }
}
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto; /* Enable vertical scrolling */
}

.main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh; /* Changed from height: 100vh */
  display: flex;
  flex-direction: column;
  /* Removed overflow: hidden to allow scrolling */
}

h3 {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h4 {
  font-weight: 400;
  font-size: 1rem;
  color: #b8b8b8;
  margin-bottom: 0.75rem;
}

/* ================================================================
   Language Selector Styling
================================================================ */
.user-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-id-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-id-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: #e0e0e0;
  font-size: 0.9rem;
  width: 120px;
  transition: all 0.3s ease;
}

.user-id-input:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
}

.user-id-input:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.user-id-label {
  color: #a0a0a0;
  font-size: 0.9rem;
}

.language-selector {
  position: relative;
  display: inline-block;
}

.language-dropdown {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  color: #e0e0e0;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  outline: none;
  transition: all 0.3s ease;
  position: relative;
  min-width: 140px;
}

.language-dropdown:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
}

.language-dropdown:focus {
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.language-selector::after {
  content: '▼';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.7rem;
  color: #a0a0a0;
}

.language-flag {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

/* Header container */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-shrink: 0; /* Prevent header from shrinking */
}

.title-section {
  display: flex;
  align-items: center;
  gap: 2rem; /* Add space between title and user controls */
}

/* ================================================================
   Main layout - Three columns
================================================================ */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 280px 1.2fr;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
  align-items: start;
  margin-bottom: 2rem; /* Add bottom margin for scrolling */
}

/* ================================================================
   Left Column Layout
================================================================ */
.left-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  /* Removed fixed height to allow natural growth */
}

/* ================================================================
   Middle Column Layout (Keypad)
================================================================ */
.middle-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Removed fixed height */
}

/* ================================================================
   Right Column Layout (Event Log + Recent Calls)
================================================================ */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  /* Removed fixed height */
}

/* ================================================================
   Collapsible Section Styling
================================================================ */
.collapsible-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.section-header {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: all 0.3s ease;
}

.section-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.section-header h4 {
  margin: 0;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

/* Connection status colors for minimized headers */
.collapsible-section.connected .section-header {
  background: rgba(16, 185, 129, 0.1);
  border-bottom-color: rgba(16, 185, 129, 0.3);
}

.collapsible-section.connected .section-header h4 {
  color: #10b981;
}

.collapsible-section.disconnected .section-header {
  background: rgba(239, 68, 68, 0.1);
  border-bottom-color: rgba(239, 68, 68, 0.3);
}

.collapsible-section.disconnected .section-header h4 {
  color: #ef4444;
}

/* Only apply colors when collapsed */
.collapsible-section:not(.collapsed).connected .section-header,
.collapsible-section:not(.collapsed).disconnected .section-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.collapsible-section:not(.collapsed) .section-header h4 {
  color: #b8b8b8;
}

.collapse-icon {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.section-content {
  padding: 1rem;
  transition: all 0.3s ease;
  max-height: none; /* Changed from 500px to none */
  overflow: visible;
}

.collapsed .section-content {
  max-height: 0;
  padding: 0 1rem;
  overflow: hidden;
}

.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

/* ================================================================
   Dialer Section (Top Priority)
================================================================ */
.dialer-section {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  padding: 1rem;
  order: -1; /* Ensures it's always at the top */
}

.dialer-section h4 {
  margin-top: 0;
  color: #a8b2ff;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.dialer-section input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e0e0e0;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.dialer-section input[type="text"]:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.dialer-section input[type="text"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.call-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.call-controls button {
  min-width: 100px;
}

.call-controls-row {
  display: flex;
  gap: 0.5rem;
}

.call-controls-row button {
  flex: 1;
}

.call-controls .clear-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ================================================================
   TTS Section Styling (Left column)
================================================================ */
.tts-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.tts-section h4 {
  margin-top: 0;
  color: #a0a0a0;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.voice-input-info {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.voice-input-info .mic-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.voice-input-info .mic-active {
  color: #10b981;
}

.voice-input-info .mic-inactive {
  color: #666;
}

.tts-textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e0e0e0;
  margin-bottom: 0.75rem;
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
  font-family: inherit;
}

.tts-textarea:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.tts-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.tts-controls button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.tts-speed-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 150px;
}

.tts-speed-control label {
  font-size: 0.85rem;
  color: #a0a0a0;
}

.tts-speed-control input[type="range"] {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.tts-speed-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
}

.tts-speed-control input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
}

.tts-speed-value {
  font-size: 0.85rem;
  color: #e0e0e0;
  min-width: 35px;
  text-align: right;
}

.tts-status {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  display: none;
}

.tts-status.playing {
  display: block;
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
  color: #a8b2ff;
}

.tts-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ================================================================
   Quick TTS Responses Section (Right column top)
================================================================ */
.quick-tts-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px; /* Increased from 200px */
  max-height: 500px; /* Increased from 400px */
}

.quick-tts-section h4 {
  margin-top: 0;
  color: #a0a0a0;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.voice-presets-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  min-height: 0;
}

.voice-presets-container::-webkit-scrollbar {
  width: 6px;
}

.voice-presets-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.voice-presets-container::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 3px;
}

.voice-preset-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-preset-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
}

.voice-preset-item:active {
  transform: scale(0.98);
}

.voice-preset-text {
  flex: 1;
  font-size: 0.85rem;
  color: #e0e0e0;
}

.voice-preset-actions {
  display: flex;
  gap: 0.25rem;
}

.voice-preset-modify,
.voice-preset-delete {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  color: white;
}

.voice-preset-modify {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.voice-preset-delete {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.voice-preset-modify:hover,
.voice-preset-delete:hover {
  opacity: 0.8;
}

.voice-add-preset {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.voice-add-preset textarea {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 40px;
  max-height: 80px;
  font-family: inherit;
}

.voice-add-preset textarea:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.voice-add-preset button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.voice-add-preset .save-new-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  display: none;
}

/* ================================================================
   Quick Connect Section
================================================================ */
.quick-connect-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.connection-status-summary {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.status-indicator {
  display: flex;
  align-items: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #666;
  transition: all 0.3s ease;
}

.status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* ================================================================
   Asterisk Configuration Section
================================================================ */
.asterisk-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.asterisk-controls input {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
}

.asterisk-controls input:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.asterisk-status {
  padding: 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.asterisk-status.connected {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.asterisk-status.disconnected {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ================================================================
   WhisperX Configuration Section
================================================================ */
.whisperx-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.whisperx-controls input {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
}

.whisperx-controls input:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.whisperx-status {
  padding: 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.whisperx-status.connected {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.whisperx-status.disconnected {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.whisperx-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.whisperx-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.whisperx-checkbox label {
  font-size: 0.85rem;
  cursor: pointer;
}

.cert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.cert-warning a {
  color: #fbbf24;
  text-decoration: none;
  border-bottom: 1px dotted #fbbf24;
  transition: all 0.2s ease;
}

.cert-warning a:hover {
  color: #fcd34d;
  border-bottom-style: solid;
}

/* ================================================================
   DTMF Input Section
================================================================ */
.dtmf-input-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px; /* Increased from 200px */
  max-height: 500px; /* Increased from 400px */
}

.dtmf-input-section h4 {
  margin-top: 0;
  color: #a0a0a0;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.dtmf-presets-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  min-height: 0;
}

.dtmf-presets-container::-webkit-scrollbar {
  width: 6px;
}

.dtmf-presets-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.dtmf-presets-container::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 3px;
}

.dtmf-preset-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dtmf-preset-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
}

.dtmf-preset-item:active {
  transform: scale(0.98);
}

.dtmf-preset-desc {
  flex: 1;
  font-size: 0.85rem;
  color: #e0e0e0;
}

.dtmf-preset-seq {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  color: #10b981;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.dtmf-preset-actions {
  display: flex;
  gap: 0.25rem;
}

.dtmf-preset-modify,
.dtmf-preset-delete {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  color: white;
}

.dtmf-preset-modify {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.dtmf-preset-delete {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.dtmf-preset-modify:hover,
.dtmf-preset-delete:hover {
  opacity: 0.8;
}

.dtmf-add-preset {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dtmf-add-preset input {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
}

.dtmf-add-preset input:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.dtmf-add-preset button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.dtmf-add-preset .save-new-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  display: none;
}

/* ================================================================
   DTMF Sequences Section
================================================================ */
.dtmf-sequences-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
  display: none; /* Hidden for now */
  flex-direction: column;
  min-height: 0;
}

.dtmf-sequences-section h4 {
  margin-top: 0;
  color: #a0a0a0;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.dtmf-sequence-input {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dtmf-sequence-input input {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
}

.dtmf-sequence-input button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.saved-sequences {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.sequence-item {
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.sequence-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
}

.sequence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.sequence-details {
  color: #888;
  font-size: 0.8rem;
}

.sequence-controls {
  display: flex;
  gap: 0.5rem;
}

.sequence-controls button {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  min-width: auto;
}

/* ================================================================
   Card styling
================================================================ */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.1);
}

/* ================================================================
   Modern button styling (compact)
================================================================ */
button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
}

button:hover::before {
  left: 100%;
}

button:disabled {
  background: rgba(75, 85, 99, 0.5);
  cursor: not-allowed;
  opacity: 0.6;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ================================================================
   Keypad with modern design (compact)
================================================================ */
.keypad-section {
  padding: 1rem;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.keypad button {
  aspect-ratio: 1.2;
  font-size: 1.4rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  padding: 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.keypad button small {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  color: #888;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.keypad button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.keypad button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
  transform: scale(1.05);
}

.keypad button:active {
  transform: scale(0.95);
}

.keypad button:hover::before {
  width: 80px;
  height: 80px;
}

/* ================================================================
   Event Log (right side bottom - 4 lines only)
================================================================ */
.event-log-section {
  display: flex;
  flex-direction: column;
  height: 120px; /* Fixed small height for ~4 lines */
  min-height: 120px;
  max-height: 120px;
}

.event-log-section h4 {
  margin-top: 0;
  color: #a0a0a0;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

#logArea {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
  font-size: 0.85rem;
  font-family: 'Monaco', 'Consolas', monospace;
  min-height: 0;
  line-height: 1.4;
}

#logArea::-webkit-scrollbar {
  width: 6px;
}

#logArea::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#logArea::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 3px;
}

#logArea div {
  margin-bottom: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#logArea div:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ================================================================
   Call History (middle column bottom)
================================================================ */
.call-history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  max-height: 250px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
}

.call-history-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
  font-size: 0.85rem;
}

.call-history-container::-webkit-scrollbar {
  width: 6px;
}

.call-history-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.call-history-container::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 3px;
}

.call-history-entry {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.call-history-entry:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(102, 126, 234, 0.2);
}

.call-history-entry button {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  min-width: auto;
}

/* ================================================================
   Hidden audio element
================================================================ */
audio {
  display: none;
}

/* ================================================================
   Responsive design
================================================================ */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .middle-column,
  .right-column {
    display: none;
  }
  
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .language-selector {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: 1rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
}