:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 262 83% 67%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 262 83% 97%;
  --accent-foreground: 262 83% 47%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 262 83% 67%;
  --radius: 0.5rem;
}

html[data-theme='dark'] {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 262 83% 67%; /* Keep primary color consistent */
  --primary-foreground: 210 40% 98%; /* Ensure contrast */
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 210 40% 85%; /* Increased lightness for dark mode contrast */
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 72% 51%; /* Adjusted for better visibility */
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 262 83% 67%; /* Match primary for focus rings */

  /* Dark theme specific overrides */
  .status-info {
    background-color: hsl(210, 100%, 15%);
    color: hsl(210, 100%, 85%);
    border-color: hsl(210, 100%, 25%);
  }
  .status-success {
    background-color: hsl(150, 100%, 15%);
    color: hsl(150, 100%, 85%);
    border-color: hsl(150, 100%, 25%);
  }
  .status-warning {
    background-color: hsl(40, 100%, 15%);
    color: hsl(40, 100%, 85%);
    border-color: hsl(40, 100%, 25%);
  }
  .status-error {
    background-color: hsl(0, 100%, 20%);
    color: hsl(0, 100%, 85%);
    border-color: hsl(0, 100%, 30%);
  }
  .speaker-card-1 .card-header {
    background-color: hsla(240, 100%, 20%, 0.3);
  }
  .speaker-card-2 .card-header {
    background-color: hsla(170, 100%, 20%, 0.3);
  }
  .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='hsl(210 40% 98%)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
  .form-checkbox-input:checked::after {
     border-color: hsl(var(--primary-foreground)); /* Ensure checkmark is visible */
  }
  #about-toggle i {
    color: hsl(var(--foreground)); /* Ensure chevron is visible */
  }
  .record-button.recording {
    background-color: hsl(var(--destructive)); /* Ensure recording button uses dark destructive */
  }

  /* Dark mode box shadow adjustments for better visibility */
  .card {
    box-shadow: 0 1px 3px 0 rgba(255, 255, 255, 0.05), 0 1px 2px 0 rgba(255, 255, 255, 0.03);
  }

  .record-button {
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.05);
  }

  .header-record-button {
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
  }

  .record-button:hover, .header-record-button:hover {
    box-shadow: 0 6px 8px rgba(255, 255, 255, 0.08);
  }



  .upgrade-header-btn:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.6);
  }

  .settings-content {
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
  }

  .notification {
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.05);
  }
}

* {
  border-color: hsl(var(--border));
  outline: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  overflow: visible; /* Ensure dropdowns are not clipped */
  position: relative; /* Ensure proper stacking context */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: hsl(var(--foreground));
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.button-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.button-primary:hover {
  filter: brightness(0.9);
}

.button-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.button-secondary:hover {
  filter: brightness(0.95);
}

.button-outline {
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.button-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.button-icon {
  padding: 0.5rem;
}

/* Card styling */
.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid hsl(var(--border));
}

.card-header {
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.card-content {
  padding: 0.75rem;
}

/* Form controls */
.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: hsl(var(--ring));
  border-width: 1px;
  box-shadow: 0 0 0 1px hsla(var(--ring), 0.3);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  padding: 0.75rem; /* Larger padding for better touch targets */
  font-size: 16px; /* Prevent iOS zoom on focus */
}

/* Radio and checkbox */
.form-radio,
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-radio-input,
.form-checkbox-input {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  margin: 0;
  cursor: pointer;
  position: relative;
}

.form-radio-input {
  border-radius: 50%;
}

.form-radio-input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: hsl(var(--primary));
}

.form-checkbox-input:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.form-checkbox-input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 0.25rem;
  height: 0.5rem;
  border: solid hsl(var(--primary-foreground));
  border-width: 0 2px 2px 0;
}

.form-radio-label,
.form-checkbox-label {
  font-size: 0.875rem;
  cursor: pointer;
}

/* Record button styles */
.record-button {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Recording timer styles */
.recording-timer {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 1rem;
  color: hsl(var(--foreground));
  text-align: center;
  transition: all 0.3s ease;
}

.recording-timer.warning {
  color: hsl(var(--destructive));
  animation: blink 1s infinite;
}

.recording-timer.completed {
  color: hsl(var(--primary));
}

.recording-timer.fade-out {
  opacity: 0;
  transition: opacity 1s ease;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Continue recording button */
.continue-recording-btn {
  display: none;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.continue-recording-btn:hover {
  filter: brightness(0.9);
}

.header-record-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.record-button:hover, .header-record-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.record-button.recording, .header-record-button.recording {
  animation: pulse 1.5s infinite;
  background-color: hsl(var(--destructive));
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Responsive utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

/* Grid system */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-1 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .md\:flex-row {
    flex-direction: row;
  }
}

/* Utility classes */
.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.text-muted {
  color: hsl(var(--muted-foreground));
}

.w-full {
  width: 100%;
}

.rounded-full {
  border-radius: 9999px;
}

.border-dashed {
  border-style: dashed;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Status message */
.status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.status-info {
  background-color: hsl(210, 100%, 97%);
  color: hsl(210, 100%, 30%);
  border: 1px solid hsl(210, 100%, 90%);
}

.status-success {
  background-color: hsl(150, 100%, 97%);
  color: hsl(150, 100%, 30%);
  border: 1px solid hsl(150, 100%, 90%);
}

.status-warning {
  background-color: hsl(40, 100%, 97%);
  color: hsl(40, 100%, 30%);
  border: 1px solid hsl(40, 100%, 90%);
}

.status-error {
  background-color: hsl(0, 100%, 97%);
  color: hsl(0, 100%, 40%);
  border: 1px solid hsl(0, 100%, 90%);
}

/* Translation section */
.translation-section {
  margin-top: 0.5rem;
}

/* Interpretation section */
.interpretation-section {
  margin-top: 1rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 1rem;
}

.interpretation-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

/* Transcript controls */
.transcript-controls {
  margin-top: 0.5rem;
}

.button-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .transcript-controls {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .transcript-controls div {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .transcript-controls button {
    flex: 1;
  }

  /* Hero section mobile optimizations */
  h1 {
    font-size: 1.3rem; /* Even smaller title on mobile */
    margin-bottom: 0;
    line-height: 1.1;
  }

  .header-title-container {
    margin-bottom: 0;
  }

  #app-subtitle {
    font-size: 0.7rem;
    margin-top: 0;
    line-height: 1.1;
  }

  /* Optimize header spacing */
  header {
    padding: 0.25rem 0;
    margin-bottom: 0.5rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    overflow: visible !important; /* Ensure dropdowns are not clipped */
    position: relative !important; /* Ensure proper stacking context */
  }

  header .flex.items-center {
    flex-wrap: wrap;
    gap: 0.5rem !important;
  }

  /* Mobile header layout adjustments */
  .header-center {
    order: 2;
    justify-content: center;
    margin: 0.5rem 0;
  }

  header > div:first-child {
    order: 1;
  }

  header > div:last-child {
    order: 3;
    justify-content: center;
    overflow: visible !important; /* Ensure user dropdown is not clipped */
    position: relative !important; /* Ensure proper stacking context */
  }

  /* MOBILE BILINGUAL MODE: Ensure user avatar dropdown is always visible */
  .user-avatar-menu {
    position: relative !important;
    z-index: 10000 !important;
    overflow: visible !important;
  }

  /* MOBILE FIX: Position dropdown to open downward from avatar button */
  .user-dropdown {
    position: absolute !important; /* Use absolute positioning relative to avatar button */
    top: calc(100% + 8px) !important; /* Position below avatar button */
    bottom: auto !important;
    right: 0 !important; /* Align with right edge of avatar button */
    left: auto !important;
    z-index: 10001 !important;
    min-width: 200px !important;
    max-width: 250px !important;
    background-color: hsl(var(--popover)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    padding: 0.5rem !important;
    margin: 0 !important;
    overflow: visible !important;
    opacity: 0 !important;
    transform: translateY(-10px) scale(0.95) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
  }

  .user-dropdown.show {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Ensure bilingual mode content doesn't interfere with dropdown */
  #bilingual-mode-content {
    position: relative !important;
    z-index: 1 !important;
  }

  /* Force dropdown visibility when bilingual mode is active */
  body:has(#bilingual-mode-content[style*="block"]) .user-avatar-menu {
    z-index: 10002 !important;
  }

  body:has(#bilingual-mode-content[style*="block"]) .user-dropdown {
    z-index: 10003 !important;
  }

  /* Alternative positioning for larger mobile screens */
  @media (min-width: 481px) and (max-width: 768px) {
    .user-dropdown {
      position: absolute !important;
      top: calc(100% + 8px) !important;
      bottom: auto !important;
      right: 0 !important;
      left: auto !important;
      transform: translateY(-10px) !important;
    }

    .user-dropdown.show {
      transform: translateY(0) !important;
    }
  }

  /* Small mobile screens - ensure downward positioning with viewport awareness */
  @media (max-width: 480px) {
    .user-dropdown {
      position: absolute !important;
      top: calc(100% + 8px) !important;
      bottom: auto !important;
      right: 0 !important;
      left: auto !important;
      min-width: 180px !important;
      max-width: 220px !important;
      /* Ensure dropdown stays within viewport */
      max-height: calc(100vh - 120px) !important;
      overflow-y: auto !important;
    }

    /* Advanced positioning to prevent overlaps */
    .user-avatar-menu.dropdown-above .user-dropdown {
      top: auto !important;
      bottom: calc(100% + 8px) !important;
      transform: translateY(10px) scale(0.95) !important;
    }

    .user-avatar-menu.dropdown-above .user-dropdown.show {
      transform: translateY(0) scale(1) !important;
    }

    /* Left-aligned dropdown for edge cases */
    .user-avatar-menu.dropdown-left .user-dropdown {
      right: auto !important;
      left: 0 !important;
    }

    /* Center-aligned dropdown for very small screens */
    .user-avatar-menu.dropdown-center .user-dropdown {
      right: auto !important;
      left: 50% !important;
      transform: translateX(-50%) translateY(-10px) scale(0.95) !important;
    }

    .user-avatar-menu.dropdown-center .user-dropdown.show {
      transform: translateX(-50%) translateY(0) scale(1) !important;
    }

    /* Ensure dropdown doesn't overlap with bottom navigation */
    @media (max-width: 768px) {
      .bottom-nav ~ * .user-dropdown {
        max-height: calc(100vh - 140px) !important; /* Account for bottom nav */
      }
    }
  }

  .bilingual-mode-label {
    font-size: 0.7rem;
  }

  /* Smaller toggle switch for mobile */
  .toggle-switch {
    width: 36px;
    height: 20px;
  }

  .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
  }

  input:checked + .slider:before {
    transform: translateX(16px);
  }

  .settings-panel {
    width: 100%;
    margin-top: 0.5rem;
  }

  .settings-panel .form-select,
  .settings-panel .toggle-switch {
    margin-bottom: 0.75rem;
  }

  .settings-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .settings-content {
    padding: 0.75rem;
  }

  /* Make dropdowns full width on mobile */
  .form-select {
    width: 100%;
  }
}

.translation-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

/* Enhanced speaker cards for bilingual mode */
.speaker-card-1 .card-header {
  background: linear-gradient(135deg, hsla(240, 100%, 97%, 0.8), hsla(240, 100%, 95%, 0.6));
  border-bottom: 2px solid hsla(240, 100%, 90%, 0.8);
}

.speaker-card-2 .card-header {
  background: linear-gradient(135deg, hsla(170, 100%, 97%, 0.8), hsla(170, 100%, 95%, 0.6));
  border-bottom: 2px solid hsla(170, 100%, 90%, 0.8);
}

/* Enhanced bilingual mode container */
#bilingual-mode-content {
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
}

#bilingual-mode-content[style*="block"] {
  opacity: 1;
  transform: translateY(0);
}

/* Bilingual Conversation Card - Compact Version */
.bilingual-conversation-card {
  max-width: 700px;
  margin: 0 auto;
}

.bilingual-conversation-card .card-header {
  padding: 1rem 1.5rem 0.75rem 1.5rem;
}

.bilingual-conversation-card .card-content {
  padding: 1rem 1.5rem 1.25rem 1.5rem;
}

/* Language Selection Row - Compact */
.language-selection-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.language-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  min-width: 180px;
}

.language-group .form-label {
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0;
  font-size: 0.875rem;
}

.language-select {
  min-width: 180px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.language-arrow {
  color: #8b5cf6;
  font-size: 1.125rem;
  margin: 0 0.375rem;
  display: flex;
  align-items: center;
}

/* Hold to Record Button - Compact */
.record-button-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.hold-record-button {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  border: none;
  border-radius: 40px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.3);
  min-width: 180px;
  justify-content: center;
  height: 48px;
}

.hold-record-button:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.hold-record-button:active,
.hold-record-button.recording {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  transform: translateY(0);
}

.hold-record-button.recording {
  animation: pulse 1.5s infinite;
}

/* Action Buttons Row - Compact */
.action-buttons-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.action-button {
  background: white;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
  min-width: 110px;
  justify-content: center;
  height: 36px;
}

.action-button:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.action-button.translate-btn {
  background: #8b5cf6;
  color: white;
  border-color: #8b5cf6;
}

.action-button.translate-btn:hover {
  background: #7c3aed;
  border-color: #7c3aed;
}

/* Conversation Results */
.conversation-results-card {
  max-width: 1000px;
  margin: 2rem auto 0;
}

.conversation-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .conversation-results-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.result-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.result-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.result-title i {
  color: #8b5cf6;
}

.result-controls {
  display: flex;
  gap: 0.5rem;
}

.result-content {
  flex: 1;
}

.result-textarea {
  min-height: 150px;
  resize: vertical;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Dark mode adjustments for bilingual mode */
[data-theme="dark"] .action-button {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

[data-theme="dark"] .action-button:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--accent-foreground));
}

/* DARK MODE: Purple styling for specific bilingual mode buttons */
[data-theme="dark"] .action-button.manual-record-btn,
[data-theme="dark"] .action-button.translate-btn,
[data-theme="dark"] .action-button.upload-btn {
  background: hsl(var(--primary)) !important; /* Purple brand background */
  border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
  color: white !important;
}

[data-theme="dark"] .action-button.manual-record-btn:hover,
[data-theme="dark"] .action-button.translate-btn:hover,
[data-theme="dark"] .action-button.upload-btn:hover {
  background: hsl(var(--primary-dark)) !important;
  border-color: hsl(var(--primary-dark)) !important;
}

[data-theme="dark"] .hold-record-button {
  background: hsl(var(--primary)) !important; /* Purple brand background */
  border: 2px solid hsl(var(--primary)) !important; /* Purple brand border */
  color: white !important;
}

[data-theme="dark"] .language-arrow {
  color: #a855f7;
}

/* Pulse animation for recording */
@keyframes pulse {
  0% {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(220, 38, 38, 0.6);
  }
  100% {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  }
}

/* CRITICAL FIX: Override inline styles for audio control buttons in light theme */
[data-theme="light"] #basic-mode .card-header #basic-upload-btn[style*="color: white"],
[data-theme="light"] #basic-mode .card-header #basic-play-btn[style*="color: white"],
[data-theme="light"] #basic-mode .card-header #basic-stop-btn[style*="color: white"],
[data-theme="light"] #basic-mode .card-header #basic-copy-btn[style*="color: white"] {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  color: hsl(var(--primary)) !important;
}

[data-theme="light"] #basic-mode .card-header #basic-upload-btn[style*="color: white"] i,
[data-theme="light"] #basic-mode .card-header #basic-play-btn[style*="color: white"] i,
[data-theme="light"] #basic-mode .card-header #basic-stop-btn[style*="color: white"] i,
[data-theme="light"] #basic-mode .card-header #basic-copy-btn[style*="color: white"] i {
  color: black !important;
}

/* Ensure record button maintains primary styling */
[data-theme="light"] #basic-record-btn {
  background: hsl(var(--primary)) !important;
  color: white !important;
  border: 2px solid hsl(var(--primary)) !important;
}

/* ULTRA HIGH SPECIFICITY: White microphone icon on blue record button */
html[data-theme="light"] body #basic-record-btn.header-record-button i,
html[data-theme="light"] body #basic-record-btn i {
  color: #ffffff !important;
  background-color: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  position: relative !important;
  z-index: 9999 !important;
  display: inline-block !important;
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
  font-style: normal !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-size: 16px !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* Light theme: Make other button icons black for better visibility */
[data-theme="light"] #basic-upload-btn i.fa-paperclip,
[data-theme="light"] #basic-play-btn i.fa-play,
[data-theme="light"] #basic-stop-btn i.fa-stop,
[data-theme="light"] #basic-copy-btn i.fa-copy {
  color: black !important;
}

/* Light theme: Override any existing icon colors for these buttons */
[data-theme="light"] #basic-upload-btn i,
[data-theme="light"] #basic-play-btn i,
[data-theme="light"] #basic-stop-btn i,
[data-theme="light"] #basic-copy-btn i {
  color: black !important;
}

/* CRITICAL FIX: Ensure microphone icon is always visible and properly styled */
#basic-record-btn i.fas.fa-microphone,
#basic-record-btn i.fa-microphone,
#basic-record-btn i[class*="microphone"],
#basic-record-btn .fas.fa-microphone,
#basic-record-btn .fa-microphone,
#basic-record-btn i {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
  font-style: normal !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: white !important;
  font-size: 18px !important;
  line-height: 1 !important;
  text-align: center !important;
  width: 18px !important;
  height: 18px !important;
  position: relative !important;
  z-index: 999 !important;
}

/* Force FontAwesome microphone icon content */
#basic-record-btn i.fas.fa-microphone::before,
#basic-record-btn i.fa-microphone::before,
#basic-record-btn i::before {
  content: "\f130" !important; /* FontAwesome microphone unicode */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
  display: inline-block !important;
  color: #ffffff !important; /* White for contrast on blue background */
  font-size: 18px !important;
  position: relative !important;
  z-index: 1000 !important;
}

/* CRITICAL FIX: Ensure record button is ALWAYS visible and functional - PURPLE BRAND */
#basic-record-btn,
#basic-record-btn.header-record-button,
button#basic-record-btn,
button#basic-record-btn.header-record-button {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1000 !important;
  width: auto !important;
  min-width: 140px !important;
  height: 40px !important;
  padding: 8px 16px !important;
  border-radius: 20px !important; /* Rounded pill shape */
  background: hsl(var(--primary)) !important; /* Purple brand color */
  border: 2px solid hsl(var(--primary)) !important;
  color: white !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  font-weight: 500 !important;
  font-size: 14px !important;
}

/* Dark theme specific purple styling */
[data-theme="dark"] #basic-record-btn,
[data-theme="dark"] #basic-record-btn.header-record-button,
[data-theme="dark"] button#basic-record-btn,
[data-theme="dark"] button#basic-record-btn.header-record-button {
  background: hsl(var(--primary)) !important; /* Keep purple brand color in dark theme */
  border: 2px solid hsl(var(--primary)) !important;
}

/* Record button text styling */
#basic-record-btn .record-button-text,
.record-button-text {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: white !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

/* Hover effects */
#basic-record-btn:hover,
#basic-record-btn.header-record-button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px hsla(var(--primary), 0.3) !important;
  filter: brightness(1.1) !important;
}

/* Recording state */
#basic-record-btn.recording,
#basic-record-btn.header-record-button.recording {
  background: #dc2626 !important; /* Red for recording */
  border-color: #dc2626 !important;
  animation: pulse-recording 1.5s infinite !important;
}

/* Update recording state text */
#basic-record-btn.recording .record-button-text {
  content: "Stop Recording" !important;
}

@keyframes pulse-recording {
  0%, 100% { transform: scale(1.05); }
  50% { transform: scale(1.1); }
}

/* CRITICAL: Ensure microphone icon is ALWAYS visible in purple button */
#basic-record-btn i,
#basic-record-btn i.fas,
#basic-record-btn i.fa-microphone,
#basic-record-btn i.fas.fa-microphone,
button#basic-record-btn i,
button#basic-record-btn i.fas,
button#basic-record-btn i.fa-microphone,
button#basic-record-btn i.fas.fa-microphone {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: white !important;
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-size: 14px !important;
  line-height: 1 !important;
  text-align: center !important;
  position: relative !important;
  z-index: 1001 !important;
  margin-right: 0 !important;
}

/* Force microphone icon content */
#basic-record-btn i::before,
#basic-record-btn i.fas::before,
#basic-record-btn i.fa-microphone::before,
#basic-record-btn i.fas.fa-microphone::before,
button#basic-record-btn i::before,
button#basic-record-btn i.fas::before,
button#basic-record-btn i.fa-microphone::before,
button#basic-record-btn i.fas.fa-microphone::before {
  content: "\f130" !important; /* FontAwesome microphone unicode */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
  display: inline-block !important;
  color: white !important;
  font-size: 16px !important;
}

/* Card header layout for title and record button */
.card-header .flex.items-center.justify-between {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 1rem !important;
}

.card-header .card-title {
  margin: 0 !important;
  flex-shrink: 0 !important;
}

/* New Horizontal Language and Recording Section */
.language-recording-section {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 2rem 2rem !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  gap: 2rem !important;
  position: relative !important;
}

/* Language Dropdown Container */
.language-dropdown-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  flex-shrink: 0 !important;
}

.language-dropdown-header {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  color: hsl(var(--foreground)) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.language-dropdown-header i {
  color: hsl(var(--primary)) !important;
  font-size: 16px !important;
}

.language-select-new {
  min-width: 200px !important;
  padding: 8px 12px !important;
  border: 1px solid hsl(var(--border)) !important;
  border-radius: 8px !important;
  background: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
  font-size: 14px !important;
  cursor: pointer !important;
}

/* Circular Recording Button Container - Centered */
.circular-recording-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.75rem !important;
  flex-shrink: 0 !important;
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* Circular Recording Button - Perfect Circle, 40% smaller than original design */
.circular-record-button,
#basic-record-btn.circular-record-button {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 100 !important;
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  border-radius: 50% !important;
  background: hsl(var(--primary)) !important;
  border: 2px solid hsl(var(--primary)) !important;
  color: white !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 12px hsla(var(--primary), 0.3) !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* CRITICAL: Microphone icon styling for circular button */
.circular-record-button i,
#basic-record-btn.circular-record-button i,
#basic-record-btn i,
button#basic-record-btn i {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-size: 20px !important;
  color: white !important;
  line-height: 1 !important;
  text-align: center !important;
  position: relative !important;
  z-index: 1000 !important;
}

/* Force microphone icon content with ::before pseudo-element */
.circular-record-button i::before,
#basic-record-btn.circular-record-button i::before,
#basic-record-btn i::before,
button#basic-record-btn i::before {
  content: "\f130" !important; /* FontAwesome microphone unicode */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
  font-weight: 900 !important;
  display: inline-block !important;
  color: white !important;
  font-size: 20px !important;
}



/* Circular button hover effects */
.circular-record-button:hover,
#basic-record-btn.circular-record-button:hover {
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 6px 20px hsla(var(--primary), 0.4) !important;
  filter: brightness(1.1) !important;
}

/* Circular button recording state */
.circular-record-button.recording,
#basic-record-btn.circular-record-button.recording {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  animation: pulse-recording 1.5s infinite !important;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4) !important;
}



@keyframes pulse-recording {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Timer display for bilingual mode - Compact */
.timer-display {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #8b5cf6;
  font-size: 0.9rem;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Upload progress indicator */
.upload-progress-container {
  width: 100%;
  height: 100%;
  position: relative;
  max-width: 18px;
  max-height: 18px;
  margin: 0 auto;
}

.button-outline .upload-progress-container {
  width: 18px;
  height: 18px;
}

/* Ensure the progress indicator is properly centered */
.button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* File upload area */
.file-upload-area {
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.file-upload-area:hover {
  border-color: hsl(var(--primary));
}

.file-upload-icon {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border-width: 0;
}
/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px; /* Adjusted width */
  height: 28px; /* Adjusted height */
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(var(--muted));
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px; /* Adjusted size */
  width: 20px; /* Adjusted size */
  left: 4px; /* Adjusted position */
  bottom: 4px; /* Adjusted position */
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: hsl(var(--primary)); /* Use primary color */
}

input:focus + .slider {
  box-shadow: 0 0 1px hsl(var(--primary));
}

input:checked + .slider:before {
  transform: translateX(22px); /* Adjusted translation */
}

/* Rounded sliders */
.slider.round {
  border-radius: 28px; /* Adjusted for height */
}

.slider.round:before {
  border-radius: 50%;
}

/* Translation Model Toggle specific styles */
#translation-model-toggle + .slider {
  background-color: hsl(var(--muted));
  border: 2px solid hsl(var(--border));
}

#translation-model-toggle:checked + .slider {
  background-color: hsl(var(--primary));
}

#translation-model-description {
  color: hsl(var(--muted-foreground));
  font-style: italic;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}
/* Theme Selector Styles */
.theme-selector {
  position: relative;
  display: inline-block;
}



/* Ensure toggle button icon color matches theme */
#theme-toggle-btn i {
  color: hsl(var(--foreground));
}

#theme-toggle-btn:hover i {
  color: hsl(var(--accent-foreground));
}

/* Header optimizations */
header .flex.items-center.gap-6 {
  align-items: center; /* Vertically align items in the header controls */
}

/* Compact header styles */
.header-title-container {
  display: flex;
  flex-direction: column;
}

/* Header center section for bilingual mode */
.header-center {
  justify-content: center;
  flex-shrink: 0;
}

/* Bilingual mode label styling */
.bilingual-mode-label {
  white-space: nowrap;
  color: hsl(var(--foreground));
}

@media (max-width: 480px) {
  /* Extra small screens */
  .bilingual-mode-label {
    font-size: 0.7rem;
  }

  /* Smaller toggle switch for mobile */
  .toggle-switch {
    width: 36px;
    height: 20px;
  }

  .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
  }

  input:checked + .slider:before {
    transform: translateX(16px);
  }

  header .button.button-outline.button-icon {
    padding: 0.25rem;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  header .button.button-outline.button-icon i {
    font-size: 0.8rem;
  }

  /* Extra compact layout for very small screens */
  .header-title-container h1 {
    font-size: 1.1rem;
  }

  .header-title-container p {
    font-size: 0.6rem;
  }
}

/* Tablet and medium screen adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  header {
    flex-direction: row !important;
    align-items: center !important;
  }

  .header-center {
    order: 0;
    margin: 0;
  }

  header > div:first-child {
    order: 0;
  }

  header > div:last-child {
    order: 0;
    justify-content: flex-end;
  }
}

/* Ensure About toggle button blends with card header and text is visible */
#about-toggle {
  background-color: transparent;
  border: none;
  padding: 0; /* Remove default button padding if necessary */
  color: inherit; /* Inherit color from card-header/card */
}

/* Upgrade Button Styles - Cross-browser compatible */
.upgrade-header-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  /* Fallback for older browsers */
  background: #667eea !important;
  color: white !important;
  border: none !important;
  position: relative;
  overflow: hidden;
  /* Cross-browser transition support */
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -ms-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
  /* Ensure consistent rendering */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* Force hardware acceleration */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.upgrade-header-btn:hover {
  /* Cross-browser transform support */
  -webkit-transform: scale(1.05) translateZ(0);
  -moz-transform: scale(1.05) translateZ(0);
  -ms-transform: scale(1.05) translateZ(0);
  -o-transform: scale(1.05) translateZ(0);
  transform: scale(1.05) translateZ(0);
  /* Cross-browser box-shadow */
  -webkit-box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  -moz-box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
  /* Fallback for older browsers */
  background: #5a6fd8 !important;
}

.upgrade-header-btn .upgrade-text {
  margin-left: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Loading state for upgrade button */
.upgrade-header-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.upgrade-header-btn.loading .upgrade-text::after {
  content: "...";
  /* Cross-browser animation support */
  -webkit-animation: dots 1.5s infinite;
  -moz-animation: dots 1.5s infinite;
  -ms-animation: dots 1.5s infinite;
  animation: dots 1.5s infinite;
}

/* Cross-browser dots animation */
@-webkit-keyframes dots {
  0%, 20% { content: "..."; }
  40% { content: "...."; }
  60% { content: "....."; }
  80%, 100% { content: "..."; }
}
@-moz-keyframes dots {
  0%, 20% { content: "..."; }
  40% { content: "...."; }
  60% { content: "....."; }
  80%, 100% { content: "..."; }
}
@-ms-keyframes dots {
  0%, 20% { content: "..."; }
  40% { content: "...."; }
  60% { content: "....."; }
  80%, 100% { content: "..."; }
}
@keyframes dots {
  0%, 20% { content: "..."; }
  40% { content: "...."; }
  60% { content: "....."; }
  80%, 100% { content: "..."; }
}

/* Mobile responsive upgrade button */
@media (max-width: 768px) {
  .upgrade-header-btn .upgrade-text {
    display: none;
  }

  .upgrade-header-btn {
    padding: 0.5rem;
    width: 32px;
    height: 32px;
  }
}

#about-toggle h2.card-title {
  color: hsl(var(--card-foreground)); /* Explicitly set text color */
  margin-bottom: 0; /* Override any potential margin issues */
}

/* Ensure chevron icon color is correct in dark mode (already handled, but good to confirm) */
html[data-theme='dark'] #about-toggle i {
  color: hsl(var(--foreground));
}

/* Settings Panel */
.settings-panel {
  position: relative;
  margin-top: 1rem;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.settings-toggle:hover {
  background-color: hsl(var(--accent));
}

.settings-toggle i {
  transition: transform 0.2s ease;
}

.settings-toggle.active i {
  transform: rotate(180deg);
}

.settings-content {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-content .form-group {
  margin-bottom: 0.75rem;
}

.settings-content .form-group:last-child {
  margin-bottom: 0;
}

/* History styles */
.history-container {
  width: 100%;
}

.history-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-item {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  background-color: var(--card-bg);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.history-item-date, .history-item-time {
  font-weight: 500;
}

.history-item-lang, .history-item-model {
  background-color: var(--accent-light);
  color: var(--accent);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.history-item-content {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.history-item-actions {
  display: flex;
  gap: 0.5rem;
}

.original-text {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.translated-text {
  font-weight: 500;
}

.empty-history {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 0;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 2rem;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
}

.full-text-container {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

/* Notification styles */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: var(--accent);
  color: white;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.notification.success {
  background-color: var(--success);
}

/* Mobile Responsive Styles for Compact Quick Conversation */
@media (max-width: 768px) {
  .bilingual-conversation-card .card-header {
    padding: 0.75rem 1rem 0.5rem 1rem;
  }

  .bilingual-conversation-card .card-content {
    padding: 0.75rem 1rem 1rem 1rem;
  }

  .language-selection-row {
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-direction: column;
  }

  .language-group {
    min-width: 160px;
    width: 100%;
    max-width: 250px;
  }

  .language-select {
    min-width: 160px;
    width: 100%;
  }

  .language-arrow {
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }

  /* MOBILE BILINGUAL MODE: Purple color styling for Hold to Record button */
  .hold-record-button {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    min-width: 160px;
    height: 44px;
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 2px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  .hold-record-button:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4) !important;
    transform: translateY(-2px) !important;
  }

  .hold-record-button:active,
  .hold-record-button.recording {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4) !important;
    transform: translateY(0) !important;
  }

  .action-buttons-row {
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  /* MOBILE BILINGUAL MODE: Purple color styling for action buttons */
  .action-button {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    min-width: 100px;
    height: 34px;
    gap: 0.25rem;
  }

  /* MOBILE BILINGUAL MODE: Manual Record button purple styling */
  .action-button.manual-record-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  .action-button.manual-record-btn:hover {
    background: hsl(var(--primary-dark)) !important;
    border-color: hsl(var(--primary-dark)) !important;
  }

  /* MOBILE BILINGUAL MODE: Translate button purple styling */
  .action-button.translate-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  .action-button.translate-btn:hover {
    background: hsl(var(--primary-dark)) !important;
    border-color: hsl(var(--primary-dark)) !important;
  }

  /* MOBILE BILINGUAL MODE: Upload button purple styling */
  .action-button.upload-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  .action-button.upload-btn:hover {
    background: hsl(var(--primary-dark)) !important;
    border-color: hsl(var(--primary-dark)) !important;
  }

  /* MOBILE DARK MODE: Ensure purple styling is maintained in dark theme */
  [data-theme="dark"] .hold-record-button {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 2px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  [data-theme="dark"] .action-button.manual-record-btn,
  [data-theme="dark"] .action-button.translate-btn,
  [data-theme="dark"] .action-button.upload-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }
}

@media (max-width: 480px) {
  .bilingual-conversation-card {
    margin: 0 0.5rem;
  }

  .language-group {
    min-width: 140px;
  }

  .language-select {
    min-width: 140px;
    font-size: 0.8rem;
  }

  /* MOBILE BILINGUAL MODE: Small screen Hold to Record button purple styling */
  .hold-record-button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-width: 140px;
    height: 40px;
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 2px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  /* MOBILE BILINGUAL MODE: Small screen action buttons purple styling */
  .action-button {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    min-width: 90px;
    height: 32px;
  }

  /* MOBILE BILINGUAL MODE: Small screen Manual Record button purple styling */
  .action-button.manual-record-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  /* MOBILE BILINGUAL MODE: Small screen Translate button purple styling */
  .action-button.translate-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  /* MOBILE BILINGUAL MODE: Small screen Upload button purple styling */
  .action-button.upload-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  /* MOBILE DARK MODE: Small screen - Ensure purple styling is maintained in dark theme */
  [data-theme="dark"] .hold-record-button {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 2px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }

  [data-theme="dark"] .action-button.manual-record-btn,
  [data-theme="dark"] .action-button.translate-btn,
  [data-theme="dark"] .action-button.upload-btn {
    background: hsl(var(--primary)) !important; /* Purple brand background */
    border: 1px solid hsl(var(--primary)) !important; /* Purple brand border */
    color: white !important;
  }
}
