:root {
    /* Primary Colors - Matching Writing Assistant */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #A78BFA;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    
    /* Background Colors */
    --bg-primary: #0D0C1D;
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-tertiary: rgba(255, 255, 255, 0.02);
    --bg-hover: rgba(255, 255, 255, 0.1);
    
    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #E5E7EB;
    --text-muted: #9CA3AF;
    --text-light: #6B7280;
    
    /* Border Colors */
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-focus: rgba(255, 255, 255, 0.3);
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Shadows */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    
    /* Other */
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    isolation: isolate;
}

/* Aurora Background Effects */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #4F46E5 0%, transparent 70%);
    opacity: 0.2;
    filter: blur(100px);
    z-index: -1;
    animation: pulse-glow-1 15s infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #A855F7 0%, transparent 70%);
    opacity: 0.2;
    filter: blur(100px);
    z-index: -1;
    animation: pulse-glow-2 12s infinite alternate;
}

@keyframes pulse-glow-1 {
    from { transform: scale(0.8) rotate(0deg); opacity: 0.15; }
    to { transform: scale(1.2) rotate(45deg); opacity: 0.25; }
}

@keyframes pulse-glow-2 {
    from { transform: scale(1.2) rotate(0deg); opacity: 0.25; }
    to { transform: scale(0.8) rotate(-45deg); opacity: 0.15; }
}

/* Container */
.vr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 200px);
}

/* Header */
.vr-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.vr-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #FFFFFF 30%, #A78BFA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vr-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-chip:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.category-chip.active {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: white;
    border-color: transparent;
}

.category-chip i {
    font-size: 0.875rem;
}

.add-category {
    border-style: dashed;
    border-color: var(--border-hover);
}

/* Main Content */
.main-content {
    display: grid;
    gap: 2rem;
}

/* Recording Panel - Glass Effect */
.recording-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.recording-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recording-panel:hover::before {
    opacity: 1;
}

.recording-panel.recording {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4);
    border-color: var(--primary);
}

.recording-visualizer {
    height: 120px;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

#waveform {
    width: 100%;
    height: 100%;
}

.recording-controls {
    text-align: center;
}

.recording-timer {
    font-size: 2rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.5rem;
    box-shadow: 0 4px 15px -3px rgba(79, 70, 229, 0.5);
    z-index: 1000;
}

.control-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(79, 70, 229, 0.5);
}

.control-btn:active {
    transform: scale(0.95);
}

.stop-btn {
    background: linear-gradient(135deg, var(--error), #DC2626);
}

.recording-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.language-select,
.translate-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    z-index:1000;
}

.language-select:hover,
.translate-select:hover {
    border-color: var(--border-hover);
    background: rgba(0, 0, 0, 0.5);
}

.import-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.import-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* Notes Container - Glass Effect */
.notes-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.notes-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.search-box {
    position: relative;
    max-width: 300px;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Notes List */
.notes-list {
    display: grid;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.note-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.note-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 1rem;
}

.note-preview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

.note-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.note-category,
.note-duration,
.note-language {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Usage Info */
.usage-info {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    margin: 2rem auto;
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 90%;
    width: 600px;
    box-shadow: var(--glass-shadow);
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.note-detail {
    width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--error);
    color: white;
    transform: scale(1.1);
}

/* AI Summary Card */
.ai-summary-card {
    background: linear-gradient(135deg, rgba(168, 139, 250, 0.1), rgba(79, 70, 229, 0.1));
    border: 1px solid rgba(168, 139, 250, 0.3);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ai-summary-card h3 {
    color: var(--secondary);
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-summary-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Audio Player */
.audio-player {
    margin-bottom: 1.5rem;
}

#audioPlayer {
    width: 100%;
    height: 48px;
    filter: invert(1) brightness(0.9);
}

/* Transcription Section */
.transcription-section {
    margin-bottom: 1.5rem;
}

.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.transcription-header h3 {
    margin: 0;
    color: var(--text-primary);
}

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

.action-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.transcription-text {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Translation Section */
.translation-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.translation-section h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}

/* Processing Modal */
.processing-modal {
    text-align: center;
    padding: 3rem 2rem;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#processingTitle {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

#processingMessage {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
}

.processing-progress {
    background: var(--bg-secondary);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    min-width: 250px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.button {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
    cursor: pointer;
    border: none;
}

.button-primary {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: white;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.button-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.button-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
    .vr-container {
        padding: 1rem;
    }
    
    .vr-title {
        font-size: 2rem;
    }
    
    .notes-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .note-card {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .note-detail {
        width: 100%;
        max-width: 100%;
    }
    
    .transcription-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .transcription-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        width: 100%;
    }
}


/* Scrollbar Styling */
.notes-list::-webkit-scrollbar,
.transcription-text::-webkit-scrollbar {
    width: 8px;
}

.notes-list::-webkit-scrollbar-track,
.transcription-text::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.notes-list::-webkit-scrollbar-thumb,
.transcription-text::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.notes-list::-webkit-scrollbar-thumb:hover,
.transcription-text::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Print Styles */
@media print {
    .vr-header,
    .category-filter,
    .recording-panel,
    .notes-header,
    .modal-header button,
    .transcription-actions,
    .translation-section,
    .toast-container {
        display: none !important;
    }
    
    .modal {
        display: block !important;
        position: static;
        background: white;
    }
    
    .modal-content {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .transcription-text {
        max-height: none;
        border: none;
        padding: 0;
        background: white;
        color: black;
    }
}

/* ==========================================================================
   4. NAVIGATION
   ========================================================================== */
.nav-container {
  position: sticky;
  top: 0;
  z-index: 50; /* Main nav bar z-index */
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  /* justify-content: space-between; */ /* Let flexbox handle spacing now */
  align-items: center;
  height: 4rem; /* Keep desktop height */
}

/* Base state - mobile first */
.nav-links {
  display: none; /* Hidden on mobile by default (handled by media query later) */
}

.auth-buttons {
  display: none; /* Hidden on mobile by default (handled by media query later) */
}

/* Navigation Links (General Styling) */
.nav-link { /* Applies to top-level links and dropdown toggles */
  padding: 0.5rem 0.75rem; /* Adjusted padding */
  color: var(--text-color);
  text-decoration: none;
  border-radius: 0.375rem; /* Slightly smaller radius */
  transition: background-color var(--transition-speed), color var(--transition-speed);
  white-space: nowrap;
  display: inline-flex; /* Helps align icon if added */
  align-items: center; /* Helps align icon if added */
  position: relative; /* For potential pseudo-elements if needed */
  z-index: 1; /* Ensure links are clickable above any potential background elements within parent */
}

.nav-link:hover {
  background-color: var(--bg-primary-hover);
  color: var(--text-color); /* Ensure text stays white */
}

/* Active state for nav links (including dropdown toggles if needed) */
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2); /* Example active style */
    /* Add other active styles if desired, like font-weight */
}


/* --- START: Desktop Dropdown Styles (Revised for Robust Hover) --- */

/* The parent container for a dropdown item */
/* In your HTML, this should wrap both the toggle and the menu */
/* e.g., <div class="nav-item nav-dropdown"> ... </div> */
.nav-item.nav-dropdown {
  position: relative; /* Crucial: Establishes positioning context for the absolute menu */
  display: inline-block; /* Or flex, depending on how you structure items */
}

/* The link/button that triggers the dropdown */
.nav-dropdown-toggle {
  cursor: pointer;
  /* Inherits .nav-link styles */
}

/* The arrow icon */
.dropdown-arrow {
  margin-left: 0.4em;
  font-size: 0.7em;
  transition: transform var(--transition-speed) ease;
  display: inline-block; /* Prevents pushing text down */
  vertical-align: middle; /* Align with text better */
}

/* The dropdown menu itself */
.nav-dropdown-menu {
  display: block; /* Or 'flex' if you need flex properties for the menu layout */
  position: absolute;
  top: 100%; /* Position below the parent .nav-item */
  left: 0;
  z-index: 1000; /* High z-index to appear above other content */
  min-width: 200px; /* Minimum width */
  padding: 0.5rem 0;
  background: #0D0C1D; /* Custom background */
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);

  /* --- Visibility Control --- */
  opacity: 0; /* Start fully transparent */
  visibility: hidden; /* Start hidden from accessibility tree and rendering */
  transform: translateY(5px); /* Start slightly lower (adjust px as desired) */
  pointer-events: none; /* Prevent interaction when hidden */
  transition: opacity var(--transition-speed) ease,
              visibility var(--transition-speed) ease, /* transition visibility *instantly* with opacity */
              transform var(--transition-speed) ease;
}

/* ---- The KEY HOVER RULE ---- */
/* Show dropdown menu when the PARENT container is hovered */
.nav-item.nav-dropdown:hover > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0); /* Move back to original position */
  pointer-events: auto; /* Allow interaction */
}

/* Rotate arrow when the PARENT container is hovered */
.nav-item.nav-dropdown:hover > .nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

/* Individual items within the dropdown menu */
.nav-dropdown-item {
  display: block;
  padding: 0.6rem 1.2rem; /* Generous padding */
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  background-color: transparent; /* Ensure no background by default */
  border: 0;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus, /* Add focus style for accessibility */
.nav-dropdown-item.active /* Style for active item within dropdown */ {
  background-color: var(--secondary-color); /* Use secondary color for hover/focus/active */
  color: var(--text-color);
  text-decoration: none; /* Ensure no underline appears on hover if not desired */
}
/* --- END: Desktop Dropdown Styles --- */


/* Mobile Menu Button */
.mobile-menu-button {
  display: none; /* Show by default, hide on desktop via media query */
  background: none;
  border: none;
  color: var(--text-color);
  padding: 0.5rem;
  cursor: pointer;
  transition: opacity var(--transition-speed);
  z-index: 51; /* Above mobile menu background */
}

.mobile-menu-button:hover {
  opacity: 0.8;
}

/* Mobile Menu Panel */
.mobile-menu {
  display: none; /* Hidden by default */
  position: fixed;
  /* Adjusted top based on nav height in media queries */
  left: 0;
  right: 0;
  background: #0D0C1D;
  backdrop-filter: blur(12px); /* Increased blur */
  padding: 1rem 0; /* Adjusted padding */
  /* Max height set in media queries */
  overflow-y: auto; /* Allow scrolling if needed */
  transform: translateY(-100%); /* Start hidden above */
  transition: transform var(--transition-speed) ease-out;
  z-index: 49; /* Below navbar container */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  transform: translateY(0);
  display: block;
}

/* Mobile menu general link styling */
.mobile-menu .nav-link:not(.sub-link), /* Target top-level links */
.mobile-menu .mobile-submenu-toggle { /* And the toggle button */
  display: block;
  padding: 0.9rem 1.5rem; /* Adjusted padding */
  text-align: left; /* Align text left */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  font-size: 1rem;
  width: 100%; /* Ensure full width */
  box-sizing: border-box; /* Include padding in width */
  color: var(--text-color);
}




/* Style last top-level item before auth buttons */
.mobile-menu > *:not(.mobile-menu-section):not(.auth-buttons-mobile):last-of-type {
    border-bottom: none;
}
/* Remove bottom border from last mobile menu section */
.mobile-menu .mobile-menu-section:last-of-type > .mobile-submenu-toggle {
    border-bottom: none;
}


/* --- NEW: Mobile Submenu Styles --- */
.mobile-menu-section {
    /* Container for a toggle + submenu block */
}

.profile-icon, .submit-icon {
    padding: 10px!important;
}

.profile-menu {
    background: black!important;
    
}
}
.mobile-submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex; /* Use flex to align text and icon */
    justify-content: space-between; /* Push icon to the right */
    align-items: center;
    /* Inherits padding, font-size etc from the rule above */
}

.mobile-submenu-toggle .dropdown-arrow {
    transition: transform var(--transition-speed) ease;
    font-size: 0.9em; /* Adjust arrow size */
}

/* Toggle active state (assuming JS adds 'active' class or similar) */
/* You might need JS to add this class when expanded */
.mobile-submenu-toggle[aria-expanded="true"] .dropdown-arrow {
     transform: rotate(180deg);
}

.mobile-submenu {
    background-color: rgba(0, 0, 0, 0.1); /* Slight indent background */
    /* display: none; */ /* JS handles display: block/none */
    padding-left: 0; /* Remove padding, handled by sub-links */
    overflow: hidden; /* Helps with animations if added later */
    max-height: 0; /* Start height at 0 for transition */
    transition: max-height 0.3s ease-out; /* Animate height */
}

.mobile-submenu .sub-link {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 2.5rem; /* Indented padding */
    text-align: left;
    font-size: 0.9rem; /* Slightly smaller */
    color: rgba(255, 255, 255, 0.9); /* Slightly dimmer text */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.mobile-submenu .sub-link:last-child {
    border-bottom: none; /* Remove border from last sub-item */
}

.mobile-submenu .sub-link:hover,
.mobile-submenu .sub-link.active /* Style active mobile sublink */ {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}
/* --- END: Mobile Submenu Styles --- */


/* Style separator before mobile auth buttons */
.mobile-menu .auth-buttons-mobile {
  border-top: 1px solid rgba(255, 255, 255, 0.2); /* Use top border for separation */
  padding-top: 1.5rem; /* Add space above buttons */
  margin-top: 1rem; /* Add space below last link/section */
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-bottom: 1rem;
}

/* Logo Styling */
.nav-logo-link {
    display: inline-flex; /* Use flex to help center image if needed */
    align-items: center;
    height: 100%; /* Make link take full nav height for easier clicking */
    padding: 0.25rem 0; /* Add slight vertical padding */
    margin-right: 1rem; /* Space between logo and next item (adjusted in media queries) */
}

.nav-logo-img {
    height: 32px; /* Default height (adjust as needed, maybe match original?) */
    width: auto;   /* Maintain aspect ratio */
    max-height: calc(100% - 0.5rem); /* Ensure it fits within padding */
    transition: height var(--transition-speed) ease; /* Smooth transition */
    display: block; /* Remove extra space below image */
}

/* ==========================================================================
   6. BUTTONS
   ========================================================================== */


.button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-weight: 500;
  display: inline-flex; /* Align icon and text */
  align-items: center;
  justify-content: center;
  text-align: center; /* Ensure text is centered */
}

.button-primary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  border: 1px solid transparent; /* Add transparent border for consistency */
}

.button-primary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.button-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
}

.button-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Menu Buttons */
.auth-buttons-mobile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* More flexible columns */
  gap: 0.75rem;
}

.mobile-menu .button {
  width: 100%;
  padding: 0.75rem 0.5rem;
  font-size: 1rem;
}

.mobile-menu .button-primary {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-menu .button-primary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.mobile-menu .button-outline {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

.mobile-menu .button-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}


/* ==========================================================================
   10. FOOTER & MISC
   ========================================================================== */
.footer {
  background: var(--surface-glass);
  backdrop-filter: blur(5px);
  padding: 4rem 0 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border-glass);
}

.footer-container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; margin-bottom: 4rem; }
.footer-section h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--text-headings); }
.footer-description { color: var(--text-secondary); margin-bottom: 1.5rem; line-height: 1.6; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--text-primary); }

.social-links { display: flex; gap: 1rem; }
.social-link { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-glass-hover); color: var(--text-primary); transition: all var(--transition-speed); }
.social-link:hover { background: var(--accent-primary); transform: translateY(-2px); }

.footer-bottom { border-top: 1px solid var(--border-glass); padding: 2rem 0; margin-top: 2rem; }
.footer-bottom-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { margin: 0; color: var(--text-secondary); }
.footer-bottom-links { display: flex; gap: 2rem; }
.footer-bottom-links a { color: var(--text-secondary); }
.footer-bottom-links a:hover { color: var(--text-primary); }
/* ==========================================================================
   7. BANNER
   ========================================================================== */
.banner-container {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  position: relative;
  overflow: hidden;
}

.banner-content {
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.banner-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: 0.875rem;
  transition: opacity 0.3s ease;
}

.banner-link:hover {
  opacity: 0.9;
  color: var(--text-color);
}

/* 
* NAVIGATION FIX 
* This overrides prompt_optimizer.css navigation styles
* to match the global site navigation
*/

/* Reset the main navigation container */
.nav-container {
  
 
  border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Fix navigation layout */
.nav-content {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important; 
  height: 4rem !important;
  padding: 0 1rem !important;
}

/* Show all navigation links properly */
.nav-links {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-left: 1rem !important;
  margin-right: auto !important;
}

/* Show auth buttons properly */
.auth-buttons {
  display: flex !important;
  gap: 0.5rem !important;
  align-items: center !important;
  margin-left: 1rem !important;
}

/* Fix navigation links appearance */
.nav-link {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.9rem !important;
}

/* Fix dropdown appearance */
.nav-dropdown-menu {
  background: #0D0C1D !important;
  backdrop-filter: blur(15px) !important;
}

/* Mobile menu button position */
@media (max-width: 875px) {
  .mobile-menu-button {
    display: block !important;
    margin-left: auto !important;
  }
  
  .nav-links, .auth-buttons {
    display: none !important;
  }
}


@media (min-width: 768px) {
  .main-content > .col-md-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .input-card, .output-card {
    flex-grow: 0 !important;
    height: auto !important;
    min-height: 300px !important;
    max-height: none !important;
  }
  
  .card-body {
    max-height: 500px !important;
    overflow-y: auto !important;
  }
}


@media (min-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
    }
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    .auth-buttons {
        gap: 0.75rem;
    }
    .button {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* --- Additional Fixes --- */
/* Ensure the mobile-menu auth buttons display correctly */
@media (max-width: 859px) {
    .mobile-menu .auth-buttons-mobile {
        display: grid;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 1.5rem;
        margin-top: 1rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        padding-bottom: 1rem;
    }
}

/* If any styles are being overridden, let's make sure mobile menu has the right display */
@media (max-width: 859px) {
    .mobile-menu.active {
        display: block !important;
    }
}

.note-tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    background: #e0e7ff;
    color: #4338ca;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.summary-type-select {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #1f2937;
    font-size: 0.875rem;
    z-index:1000;
}

/* Tags Input Styles */
.tags-input-container {
    position: relative;
    display: inline-block;
}

.tags-input {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #1f2937;
    font-size: 0.875rem;
    min-width: 200px;
}

.tags-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.tags-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    
    border-radius: 0.5rem;
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 2rem;
}

.tags-display .tag {
    background: #e0e7ff;
    color: #4338ca;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-remove {
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tag-remove:hover {
    opacity: 1;
}

.tags-edit-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tags-edit-container .tags-input {
    flex: 1;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.filter-label:first-child {
    margin-top: 0;
}

.category-select {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #1f2937;
    font-size: 0.875rem;
    min-width: 150px;
    z-index:1000;
}

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 2.5rem;
}

.tag-filter-chip {
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-filter-chip:hover {
    background: #e5e7eb;
}

.tag-filter-chip.active {
    background: #ddd6fe;
    border-color: #a78bfa;
    color: #6d28d9;
}


/* ==========================================================================
   ENHANCED MOBILE RESPONSIVENESS
   ========================================================================== */

/* Mobile-First Base Adjustments */
@media (max-width: 768px) {
    /* Container and Layout */
    .vr-container {
        padding: 1rem 0.5rem;
        min-height: calc(100vh - 120px);
    }
    
    /* Header Adjustments */
    .vr-header {
        padding-top: 1rem;
        margin-bottom: 2rem;
    }
    
    .vr-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
        line-height: 1.2;
    }
    
    .vr-subtitle {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    /* Filter Section Mobile Optimization */
    .filter-section {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .category-filter {
        gap: 0.5rem;
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
        /* Enable smooth horizontal scrolling */
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        /* Add scroll indicators */
        position: relative;
    }
    
    /* Add subtle gradient for scroll indication */
    .category-filter::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, var(--bg-primary));
        pointer-events: none;
    }
    
    .category-chip {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-width: fit-content;
    }
    
    /* Recording Panel Mobile */
    .recording-panel {
        padding: 1.25rem;
        margin: 0 0.5rem;
    }
    
    .recording-visualizer {
        height: 80px;
        margin-bottom: 1.5rem;
    }
    
    .recording-timer {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Control Buttons Mobile */
    .control-buttons {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .control-btn {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    /* Recording Options Mobile Layout */
    .recording-options {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 100%;
    }
    
    .language-select,
    .category-select,
    .summary-type-select,
    .translate-select {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
        -webkit-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        padding-right: 2.5rem;
    }
    
    .tags-input-container {
        width: 100%;
    }
    
    .tags-input {
        width: 100%;
        padding: 0.75rem 2.5rem 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .import-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        justify-content: center;
    }
    
    /* Notes Container Mobile */
    .notes-container {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .notes-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .notes-header h2 {
        font-size: 1.25rem;
    }
    
    .search-box {
        max-width: none;
        width: 100%;
    }
    
    #searchInput {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 1rem;
    }
    
    /* Notes List Mobile */
    .notes-list {
        max-height: none;
        gap: 0.75rem;
        padding-right: 0;
    }
    
    .note-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .note-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .note-title {
        font-size: 1rem;
        flex-basis: 100%;
    }
    
    .note-date {
        font-size: 0.7rem;
        margin-left: 0;
    }
    
    .note-preview {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
    }
    
    .note-footer {
        gap: 0.5rem;
        font-size: 0.7rem;
    }
    
    .note-tags {
        gap: 0.25rem;
    }
    
    .tag {
        font-size: 0.65rem;
        padding: 0.1rem 0.4rem;
    }
    
    /* Empty State Mobile */
    .empty-state {
        padding: 3rem 1.5rem;
    }
    
    .empty-state i {
        font-size: 2.5rem;
    }
    
    .empty-state p {
        font-size: 0.9rem;
    }
    
    /* Usage Info Mobile */
    .usage-info {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        text-align: center;
        line-height: 1.4;
    }
    
    /* Modal Mobile Optimization */
    .modal {
        padding: 0;
        align-items: flex-start;
    }
    
    .modal-content {
        margin: 0;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 1.5rem 1rem;
        animation: slideInUp 0.3s ease;
    }
    
    @keyframes slideInUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .note-detail {
        width: 100%;
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-header {
        margin-bottom: 1rem;
        position: sticky;
        top: -1.5rem;
        background: var(--bg-primary);
        padding: 1rem 0;
        z-index: 10;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
        padding-right: 2rem;
        word-break: break-word;
    }
    
    .close-btn {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    
    /* AI Summary Card Mobile */
    .ai-summary-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .ai-summary-card h3 {
        font-size: 1rem;
    }
    
    .ai-summary-card p {
        font-size: 0.875rem;
    }
    
    /* Audio Player Mobile */
    .audio-player {
        margin-bottom: 1rem;
    }
    
    #audioPlayer {
        height: 40px;
    }
    
    /* Transcription Section Mobile */
    .transcription-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .transcription-header h3 {
        font-size: 1rem;
    }
    
    .transcription-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .action-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-btn i {
        font-size: 1rem;
    }
    
    .transcription-text {
        padding: 1rem;
        font-size: 0.875rem;
        max-height: 300px;
    }
    
    /* Tags Section Mobile */
    .tags-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .tags-display {
        min-height: 2.5rem;
    }
    
    .tags-edit-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tags-edit-container .tags-input {
        width: 100%;
    }
    
    .tags-edit-container .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Translation Section Mobile */
    .translation-section {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .translation-section h3 {
        font-size: 0.9rem;
    }
    
    .translate-select {
        width: 100%;
    }
    
    .translation-section .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Processing Modal Mobile */
    .processing-modal {
        padding: 2rem 1.5rem;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .processing-spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    
    #processingTitle {
        font-size: 1.25rem;
    }
    
    #processingMessage {
        font-size: 0.875rem;
    }
    
    /* Toast Mobile */
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .toast {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Button Groups Mobile */
    .button-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .button {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Filter Tags Mobile */
    .tag-filter {
        gap: 0.4rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .tag-filter-chip {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
}

/* Small Mobile Devices (< 375px) */
@media (max-width: 374px) {
    .vr-title {
        font-size: 1.5rem;
    }
    
    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    .recording-timer {
        font-size: 1.25rem;
    }
    
    .notes-header h2 {
        font-size: 1.1rem;
    }
    
    .transcription-actions {
        grid-template-columns: 1fr;
    }
    
    .action-btn {
        flex-direction: row;
    }
}

/* Landscape Mobile Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .vr-header {
        padding-top: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .recording-visualizer {
        height: 60px;
    }
    
    .control-buttons {
        margin-bottom: 0.75rem;
    }
    
    .modal-content {
        min-height: auto;
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .category-chip,
    .tag-filter-chip {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .control-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .action-btn {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .note-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .control-btn:hover {
        transform: none;
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS viewport height */
    .modal-content {
        min-height: -webkit-fill-available;
    }
    
    /* Fix for iOS select styling */
    select {
        -webkit-appearance: none;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .vr-container {
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
    }
    
    .modal-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
    
    .toast-container {
        left: max(1rem, env(safe-area-inset-left));
        right: max(1rem, env(safe-area-inset-right));
    }
}

/* Fix navigation z-index conflicts on mobile */
@media (max-width: 768px) {
    .nav-container {
        z-index: 1100;
    }
    
    .mobile-menu {
        z-index: 1099;
    }
    
    .modal {
        z-index: 1200;
    }
    
    .toast-container {
        z-index: 1300;
    }
}

.mobile-menu .nav-link:not(.sub-link), .mobile-menu .mobile-submenu-toggle {
    background: #0D0C23;
}