/* =========================================
   Voice Texter — Premium Design System
   ========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #f0f2f8;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --toolbar-bg: #ffffff;
    --btn-primary: #6366f1;
    --btn-primary-hover: #4f46e5;
    --btn-text: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.82);
    --card-border: rgba(255, 255, 255, 0.45);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-blur: 16px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background: var(--bg-color);
    font-family: var(--font-family);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Mesh gradient background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--bg-gradient);
    opacity: 0.06;
    z-index: -1;
    pointer-events: none;
}

/* ===== HEADER ===== */
header {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 14px 28px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    position: sticky;
    top: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--btn-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.logo img {
    max-height: 36px;
    width: auto;
    border-radius: 8px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--btn-primary);
    background: color-mix(in srgb, var(--btn-primary) 6%, transparent);
}

/* ===== CONTAINER ===== */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 24px auto;
    width: 92%;
    gap: 24px;
}

/* ===== AD SLOTS ===== */
.ad-slot {
    text-align: center;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* ===== EDITOR WRAPPER — Glassmorphism ===== */
.editor-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    transition: var(--transition);
}

.editor-wrapper:focus-within {
    box-shadow: 0 8px 32px color-mix(in srgb, var(--btn-primary) 12%, transparent), 0 0 0 1px color-mix(in srgb, var(--btn-primary) 15%, transparent);
}

/* ===== TOOLBAR ===== */
.toolbar {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--toolbar-bg);
}

.toolbar button,
.toolbar select {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    position: relative;
}

.toolbar button:hover {
    background: color-mix(in srgb, var(--btn-primary) 8%, transparent);
    color: var(--btn-primary);
    border-color: color-mix(in srgb, var(--btn-primary) 25%, transparent);
    transform: translateY(-1px);
}

.toolbar button:active {
    transform: translateY(0px);
}

/* Tooltip on hover */
.toolbar button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: #1e293b;
    color: white;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    animation: tooltipIn 0.15s ease;
}

@keyframes tooltipIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

/* Language button */
#langParamsBtn {
    flex-grow: 1;
    max-width: 260px;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-color);
}

/* ===== EXPORT DROPDOWN ===== */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
    animation: dropdownIn 0.2s ease;
}

.export-menu.show {
    display: block;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.export-menu button {
    display: flex;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 0.85rem;
    color: var(--text-color);
    cursor: pointer;
    gap: 10px;
    align-items: center;
    transition: background 0.15s;
}

.export-menu button:hover {
    background: rgba(99, 102, 241, 0.06);
    color: var(--btn-primary);
    transform: none;
}

.export-menu button i {
    width: 18px;
    color: var(--text-muted);
}

/* ===== INTERIM RESULT ===== */
#interimResult {
    padding: 10px 20px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-style: italic;
    font-size: 0.9rem;
    min-height: 20px;
    background: rgba(99, 102, 241, 0.02);
}

/* ===== EDITOR ===== */
#editor {
    flex: 1;
    padding: 24px;
    font-size: 1.05rem;
    line-height: 1.75;
    outline: none;
    overflow-y: auto;
    min-height: 300px;
    color: var(--text-color);
    background: transparent;
}

#editor:empty::before {
    content: "Tap the microphone and start speaking...";
    color: #94a3b8;
    font-style: italic;
}

/* Scrollbar Styling */
#editor::-webkit-scrollbar {
    width: 6px;
}

#editor::-webkit-scrollbar-track {
    background: transparent;
}

#editor::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

#editor::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ===== MIC CONTROLS ===== */
.mic-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px 0 10px;
}

.circle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-btn:hover {
    color: var(--btn-primary);
    transform: scale(1.08);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--btn-primary) 15%, transparent);
}

.circle-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== MIC BUTTON — Premium ===== */
.mic-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Outer glow rings (hidden by default, shown when listening) */
.mic-wrapper::before,
.mic-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.mic-wrapper::before {
    width: 110px;
    height: 110px;
    border: 2px solid rgba(239, 68, 68, 0.15);
}

.mic-wrapper::after {
    width: 130px;
    height: 130px;
    border: 2px solid rgba(239, 68, 68, 0.08);
}

.mic-wrapper.listening::before {
    opacity: 1;
    animation: ringPulse 2s ease-in-out infinite;
}

.mic-wrapper.listening::after {
    opacity: 1;
    animation: ringPulse 2s ease-in-out infinite 0.3s;
}

@keyframes ringPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.2;
    }
}

#micBtn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--btn-primary) 0%, var(--btn-primary-end) 100%);
    color: var(--btn-text);
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--btn-primary) 35%, transparent);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

#micBtn:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--btn-primary) 45%, transparent);
}

#micBtn:active {
    transform: scale(0.97);
}

#micBtn.listening {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
    animation: micGlow 2s ease-in-out infinite;
}

@keyframes micGlow {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
    }

    50% {
        box-shadow: 0 8px 36px rgba(239, 68, 68, 0.55), 0 0 60px rgba(239, 68, 68, 0.15);
    }
}

/* Visualizer bars around mic */
.visualizer-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.viz-bar {
    position: absolute;
    width: 3px;
    background: rgba(239, 68, 68, 0.5);
    border-radius: 3px;
    transform-origin: center center;
    transition: height 0.1s ease;
}

#status {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
}

.status-dot.active {
    background: var(--success);
    animation: dotBlink 1.2s ease-in-out infinite;
}

.status-dot.recording {
    background: var(--danger);
    animation: dotBlink 0.8s ease-in-out infinite;
}

@keyframes dotBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ===== COMMANDS SIDEBAR ===== */
.commands-sidebar {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    height: fit-content;
    max-width: 300px;
    flex: 1;
}

.commands-sidebar h3 {
    margin: 0 0 14px;
    color: var(--btn-primary);
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid color-mix(in srgb, var(--btn-primary) 10%, transparent);
}

.commands-sidebar table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.commands-sidebar th {
    text-align: left;
    color: var(--text-muted);
    padding: 5px 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.commands-sidebar td {
    padding: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-color);
}

.commands-sidebar tr:last-child td {
    border-bottom: none;
}

.cmd-label {
    display: inline-block;
    background: color-mix(in srgb, var(--btn-primary) 8%, transparent);
    color: var(--btn-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ===== COUNTERS BAR ===== */
.counters-bar {
    display: flex;
    gap: 16px;
    padding: 8px 20px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: rgba(248, 250, 252, 0.5);
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.counter-item strong {
    color: var(--text-color);
    font-weight: 600;
}

.auto-save-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.3s;
}

.auto-save-status.show {
    opacity: 1;
}

.auto-save-status i {
    font-size: 0.7rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-color);
    pointer-events: auto;
    animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    border-left: 4px solid var(--btn-primary);
    max-width: 340px;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast .toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ===== LANGUAGE MODAL ===== */
.lang-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    background: transparent;
}

.lang-item:hover {
    background: rgba(99, 102, 241, 0.04);
}

.lang-item.active {
    background: rgba(99, 102, 241, 0.06);
    color: var(--btn-primary);
    font-weight: 600;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    margin: auto;
    padding: 0;
    border-radius: var(--radius);
    width: 92%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: rgba(248, 250, 252, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.close-modal {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

.modal-body {
    padding: 20px 24px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ===== SETTINGS GROUPS ===== */
.setting-group {
    margin-bottom: 24px;
}

.setting-group h4 {
    margin: 0 0 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-size: 0.9rem;
    color: var(--text-color);
}

.switch-row:last-child {
    border-bottom: none;
}

/* Toggle Switch */
.switch-row input {
    display: none;
}

.slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #d1d5db;
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
    flex-shrink: 0;
}

.slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked+.slider {
    background: var(--btn-primary);
}

input:checked+.slider::before {
    transform: translateX(20px);
}

/* ===== CONTENT AREA ===== */
.content-area {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    line-height: 1.7;
    color: var(--text-color);
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 24px 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-social {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 12px 0;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--btn-primary) 8%, transparent);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-social a:hover {
    color: var(--btn-primary);
    background: color-mix(in srgb, var(--btn-primary) 14%, transparent);
    transform: translateY(-2px);
}

.footer-desc {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ===== KEYBOARD SHORTCUTS BADGE ===== */
.kbd {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'SF Mono', 'Menlo', monospace;
    color: var(--text-muted);
    border: 1px solid rgba(0, 0, 0, 0.08);
    line-height: 1.4;
}

/* ===== WORD / CHAR COUNTER ===== */
#wordCounter {
    text-align: right;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 6px 20px;
}

/* ===== DARK MODE ===== */
body.dark-mode {
    --bg-color: #0f172a;
    --bg-gradient: linear-gradient(135deg, #312e81 0%, #581c87 50%, #1e1b4b 100%);
    --toolbar-bg: #1e293b;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.85);
    --card-border: rgba(51, 65, 85, 0.6);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-mode header {
    background: rgba(15, 23, 42, 0.85);
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .toolbar {
    background: rgba(15, 23, 42, 0.4);
}

body.dark-mode .toolbar button,
body.dark-mode .toolbar select {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.5);
    color: var(--text-muted);
}

body.dark-mode .toolbar button:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode #editor {
    background: transparent;
    color: var(--text-color);
}

body.dark-mode #editor:empty::before {
    color: #475569;
}

body.dark-mode #editor::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .circle-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.5);
    color: var(--text-muted);
}

body.dark-mode .circle-btn:hover {
    color: #a5b4fc;
}

body.dark-mode #micBtn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

body.dark-mode #micBtn.listening {
    background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

body.dark-mode .modal-content {
    background: #1e293b;
}

body.dark-mode .modal-header {
    background: rgba(15, 23, 42, 0.6);
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .lang-item {
    background: transparent;
    border-bottom-color: rgba(51, 65, 85, 0.3);
}

body.dark-mode .lang-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

body.dark-mode .lang-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
}

body.dark-mode .toast {
    background: #1e293b;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: var(--text-color);
}

body.dark-mode .export-menu {
    background: #1e293b;
    border-color: rgba(51, 65, 85, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode .export-menu button {
    color: var(--text-color);
}

body.dark-mode .export-menu button:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

body.dark-mode .counters-bar {
    background: rgba(15, 23, 42, 0.4);
    border-top-color: rgba(51, 65, 85, 0.3);
}

body.dark-mode .commands-sidebar td {
    border-bottom-color: rgba(51, 65, 85, 0.3);
}

body.dark-mode .commands-sidebar th {
    color: #64748b;
}

body.dark-mode .switch-row {
    border-bottom-color: rgba(51, 65, 85, 0.3);
}

body.dark-mode .close-modal:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

body.dark-mode .cmd-label {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

body.dark-mode .kbd {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

/* ===== FULLSCREEN MODE ===== */
body.fullscreen-mode {
    overflow: hidden;
}

body.fullscreen-mode::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9990;
}

body.fullscreen-mode header,
body.fullscreen-mode footer,
body.fullscreen-mode .content-area,
body.fullscreen-mode .ad-slot:not(.ad-slot-card),
body.fullscreen-mode .container>.ad-slot {
    display: none !important;
}

body.fullscreen-mode .commands-sidebar {
    display: none !important;
}

/* Editor fills the center, leaving 280px on each side for sidebar ads */
body.fullscreen-mode .container {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9995;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    display: block !important;
}

body.fullscreen-mode .main-content-area {
    position: fixed !important;
    top: 20px !important;
    bottom: 20px !important;
    left: 300px !important;
    right: 300px !important;
    z-index: 9999;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 0 !important;
    width: auto !important;
    max-width: none !important;
    flex-direction: column !important;
}

body.fullscreen-mode .editor-wrapper {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body.fullscreen-mode #editor {
    flex: 1 !important;
    height: auto !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}

/* Sidebar ad slots on left and right */
body.fullscreen-mode .fullscreen-sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    bottom: 0;
    width: 280px;
    background: transparent;
    z-index: 9998;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

body.fullscreen-mode .fullscreen-sidebar.left {
    left: 0;
}

body.fullscreen-mode .fullscreen-sidebar.right {
    right: 0;
}

body.fullscreen-mode .ad-slot-card {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    border: none;
}

.fullscreen-sidebar {
    display: none;
}

.modal {
    z-index: 20000 !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .main-content-area {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .editor-wrapper {
        width: 100% !important;
        max-width: none !important;
    }

    .commands-sidebar {
        width: 100% !important;
        max-width: none !important;
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px 16px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .nav-menu a {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    .container {
        margin: 12px auto;
        width: 96%;
        gap: 14px;
    }

    .toolbar {
        padding: 8px 10px;
        gap: 4px;
    }

    .toolbar button {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    #langParamsBtn {
        max-width: 180px;
        font-size: 0.82rem;
    }

    #editor {
        padding: 16px;
        font-size: 0.95rem;
        min-height: 200px;
    }

    #micBtn {
        width: 64px;
        height: 64px;
        font-size: 1.3rem;
    }

    .circle-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    /* Fullscreen adjustments */
    body.fullscreen-mode .main-content-area {
        left: 10px !important;
        right: 10px !important;
        top: 10px !important;
        bottom: 10px !important;
    }

    body.fullscreen-mode .editor-wrapper {
        border-radius: var(--radius-sm);
    }

    body.fullscreen-mode .fullscreen-sidebar {
        display: none !important;
    }

    .toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: 100%;
    }

    .counters-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 6px 14px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white !important;
    }

    body::before {
        display: none;
    }

    header,
    footer,
    .toolbar,
    .mic-controls,
    .commands-sidebar,
    .ad-slot,
    .fullscreen-sidebar,
    #status,
    .counters-bar,
    .toast-container,
    #wordCounter,
    #interimResult {
        display: none !important;
    }

    .editor-wrapper {
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        backdrop-filter: none !important;
    }

    #editor {
        padding: 0 !important;
        font-size: 12pt !important;
        color: black !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
}