/* C:\wamp64\www\rus_dili_oyren\styles.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Spectral:ital,wght@0,400;0,600;1,400&family=Manrope:wght@400;600;800&display=swap');

:root {
    /* Light Theme (Default) */
    --bg-dark: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-input: rgba(255, 255, 255, 0.8);
    --border-light: rgba(0, 0, 0, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.1);
    --secondary: #7c3aed;
    --secondary-glow: rgba(124, 58, 237, 0.1);
    --text-main: #0f172a;
    --text-muted: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-blur: blur(20px);
    --bg-gradient: radial-gradient(circle at 50% 0%, #e0e7ff 0%, #f8fafc 80%);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    --chat-left: rgba(0, 0, 0, 0.03);
    --chat-right: rgba(124, 58, 237, 0.06);
    --table-header: #f1f5f9;

    /* Default Brand Colors (Terracotta Light Theme) */
    --brand-primary: hsl(13, 67%, 54%);
    --brand-primary-hover: hsl(13, 67%, 48%);
    --brand-bg: hsl(40, 53%, 98%);
    --brand-card: hsl(40, 27%, 96%);
    --brand-border: hsl(42, 21%, 88%);
    --brand-text: hsl(13, 20%, 15%);
    --brand-muted: hsl(13, 10%, 45%);
    --brand-clay-shadow: inset 0 2px 4px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 4px 0 rgba(0, 0, 0, 0.05), 0 10px 30px -10px rgba(217, 93, 57, 0.15);

    /* Backwards compatibility */
    --terracotta-primary: var(--brand-primary);
    --terracotta-primary-hover: var(--brand-primary-hover);
    --terracotta-bg: var(--brand-bg);
    --terracotta-card: var(--brand-card);
    --terracotta-border: var(--brand-border);
    --terracotta-text: var(--brand-text);
    --terracotta-muted: var(--brand-muted);
    --terracotta-clay-shadow: var(--brand-clay-shadow);
}

/* --- Theme Overrides (Light Mode) --- */
[data-color-theme="forest"] {
    --brand-primary: hsl(142, 60%, 40%);
    --brand-primary-hover: hsl(142, 60%, 35%);
    --brand-bg: hsl(100, 30%, 98%);
    --brand-card: hsl(100, 20%, 95%);
    --brand-border: hsl(100, 15%, 88%);
    --brand-text: hsl(142, 25%, 15%);
    --brand-muted: hsl(142, 10%, 45%);
    --brand-clay-shadow: inset 0 2px 4px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 4px 0 rgba(0, 0, 0, 0.05), 0 10px 30px -10px rgba(46, 117, 89, 0.15);
}

[data-color-theme="ocean"] {
    --brand-primary: hsl(200, 75%, 50%);
    --brand-primary-hover: hsl(200, 75%, 44%);
    --brand-bg: hsl(210, 40%, 98%);
    --brand-card: hsl(210, 25%, 95%);
    --brand-border: hsl(210, 20%, 88%);
    --brand-text: hsl(200, 25%, 15%);
    --brand-muted: hsl(200, 10%, 45%);
    --brand-clay-shadow: inset 0 2px 4px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 4px 0 rgba(0, 0, 0, 0.05), 0 10px 30px -10px rgba(50, 130, 200, 0.15);
}

[data-color-theme="mono"] {
    --brand-primary: hsl(0, 0%, 20%);
    --brand-primary-hover: hsl(0, 0%, 10%);
    --brand-bg: hsl(0, 0%, 98%);
    --brand-card: hsl(0, 0%, 95%);
    --brand-border: hsl(0, 0%, 88%);
    --brand-text: hsl(0, 0%, 10%);
    --brand-muted: hsl(0, 0%, 45%);
    --brand-clay-shadow: inset 0 2px 4px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 4px 0 rgba(0, 0, 0, 0.05), 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-dark: #090a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(255, 255, 255, 0.04);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.4);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --secondary: #8b5cf6;
    --secondary-glow: rgba(139, 92, 246, 0.15);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1a152e 0%, var(--bg-dark) 70%);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --chat-left: rgba(255, 255, 255, 0.04);
    --chat-right: var(--secondary-glow);
    --table-header: rgba(255, 255, 255, 0.01);

    /* Default Brand Colors (Terracotta Dark Theme) */
    --brand-bg: hsl(13, 25%, 8%);
    --brand-card: hsl(13, 22%, 12%);
    --brand-border: hsl(13, 18%, 18%);
    --brand-text: hsl(40, 20%, 92%);
    --brand-muted: hsl(40, 10%, 65%);
    --brand-clay-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px -10px rgba(0, 0, 0, 0.5);

    /* Backwards compatibility */
    --terracotta-bg: var(--brand-bg);
    --terracotta-card: var(--brand-card);
    --terracotta-border: var(--brand-border);
    --terracotta-text: var(--brand-text);
    --terracotta-muted: var(--brand-muted);
    --terracotta-clay-shadow: var(--brand-clay-shadow);
}

/* --- Theme Overrides (Dark Mode) --- */
[data-theme="dark"][data-color-theme="forest"] {
    --brand-primary: hsl(142, 60%, 40%);
    --brand-primary-hover: hsl(142, 60%, 35%);
    --brand-bg: hsl(142, 25%, 8%);
    --brand-card: hsl(142, 22%, 12%);
    --brand-border: hsl(142, 18%, 18%);
    --brand-text: hsl(100, 20%, 92%);
    --brand-muted: hsl(100, 10%, 65%);
    --brand-clay-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"][data-color-theme="ocean"] {
    --brand-primary: hsl(200, 75%, 50%);
    --brand-primary-hover: hsl(200, 75%, 44%);
    --brand-bg: hsl(200, 25%, 8%);
    --brand-card: hsl(200, 22%, 12%);
    --brand-border: hsl(200, 18%, 18%);
    --brand-text: hsl(210, 20%, 92%);
    --brand-muted: hsl(210, 10%, 65%);
    --brand-clay-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"][data-color-theme="mono"] {
    --brand-primary: hsl(0, 0%, 70%);
    --brand-primary-hover: hsl(0, 0%, 80%);
    --brand-bg: hsl(0, 0%, 8%);
    --brand-card: hsl(0, 0%, 12%);
    --brand-border: hsl(0, 0%, 18%);
    --brand-text: hsl(0, 0%, 92%);
    --brand-muted: hsl(0, 0%, 65%);
    --brand-clay-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Manrope', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Glassmorphism Panel/Card */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--card-shadow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

/* Theme Toggle Button Style */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(15deg);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Inputs */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.input-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s ease;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Navigation / Layout */
header {
    height: 80px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.05);
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Grid & Dashboard layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 80px);
    overflow: hidden;
}

.sidebar {
    border-right: 1px solid var(--border-light);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255, 255, 255, 0.01);
}

.admin-sidebar {
    border-right: 1px solid var(--border-light);
    padding: 24px;
    background: rgba(255, 255, 255, 0.01);
}

.sidebar-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-content-layout {
    grid-template-columns: 300px 1fr;
}

.main-content {
    padding: 40px;
    overflow-y: auto;
    height: 100%;
}

/* Sidebar Item */
.sidebar-item {
    padding: 14px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-main);
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-item.active {
    background: var(--primary-glow);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
    font-weight: 600;
}

/* Content Blocks */
.word-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    margin-bottom: 12px;
}

.word-ru {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.word-az {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Audio Player */
.play-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-btn * {
    pointer-events: none;
}

.play-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 30px;
    padding-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

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

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

/* Dialogue Chat Bubble styles */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.chat-bubble {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.5;
    position: relative;
}

.chat-bubble.left {
    align-self: flex-start;
    background: var(--chat-left);
    border: 1px solid var(--border-light);
    border-top-left-radius: 4px;
}

.chat-bubble.right {
    align-self: flex-end;
    background: var(--chat-right);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-top-right-radius: 4px;
}

/* Badge styles */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Grid systems */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Admin Dashboard Table */
table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.table-responsive table {
    margin-top: 0;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    min-width: 120px;
}

th {
    font-weight: 600;
    color: var(--text-muted);
    background: var(--table-header);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Admin Layout & Specific Components */
.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 80px);
}
.admin-main {
    padding: 40px;
}
.form-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
}
.form-section h3 {
    color: var(--text-main);
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}
.status-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-circle.active { background: var(--success); }
.status-circle.inactive { background: var(--danger); }
.receipt-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.receipt-link:hover { text-decoration: underline; }
.dialogue-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr auto;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

/* ==========================================================================
   Dərin Mobil Sazlamaları (iPads, Tablets, Mobile Phones)
   ========================================================================== */

/* 1. Böyük Planşetlər və iPad-lər (max-width: 1024px) */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 260px 1fr;
    }
    .admin-layout {
        grid-template-columns: 240px 1fr;
    }
    .main-content, .admin-main {
        padding: 24px;
    }
    header {
        padding: 0 24px;
    }
}

/* 2. Mobil Telefonlar və Kiçik Planşetlər (max-width: 768px) */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
        overflow-y: auto;
    }

    /* Prevent ANY element from causing horizontal overflow */
    *, *::before, *::after {
        max-width: 100%;
    }

    /* ===== HEADER ===== */
    header {
        height: auto;
        padding: 14px 16px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        text-align: left;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    header .logo {
        font-size: 1.1rem;
    }
    header > div {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        width: auto !important;
        flex-wrap: wrap;
    }
    header > div > span {
        display: none; /* Hide welcome text on mobile */
    }

    /* ===== GRID LAYOUTS ===== */
    .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* ===== ADMIN LAYOUT ===== */
    .dashboard-container, .admin-layout {
        grid-template-columns: 1fr !important;
        height: auto !important;
        overflow: visible !important;
    }

    .main-content, .admin-main {
        padding: 12px !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* ===== SIDEBAR → Horizontal Scroll Menu ===== */
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 10px 12px;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        gap: 8px;
        height: auto;
        max-height: none;
        position: sticky;
        top: 0;
        z-index: 99;
        background: var(--bg-dark);
        -webkit-overflow-scrolling: touch;
    }
    .sidebar h3 {
        display: none;
    }

    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 10px 12px;
        background: var(--bg-dark);
        position: sticky;
        top: 0;
        z-index: 99;
        height: auto;
        overflow-x: auto;
    }
    .sidebar-title {
        display: none;
    }

    .sidebar-menu {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .sidebar::-webkit-scrollbar, .sidebar-menu::-webkit-scrollbar {
        display: none;
    }
    .sidebar, .sidebar-menu {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .sidebar-item {
        display: inline-flex;
        width: auto;
        flex-shrink: 0;
        padding: 8px 14px;
        margin: 0;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    .sidebar-item div {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .sidebar-item strong {
        font-size: 0.85rem;
    }
    .sidebar-item div span {
        display: none;
    }
    .sidebar-item i.fa-chevron-right {
        display: none;
    }

    .admin-content-layout {
        grid-template-columns: 1fr !important;
    }

    /* ===== ALL INLINE GRID OVERRIDES ===== */
    /* 3-column form grids (Add Student, Add Word, Add Question) */
    [style*="grid-template-columns: 1fr 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 5-column dialogue row grids */
    [style*="grid-template-columns: 120px 1fr 1fr 180px auto"],
    [style*="grid-template-columns:120px 1fr 1fr 180px auto"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .dialogue-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    .dialogue-row button,
    .dialogue-row .btn {
        align-self: flex-start;
        width: auto;
    }

    /* ===== TABLES ===== */
    th, td {
        padding: 10px 8px;
        font-size: 0.85rem;
        min-width: unset !important;
    }
    .table-responsive {
        margin-top: 12px;
    }
    table {
        font-size: 0.85rem;
    }

    /* Action buttons in table cells */
    td div[style*="display:flex"],
    td div[style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* ===== FORM SECTIONS ===== */
    .form-section {
        padding: 16px;
        margin-bottom: 20px;
    }
    .form-section h3 {
        font-size: 1rem;
    }

    /* ===== GLASS PANELS ===== */
    .glass-panel {
        border-radius: 12px;
    }
    .glass-panel[style*="padding:24px"],
    .glass-panel[style*="padding: 24px"] {
        padding: 14px !important;
    }
    .glass-panel[style*="padding:30px"],
    .glass-panel[style*="padding: 30px"] {
        padding: 16px !important;
    }

    /* ===== BUTTONS ===== */
    .btn-sm {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    /* ===== DIALOGUE CHAT BUBBLES ===== */
    .chat-bubble {
        max-width: 95%;
        padding: 12px 14px;
    }

    /* ===== WORD EDIT MODAL ===== */
    #word-edit-modal > div {
        width: 95% !important;
        max-width: 95% !important;
        padding: 20px !important;
        margin: 16px;
    }

    /* ===== INACTIVE LAYOUT ===== */
    .inactive-container {
        margin: 12px;
        padding: 14px;
    }
    .card-details {
        padding: 14px;
    }

    /* ===== FLEX WRAP helpers for inline flex ===== */
    [style*="display:flex"][style*="gap:10px"],
    [style*="display: flex"][style*="gap: 10px"],
    [style*="display:flex"][style*="gap:16px"],
    [style*="display: flex"][style*="gap: 16px"] {
        flex-wrap: wrap !important;
    }

    /* Topic nav items in content view */
    [style*="justify-content:space-between"][style*="align-items:center"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Topic search form */
    form[style*="max-width:400px"],
    form[style*="max-width: 400px"] {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Guide list items */
    li[style*="display:flex"][style*="justify-content:space-between"] {
        flex-direction: column !important;
        gap: 4px !important;
    }

    /* Guide text */
    .glass-panel h2 {
        font-size: 1.2rem;
    }
    .glass-panel h3 {
        font-size: 1rem;
    }
    .glass-panel h4 {
        font-size: 0.95rem;
    }
    .glass-panel p {
        font-size: 0.9rem;
    }
    .glass-panel ul {
        padding-left: 18px;
    }
    .glass-panel li {
        font-size: 0.88rem;
    }
    .glass-panel code {
        font-size: 0.82rem;
    }
}

/* 3. Çox Kiçik Mobil Telefonlar (max-width: 480px) */
@media (max-width: 480px) {
    header {
        padding: 10px 12px;
    }
    .logo {
        font-size: 1rem;
    }
    header > div .btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    .word-card {
        padding: 10px 12px;
    }
    .word-ru {
        font-size: 1rem;
    }
    .word-az {
        font-size: 0.85rem;
    }
    .btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
    .main-content h2, .admin-main h2 {
        font-size: 1.25rem;
    }
    .tabs {
        margin-bottom: 16px;
    }
    .tab-btn {
        padding: 6px 10px;
        font-size: 0.88rem;
    }
    th, td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    .input-label {
        font-size: 0.8rem;
    }
    .sidebar-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .glass-panel {
        border-radius: 10px;
    }
    .form-section {
        padding: 12px;
    }
}

/* ==========================================================================
   Terracotta Landing Page Styles
   ========================================================================== */

.landing-body {
    background-color: var(--terracotta-bg) !important;
    color: var(--terracotta-text) !important;
    font-family: 'Manrope', sans-serif !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.landing-header {
    background: var(--terracotta-bg) !important;
    border-bottom: 1px solid var(--terracotta-border) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    height: auto !important;
    position: relative;
    z-index: 10;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--terracotta-primary);
    text-decoration: none;
}

.landing-logo img {
    transition: filter 0.3s ease;
}

[data-theme="dark"] .landing-logo img {
    filter: brightness(0) invert(1);
}

/* Contact Dropdown Styles */
.header-contact-dropdown-container {
    position: relative;
    display: inline-block;
}

.contact-dropdown-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

[data-theme="dark"] .contact-dropdown-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.contact-dropdown-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

[data-theme="dark"] .contact-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.contact-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff; /* Opaque solid white */
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 8px;
    min-width: 220px;
    z-index: 1000;
    flex-direction: column;
    gap: 4px;
}

.contact-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

[data-theme="dark"] .contact-dropdown-menu {
    background: #0f172a; /* Opaque solid dark slate */
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.contact-dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .contact-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.06);
}

.header-contact-dropdown-container.open .contact-dropdown-menu {
    display: flex !important;
}

.menu-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px 2px 14px;
}

.menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 0;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--terracotta-border);
    color: var(--terracotta-text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.lang-btn:hover {
    background: var(--terracotta-card);
    border-color: var(--terracotta-primary);
}

.theme-toggle-terracotta {
    background: var(--terracotta-card);
    border: 1px solid var(--terracotta-border);
    color: var(--terracotta-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--terracotta-clay-shadow);
    transition: all 0.2s ease;
}

.theme-toggle-terracotta:hover {
    transform: scale(1.05) rotate(15deg);
}

.landing-hero {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-badge {
    align-self: flex-start;
    background: var(--terracotta-card);
    border: 1px solid var(--terracotta-border);
    color: var(--terracotta-primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--terracotta-clay-shadow);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    color: var(--terracotta-text);
}

.hero-title span {
    color: var(--terracotta-primary);
}

.russian-greet {
    font-family: 'Spectral', serif;
    font-style: italic;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--terracotta-muted);
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.hero-pill {
    background: var(--terracotta-card);
    border: 1px solid var(--terracotta-border);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--terracotta-text);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--terracotta-clay-shadow);
}

.hero-pill.primary {
    background: var(--terracotta-primary);
    border-color: var(--terracotta-primary);
    color: #fff;
}

.hero-right {
    display: flex;
    justify-content: center;
}

.clay-card {
    background: var(--terracotta-card);
    border: 1px solid var(--terracotta-border);
    border-radius: 24px;
    box-shadow: var(--terracotta-clay-shadow);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}

.clay-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--terracotta-primary);
    opacity: 0.05;
}

.clay-card h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--terracotta-text);
}

.clay-card p {
    color: var(--terracotta-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.btn-terracotta {
    background: var(--terracotta-primary);
    color: #fff !important;
    border: 1px solid var(--terracotta-primary);
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--terracotta-clay-shadow);
    width: 100%;
}

.btn-terracotta:hover {
    background: var(--terracotta-primary-hover);
    transform: translateY(-2px);
}

.features-section {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--terracotta-text);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--terracotta-muted);
    font-size: 1.1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--terracotta-card);
    border: 1px solid var(--terracotta-border);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--terracotta-clay-shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--terracotta-primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--terracotta-bg);
    border: 1px solid var(--terracotta-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--terracotta-primary);
    margin-bottom: 20px;
}

.feature-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--terracotta-text);
}

.feature-card p {
    color: var(--terracotta-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Responsive Overrides for Landing Page */
@media (max-width: 992px) {
    .landing-hero {
        grid-template-columns: 1fr;
        gap: 40px;
        margin: 40px auto;
        text-align: center;
    }
    
    .hero-badge {
        align-self: center;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-pills {
        justify-content: center;
    }
    
    .hero-right {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .landing-header {
        padding: 15px 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .clay-card {
        padding: 30px 20px;
    }
}

/* ==========================================================================
   Flashcards, Progress Bars, and Dictation Layout
   ========================================================================== */

.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 440px;
    height: 280px;
    margin: 30px auto;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 24px;
    border: 1px solid var(--brand-border);
    background: var(--brand-card);
    box-shadow: var(--brand-clay-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
    text-align: center;
}

.flashcard-back {
    transform: rotateY(180deg);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--brand-border);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--brand-primary);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: var(--brand-primary);
}

.nav-bar-scrollable {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--brand-border);
    -webkit-overflow-scrolling: touch;
}

.nav-bar-scrollable::-webkit-scrollbar {
    height: 4px;
}

.nav-bar-scrollable::-webkit-scrollbar-thumb {
    background: var(--brand-border);
    border-radius: 4px;
}

/* Premium Physical Card Styling */
.bank-card-container {
    perspective: 1000px;
    margin: 20px auto;
    width: 100%;
    max-width: 380px;
}

.physical-bank-card {
    background: linear-gradient(135deg, hsl(13, 75%, 35%) 0%, hsl(13, 60%, 15%) 100%);
    color: #fff;
    border-radius: 20px;
    padding: 24px;
    position: relative;
    box-shadow: 0 15px 35px rgba(217, 93, 57, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    aspect-ratio: 1.586;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-color-theme="forest"] .physical-bank-card {
    background: linear-gradient(135deg, hsl(142, 60%, 30%) 0%, hsl(142, 50%, 12%) 100%);
    box-shadow: 0 15px 35px rgba(46, 117, 89, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

[data-color-theme="ocean"] .physical-bank-card {
    background: linear-gradient(135deg, hsl(200, 75%, 35%) 0%, hsl(200, 60%, 15%) 100%);
    box-shadow: 0 15px 35px rgba(50, 130, 200, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

[data-color-theme="mono"] .physical-bank-card {
    background: linear-gradient(135deg, hsl(0, 0%, 30%) 0%, hsl(0, 0%, 10%) 100%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.physical-bank-card:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.physical-bank-card::after {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
    top: -50px;
    right: -50px;
    pointer-events: none;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-logo {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-chip {
    width: 44px;
    height: 32px;
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.5);
}

.card-chip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 4px;
}

.card-number {
    font-size: 1.45rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    margin: 18px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.15);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-meta-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.card-meta-value {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-action-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.card-copy-btn {
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    color: var(--brand-text);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.card-copy-btn:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* Premium Drag-Drop File Upload Area */
.upload-zone-wrapper {
    position: relative;
    border: 2px dashed var(--brand-border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    background: var(--brand-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.upload-zone-wrapper:hover, .upload-zone-wrapper.dragover {
    border-color: var(--brand-primary);
    background: var(--brand-card);
}

.upload-zone-icon {
    font-size: 2.2rem;
    color: var(--brand-primary);
    margin-bottom: 12px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.upload-zone-wrapper:hover .upload-zone-icon {
    transform: translateY(-4px);
}

.upload-zone-text {
    font-size: 0.9rem;
    color: var(--brand-muted);
}

.upload-zone-text strong {
    color: var(--brand-text);
}

.file-preview-info {
    margin-top: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--brand-primary);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Modern Step-by-Step Loader Overlay */
.loading-steps-container {
    width: 100%;
    max-width: 420px;
    margin: 25px auto 0 auto;
    text-align: left;
}

.loading-step-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.loading-step-item.active {
    opacity: 1;
    transform: scale(1.02);
}

.loading-step-item.completed {
    opacity: 0.85;
}

.step-icon-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.loading-step-item.active .step-icon-indicator {
    background: var(--brand-primary);
    box-shadow: 0 0 10px var(--brand-primary);
}

.loading-step-item.completed .step-icon-indicator {
    background: var(--success);
    color: #fff;
}

.step-text-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.step-text-title p {
    margin: 0;
    padding: 0;
    color: #eee;
}

.step-text-title span {
    font-size: 0.8rem;
    color: #888;
}

.loading-step-item.active .step-text-title p {
    color: #fff;
}

.loading-step-item.active .step-text-title span {
    color: var(--brand-primary);
}

/* Speaking Practice Styles */
.mic-btn {
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    color: var(--brand-primary);
}
.mic-btn:hover {
    background: var(--brand-bg);
    transform: scale(1.05);
}
.mic-btn.mic-active {
    background: var(--terracotta-primary, #ef4444) !important;
    border-color: var(--terracotta-primary, #ef4444) !important;
    color: #ffffff !important;
    animation: mic-pulse 1.5s infinite;
}
@keyframes mic-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Fullscreen Background Slideshow */
.landing-slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.landing-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 8s ease-in-out;
    transform: scale(1.02);
}

.landing-slide.active {
    opacity: 1;
    transform: scale(1.08);
}

.landing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.3s ease;
}

[data-theme="dark"] .landing-overlay {
    background: linear-gradient(135deg, rgba(15, 10, 10, 0.55) 0%, rgba(15, 10, 10, 0.75) 100%);
}

.landing-body.has-slideshow {
    background: transparent !important;
}

/* Make landing footer solid background */
.landing-body .site-footer {
    background: var(--terracotta-bg) !important;
    border-top: 1px solid var(--terracotta-border) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

