:root {
    --primary: #6366f1;
    --primary-hover: #5558e3;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.8);
    --bg-panel-light: rgba(30, 41, 59, 0.6);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-width: 320px;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Aurora Background */
body::before {
    content: '';
    position: fixed;
    top: -50%; 
    left: -50%; 
    width: 200%; 
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.12), transparent 50%);
    z-index: -1;
    animation: pulse 15s ease-in-out infinite alternate;
}

@keyframes pulse { 
    0% { opacity: 0.4; transform: scale(1); } 
    100% { opacity: 0.7; transform: scale(1.1); } 
}

/* ==========================================================================
   1. APP LAYOUT
   ========================================================================== */

.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: calc(100vh - 64px);
    max-width: 1600px;
    margin: 0 auto;
    gap: 0;
}

/* ==========================================================================
   2. SIDEBAR
   ========================================================================== */

.sidebar {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

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

.sidebar-title-group {
    display: flex; 
    align-items: center; 
    gap: 10px;
}

.sidebar-title-group h3 {
    margin: 0; 
    color: var(--text-main); 
    font-weight: 600;
    font-size: 1.1rem;
}

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

.mobile-close-btn {
    display: none;
}

/* Search Box */
.search-box-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute; 
    left: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 38px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: white;
    outline: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.search-bar:focus { 
    border-color: var(--primary); 
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px var(--primary-glow); 
}

.search-bar::placeholder {
    color: var(--text-muted);
}

/* Notes List */
.notes-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
}

.notes-list::-webkit-scrollbar {
    width: 6px;
}

.notes-list::-webkit-scrollbar-track {
    background: transparent;
}

.notes-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.notes-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.note-item {
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.note-item:hover { 
    background: rgba(255, 255, 255, 0.06); 
    border-color: var(--border);
    transform: translateX(2px);
}

.note-item.active { 
    background: rgba(99, 102, 241, 0.15); 
    border-color: var(--primary);
}

.note-item h4 { 
    margin: 0 0 0.5rem 0; 
    font-size: 0.95rem; 
    color: var(--text-main); 
    font-weight: 600;
}

.note-item p { 
    margin: 0; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta { 
    display: flex; 
    justify-content: space-between; 
    margin-top: 0.5rem; 
    font-size: 0.75rem; 
    color: var(--text-muted); 
}

/* Sidebar Footer */
.sidebar-footer {
    position: relative; 
    width: 100%;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    margin-bottom: 25px; /* Push up by 20px to prevent cutoff */
}

.usage-info-box {
    color: var(--text-muted);
}

.usage-header {
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 8px; 
    font-size: 0.85rem;
}

.profile-menu {
    background-color: black!important;
}

.profile-icon, .submit-icon {
    padding: 10px!important;
}
.usage-progress-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.usage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    transition: width 0.5s ease;
    border-radius: 3px;
}

.upgrade-link-btn {
    width: 100%;
    padding: 0.7rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    color: #818cf8;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.5rem;
}

.upgrade-link-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ==========================================================================
   3. MAIN STAGE
   ========================================================================== */

.main-stage {
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Empty State */
.empty-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.record-circle-bg {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.big-record-btn {
    width: 120px; 
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    box-shadow: 0 10px 40px var(--primary-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2rem;
    display: flex; 
    align-items: center; 
    justify-content: center;
    position: relative;
    z-index: 1;
}

.big-record-btn:hover { 
    transform: scale(1.08); 
    box-shadow: 0 15px 50px var(--primary-glow); 
}

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

.big-record-btn.recording { 
    animation: pulse-record 2s infinite; 
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes pulse-record {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 30px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.main-heading {
    margin-bottom: 0.5rem; 
    font-weight: 700; 
    font-size: 2rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-subtitle {
    max-width: 450px; 
    margin: 0 auto 2.5rem auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Recording Settings */
.recording-settings {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 10;
    position: relative;
}

.setting-pill {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 0 1.2rem;
    height: 44px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.setting-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.setting-pill i {
    color: var(--primary);
    margin-right: 0.6rem;
    font-size: 0.95rem;
}

.transparent-select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 1.5rem;
    min-width: 120px;
}

.transparent-select option {
    background: var(--bg-dark);
    color: white;
    padding: 10px;
}

/* Recording Overlay */
.recording-overlay {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 350px;
    background: linear-gradient(to top, var(--bg-dark) 30%, transparent);
    display: none;
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-end;
    padding-bottom: 3rem;
    z-index: 100;
}

.recording-overlay.active { 
    display: flex;
}

#liveWaveform {
    width: 600px;
    height: 150px;
    max-width: 90%;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
    margin-bottom: 2rem;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 10px;
    display: block;
}

.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.stop-btn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
}

.stop-btn:active {
    transform: translateY(0);
}

.recording-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pause-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pause-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.pause-btn.paused {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    animation: pausePulse 1.5s ease-in-out infinite;
}

@keyframes pausePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

/* ==========================================================================
   4. CONTENT VIEW
   ========================================================================== */

.content-view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 2rem 3rem;
    position: relative;
}

.content-view.active { 
    display: flex; 
}

.content-view::-webkit-scrollbar {
    width: 8px;
}

.content-view::-webkit-scrollbar-track {
    background: transparent;
}

.content-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.note-header-area { 
    margin-bottom: 2rem; 
    padding-bottom: 1.5rem; 
    border-bottom: 1px solid var(--border); 
}

.note-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.note-title-editor { 
    background: transparent; 
    border: none; 
    color: white; 
    font-size: 2.2rem; 
    font-weight: 700; 
    width: 100%; 
    outline: none; 
    margin-bottom: 1rem;
}

.note-title-editor::placeholder {
    color: var(--text-muted);
}

.note-save-status {
    flex-shrink: 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.note-save-status.saving {
    color: #c4b5fd;
    border-color: rgba(196, 181, 253, 0.35);
}

.note-save-status.saved {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.35);
}

.note-save-status.unsaved {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.35);
}

.note-save-status.error {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.35);
}

.note-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* Audio Player */
.audio-player-wrapper {
    background: var(--bg-panel-light);
    border: 1px solid var(--border);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.audio-player-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-player-bottom {
    display: flex;
    justify-content: center;
}

.play-btn-small {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.play-btn-small:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.audio-waveform-container {
    flex: 1;
    height: 48px;
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
}

.audio-waveform-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.audio-waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(99, 102, 241, 0.15);
    pointer-events: none;
    transition: width 0.1s linear;
}

.audio-waveform-cursor {
    position: absolute;
    top: 0;
    left: 0%;
    width: 2px;
    height: 100%;
    background: var(--primary);
    pointer-events: none;
    transition: left 0.1s linear;
    box-shadow: 0 0 4px var(--primary-glow);
}

.audio-time-display {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.time-separator {
    opacity: 0.5;
}

.audio-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.audio-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Tabs */
.tab-container { 
    display: flex; 
    gap: 2rem; 
    margin-bottom: 2rem; 
    border-bottom: 1px solid var(--border); 
}

.tab-btn {
    background: none; 
    border: none; 
    color: var(--text-muted);
    padding: 0.75rem 0; 
    cursor: pointer; 
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active { 
    color: var(--primary); 
    font-weight: 600; 
}

.tab-btn.active::after {
    content: ''; 
    position: absolute; 
    bottom: -1px; 
    left: 0; 
    width: 100%; 
    height: 2px; 
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.tab-toolbar-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.tab-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
    font-weight: 600;
}

.tab-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #c7d2fe;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-action-btn:hover {
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(99, 102, 241, 0.42);
}

.tab-action-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: var(--text-muted);
}

.tab-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.note-editor {
    width: 100%;
    min-height: 260px;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.55);
    color: var(--text-main);
    font: inherit;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    margin-bottom: 0.5rem;
}

.note-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* Markdown Content */
.markdown-content { 
    line-height: 1.8; 
    color: #e2e8f0; 
    max-width: 800px; 
    font-size: 1rem;
}

.markdown-content h1, 
.markdown-content h2 { 
    color: white; 
    margin-top: 2rem; 
    margin-bottom: 1rem;
    font-weight: 600;
}

.markdown-content h2 {
    font-size: 1.5rem;
}

.markdown-content ul { 
    padding-left: 1.5rem; 
    margin: 1rem 0;
}

.markdown-content li { 
    margin-bottom: 0.7rem; 
}

.markdown-content strong { 
    color: var(--primary); 
    font-weight: 600;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.transcript-text {
    line-height: 1.8;
    color: var(--text-main);
    max-width: 800px;
    padding: 1.5rem;
    background: var(--bg-panel-light);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.transcript-plain {
    white-space: pre-wrap;
}

.transcript-segment-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.transcript-segment {
    width: 100%;
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    color: inherit;
    text-align: left;
    transition: all 0.18s ease;
}

.transcript-segment:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

.transcript-segment.active {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.38);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.transcript-segment-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 0.3rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #c7d2fe;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 600;
}

.transcript-segment-text {
    min-width: 0;
    color: var(--text-main);
    line-height: 1.7;
}

.transcript-empty-state {
    color: var(--text-muted);
}

/* Tags */
.tags-wrapper { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
    margin-bottom: 1rem; 
}

.tag-pill { 
    background: rgba(99, 102, 241, 0.15); 
    color: #818cf8; 
    padding: 0.4rem 1rem; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-weight: 500;
}

.tags-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-panel-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    outline: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.tags-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==========================================================================
   5. BUTTONS & ACTIONS
   ========================================================================== */

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

.action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.action-btn.small {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.action-btn-full {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    border: none;
    color: white;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.action-btn-full:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   6. PROCESSING OVERLAY
   ========================================================================== */

.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    text-align: center;
    padding: 2rem;
}

.processing-overlay.active {
    display: flex;
}

.processing-spinner-large {
    width: 70px; 
    height: 70px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

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

.processing-overlay h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.processing-overlay p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.progress-bar-container {
    width: 100%; 
    max-width: 350px;
    height: 6px; 
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px; 
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%; 
    background: linear-gradient(90deg, var(--primary), #a855f7);
    width: 0%; 
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* ==========================================================================
   7. MODALS
   ========================================================================== */

.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-glass {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    
    text-align: center;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-glass {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem; 
    right: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-icon-circle {
    width: 70px; 
    height: 70px;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    color: var(--primary);
    font-size: 1.8rem;
}

.modal-glass h2 { 
    margin: 0 0 0.8rem 0; 
    color: white; 
    font-size: 1.6rem;
}

.modal-glass p { 
    color: var(--text-muted); 
    margin-bottom: 1.5rem; 
    font-size: 1rem; 
    line-height: 1.6; 
}

.tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 12px;
}

.tier-item {
    display: flex; 
    flex-direction: column;
    padding: 1rem 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.tier-item.highlight {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.tier-name { 
    font-weight: 600; 
    margin-bottom: 4px; 
    font-size: 0.9rem;
}

.tier-limit {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Enhanced Tier Comparison */
.tier-comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.tier-comparison .tier-item {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.2s ease;
}

.tier-comparison .tier-item:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}

.tier-comparison .tier-item.highlight {
    background: rgba(99, 102, 241, 0.15);
    border: 2px solid var(--primary);
}

.tier-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.tier-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.tier-comparison .tier-name {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.tier-feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tier-feature:last-child {
    margin-bottom: 0;
}

.tier-feature i {
    color: var(--primary);
    font-size: 0.9rem;
    width: 16px;
    flex-shrink: 0;
}

.tier-feature.highlight-feature {
    color: white;
    font-weight: 500;
}

.tier-feature.highlight-feature i {
    color: #fbbf24;
}

/* Timer Warning Pulse */
@keyframes pulse-warning {
    0%, 100% { 
        transform: scale(1); 
        color: #ef4444;
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
    50% { 
        transform: scale(1.05); 
        color: #f87171;
        text-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
}

.timer-display.pulse-warning {
    animation: pulse-warning 1s ease-in-out infinite;
}


.modal-cta-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modal-cta-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 25px var(--primary-glow); 
}

.modal-footer-text {
    margin-top: 1.2rem; 
    font-size: 0.9rem; 
    color: var(--text-muted);
}

.modal-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.modal-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   8. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
}

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

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

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

.toast.warning {
    border-left: 3px solid var(--warning);
}

/* ==========================================================================
   9. LOADING SPINNERS
   ========================================================================== */

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

/* ==========================================================================
   10. MOBILE RESPONSIVE
   ========================================================================== */

.mobile-backdrop {
    display: none;
}

.mobile-menu-trigger {
    display: none;
}

.content-menu-btn {
    display: none;
}

@media (max-width: 768px) {
    /* Stack layout */
    .app-container {
        grid-template-columns: 1fr;
        height: calc(100dvh - 64px);
    }

    /* Sidebar becomes full-screen drawer */
    /* Sidebar becomes full-screen drawer */
    .sidebar {
        position: fixed !important;
        top: 109px !important; /* Start below navbar */
        left: 0 !important;
        height: calc(100dvh - 64px) !important; /* Subtract navbar height */
        width: 85% !important;
        max-width: 320px !important;
        background: var(--bg-dark) !important;
        /* Ensure Z-Index is higher than backdrop (2000) and Nav (50) */
        z-index: 2100 !important; 
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.7) !important;
        /* Use specific transition to override the global wildcard */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        transform: translateX(-100%) !important;
        padding-top: env(safe-area-inset-top) !important;
        overflow-y: auto !important;
        display: flex !important;
        visibility: visible !important;
    }

    /* HIGHER SPECIFICITY: Ensure this overrides the default state */
    div.sidebar.active {
        transform: translateX(0) !important;
    }

    .modal-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
        z-index: 2000;
        align-items: center;
        justify-content: center;
        overflow: scroll;
        opacity: 0;
        padding-top: 170px;
        transition: opacity 0.3s 
    ease;
    }

    .mobile-backdrop.active {
        top: revert-layer;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    /* Mobile close button */
    .mobile-close-btn {
        display: flex !important;
    }

    /* Mobile backdrop */
    .mobile-backdrop {
        display: block;
        position: fixed;
        top: 64px; /* Start below navbar */
        left: 0; 
        width: 100%; 
        height: calc(100% - 64px); /* Account for navbar */
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
        z-index: 1900;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Mobile menu trigger button - FIXED */
    .mobile-menu-trigger {
        display: flex !important;
        position: fixed !important; /* Changed from absolute to fixed */
        top: 120px; /* Below navbar */
        left: 16px;
        z-index: 1500;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        min-height: 44px; /* Touch target */
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid var(--border);
        border-radius: 30px;
        color: white;
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        transition: all 0.2s ease;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-trigger:hover {
        background: rgba(30, 41, 59, 1);
        border-color: var(--border-hover);
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    .mobile-menu-trigger:active {
        background: rgba(51, 65, 85, 1);
        transform: scale(0.97);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-menu-trigger i {
        font-size: 1rem;
        color: var(--primary);
    }

    .content-menu-btn {
        display: flex !important;
        position: fixed !important;
        top: 80px;
        left: 16px;
    }
    
    /* Ensure empty stage and main stage are properly positioned */
    .empty-stage,
    .main-stage {
        position: relative;
    }

    /* Adjust content view padding */
    .content-view {
        padding: 2rem 1.5rem;
        padding-top: 5rem;
    }

    /* Smaller record button */
    .big-record-btn {
        width: 100px;
        height: 100px;
        font-size: 2rem;
    }

    .main-heading {
        font-size: 1.75rem;
    }

    .main-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    /* Ensure main stage doesn't interfere */
    .main-stage {
        position: relative;
        z-index: 1;
    }

    /* Fix for notes list on mobile */
    .notes-list {
        max-height: calc(100dvh - 300px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Improve touch targets */
    .note-item {
        min-height: 80px;
        padding: 1.25rem;
    }

    /* Mobile menu trigger improvements */
    .mobile-menu-trigger {
        display: flex !important;
        position: fixed !important;
        top: 120px;
        left: 16px;
        z-index: 1500 !important; /* Below backdrop */
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        min-height: 48px; /* Better touch target */
        min-width: 48px;
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid var(--border);
        border-radius: 30px;
        color: white;
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        transition: all 0.2s ease;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation; /* Improve touch response */
    }

    /* Hide menu trigger when sidebar is active */
    .sidebar.active ~ .main-stage .mobile-menu-trigger {
        opacity: 0;
        pointer-events: none;
    }

    /* Sidebar header mobile improvements */
    .sidebar-header {
        flex-shrink: 0;
        position: sticky;
        top: 0;
        background: var(--bg-panel);
        z-index: 10;
        border-bottom: 1px solid var(--border);
    }

    /* Sidebar footer mobile improvements */
    .sidebar-footer {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
    }

    /* Stack recording settings */
    .recording-settings {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 300px;
        gap: 0.75rem;
    }

    .setting-pill {
        width: 100%;
        justify-content: center;
    }

    /* Smaller timer */
    .timer-display {
        font-size: 2.5rem;
    }
    
    /* Waveform adjustments */
    #liveWaveform {
        width: 90%;
        height: 120px;
    }

    /* Audio player adjustments */
    .audio-player-wrapper {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* Note header */
    .note-title-editor {
        font-size: 1.75rem;
    }

    /* Toast positioning */
    .toast-container {
        top: 70px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Modal adjustments */
    .modal-glass {
        width: 95%;
        padding: 2rem 1.5rem;
        overflow: scroll;
    }

    .tier-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    /* Enhanced tier comparison mobile */
    .tier-comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tier-badge {
        font-size: 0.6rem;
        padding: 0.25rem 0.6rem;
    }
    
    .tier-comparison .tier-item {
        padding: 1.5rem 1rem;
    }
}

/* ==========================================================================
   11. UTILITIES
   ========================================================================== */

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

.hidden {
    display: none !important;
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Remove default focus outline, add custom one */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Navigation */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    height: 4rem;
    background-color: #0D0C1D !important;
}

.nav-links {
    display: none;
}

.auth-buttons {
    display: none;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.nav-link:hover {
    background-color: var(--glass-background-hover);
    color: var(--text-color);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Dropdown styles */
.nav-item.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.dropdown-arrow {
    margin-left: 0.4em;
    font-size: 0.7em;
    transition: transform var(--transition-speed) ease;
    display: inline-block;
    vertical-align: middle;
}

.nav-dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem 0;
    background: #0D0C1D;
    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);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    pointer-events: none;
    transition: opacity var(--transition-speed) ease,
                visibility var(--transition-speed) ease,
                transform var(--transition-speed) ease;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-item {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus,
.nav-dropdown-item.active {
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
}

/* Mobile Menu */
.mobile-menu-button {
    display: block;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    cursor: pointer;
    transition: opacity var(--transition-speed);
    margin-left: auto;
    z-index: 51;
}

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

.mobile-menu {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: #0D0C1D !important;
    backdrop-filter: blur(12px);
    padding: 1rem 0;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform var(--transition-speed) ease-out;
    z-index: 49;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.mobile-menu .nav-link:not(.sub-link),
.mobile-menu .mobile-submenu-toggle {
    display: block;
    padding: 0.9rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    color: var(--text-color);
}

.mobile-submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-submenu {
    background-color: rgba(0, 0, 0, 0.1);
    padding-left: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

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

.mobile-menu .auth-buttons-mobile {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 1.5rem 1rem;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    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-outline {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

/* Logo Styling */
.nav-logo-link {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0.25rem 0;
    margin-right: 1rem;
}

.nav-logo-img {
    height: 2.5rem;
    width: auto;
    max-height: calc(100% - 0.5rem);
    transition: height var(--transition-speed) ease;
    display: block;
}

/* General 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-items: center;
    justify-content: center;
    text-align: center;
}

.button-primary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.button-primary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

.copy-success {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.copy-error {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Banner */
.banner-container {
    width: 100%;
    background: #0D0C1D !important;
    position: relative;
    overflow: hidden;
    z-index: 60;
}

.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(--glass-background);
    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);
}


.audio-player-wrapper {
    background: var(--bg-panel-light);
    border: 1px solid var(--border);
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; /* ADD THIS */
}

/* ADD THIS NEW SECTION */
.playback-speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.speed-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.speed-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.speed-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ADD THIS NEW SECTION */
.transcript-search-box {
    margin-bottom: 1rem;
    position: relative;
}

.transcript-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-panel-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.transcript-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.transcript-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.transcript-text mark {
    background: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

/* Add this to your CSS file */
.guest-warning-banner {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 12px 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
    position: relative;
    z-index: 10;
}

.guest-warning-banner a {
    color: #856404;
    font-weight: bold;
    text-decoration: underline;
}

/* ==========================================================================
   DRAG & DROP ZONE
   ========================================================================== */

.drop-zone {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 50;
    background: rgba(99, 102, 241, 0.08);
    border: 2px dashed var(--primary);
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: all 0.3s ease;
}

.drop-zone.active {
    display: flex;
    animation: dropZonePulse 1.5s ease-in-out infinite alternate;
}

.drop-zone-content {
    text-align: center;
    color: var(--primary);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    animation: floatUp 2s ease-in-out infinite alternate;
}

.drop-zone-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.drop-zone-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@keyframes dropZonePulse {
    0% { background: rgba(99, 102, 241, 0.05); }
    100% { background: rgba(99, 102, 241, 0.12); }
}

@keyframes floatUp {
    0% { transform: translateY(5px); }
    100% { transform: translateY(-5px); }
}

/* ==========================================================================
   COPY BUTTON
   ========================================================================== */

.copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: var(--success);
}

/* Tab content needs relative positioning for copy button */
.tab-content {
    position: relative;
}

/* ==========================================================================
   WORD COUNT / READING TIME BAR
   ========================================================================== */

.transcript-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.note-item-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.transcript-stats span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.transcript-stats i {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ==========================================================================
   KEYBOARD SHORTCUTS HINT
   ========================================================================== */

.shortcut-hints {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.shortcut-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==========================================================================
   EXPORT DROPDOWN
   ========================================================================== */

.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 180px;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.export-menu.active {
    display: block;
    animation: fadeSlideDown 0.15s ease-out;
}

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

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.export-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.export-menu-item i {
    width: 1.2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Ensure the empty stage pushes down slightly if banner is present */
.main-stage {
    display: flex;
    flex-direction: column;
}
