/* style.css - Custom premium design system for ParlerFacile */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    /* Color Palette - Elegant French Accent (Navy, Soft Blue, Crimson, Gold, Cream) */
    --primary: #0f2b5c;
    --primary-light: #1d448a;
    --accent-red: #d92638;
    --accent-gold: #f2b705;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --error: #ef4444;
    
    /* Layout Tokens */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--primary);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout Wrapper */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
header {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e2e8f0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

.logo span.fr-flag {
    display: inline-flex;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.logo span.fr-flag i {
    width: 10px;
    height: 18px;
    display: inline-block;
}
.logo span.fr-flag i.blue { background: #002395; }
.logo span.fr-flag i.white { background: #ffffff; }
.logo span.fr-flag i.red { background: #ed2939; }


.nav-links > a, .nav-links > .dropdown > a {
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
}

.nav-links > a:hover, .nav-links > .dropdown > a:hover,
.nav-links > a.active, .nav-links > .dropdown > a.active {
    color: var(--primary);
    background: #f1f5f9;
}

/* Main Content Area */
main {
    flex: 1;
    padding: 40px 0;
}

/* Intro Page Hero */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #0f2b5c 0%, #1e3a8a 100%);
    color: white;
    border-radius: var(--border-radius-lg);
    margin-bottom: 50px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Category Grid & Accordion */
.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--accent-red);
    margin: 10px auto 0;
    border-radius: 2px;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-header {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.subcategory-wrapper {
    margin-top: 15px;
    padding-left: 15px;
    border-left: 3px solid #e2e8f0;
}

.subcategory-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.lesson-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.lesson-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: var(--transition);
    color: var(--primary);
}

.lesson-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

/* Lesson Page Styles */
.lesson-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media(min-width: 900px) {
    .lesson-page-grid {
        grid-template-columns: 3fr 2fr;
    }
}

/* Story Component */
.story-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    border: 1px solid #e2e8f0;
}

.story-languages {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 25px;
}

@media(min-width: 768px) {
    .story-languages {
        grid-template-columns: 1fr 1fr;
    }
}

.story-pane {
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #e2e8f0;
}

.story-pane h4 {
    margin-bottom: 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.story-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Clickable story words */
.clickable-word {
    display: inline-block;
    cursor: pointer;
    border-bottom: 2px dashed #c59f4e;
    color: #ffe8a3;
    padding: 0 2px;
    font-weight: 500;
    transition: var(--transition);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none; /* Disables iOS context menu/magnifier */
}

.clickable-word:hover {
    background-color: rgba(197, 159, 78, 0.3);
    color: #ffffff;
    border-radius: 4px;
}

/* Gender Badges */
.gender-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 4px;
    width: 17px;
    height: 17px;
    margin-left: 8px;
    text-transform: uppercase;
    line-height: 1;
}

.gender-m {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1.5px solid #bfdbfe;
}

.gender-f {
    background-color: #fce7f3;
    color: #9d174d;
    border: 1.5px solid #fbcfe8;
}

/* Vocabulary Component */
.vocab-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    border: 1px solid #e2e8f0;
}

.vocab-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}

.vocab-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #f8fafc;
    border-radius: var(--border-radius-sm);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: var(--transition);
}

.vocab-item:hover {
    border-color: var(--primary-light);
}

.vocab-item.in-list {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.vocab-item.in-list:hover {
    background-color: #cbd5e1;
    border-color: var(--primary-light);
}

.vocab-french {
    font-weight: 600;
    color: var(--primary);
}

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

/* Popup / Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 43, 92, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay .modal-card {
    background: linear-gradient(135deg, #0b1a3a 0%, #071127 100%);
    border: 2px solid #c59f4e;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    color: #ffe8a3;
    width: 90%;
    max-width: 450px;
    overflow: hidden;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    background: transparent;
    color: #ffe8a3;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: #ffe8a3;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.8;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 159, 78, 0.3);
}

.modal-word-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffe8a3;
    margin-bottom: 5px;
    background: linear-gradient(to right, #ffe8a3, #c59f4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-word-translation {
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 20px;
}

.modal-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-audio {
    background: linear-gradient(135deg, #0b1a3a 0%, #071127 100%);
    border: 2px solid #c59f4e;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    color: #ffe8a3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    transition: var(--transition);
}

.btn-audio:hover {
    background: rgba(197, 159, 78, 0.1);
    transform: translateY(-1px);
}

.btn-affiliate {
    background: var(--accent-red);
    color: white;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-affiliate:hover {
    background: #be123c;
    transform: translateY(-2px);
}

/* Practice Game / Quiz Section */
.quiz-section {
    background: linear-gradient(135deg, #0b1a3a 0%, #071127 100%);
    border: 2px solid #c59f4e;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 30px;
    margin-top: 30px;
    color: #ffe8a3;
}

.quiz-section p {
    color: #cbd5e1 !important;
}

.quiz-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 25px;
}

.quiz-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--success);
    transition: width 0.3s ease;
}

.quiz-question-container {
    text-align: center;
}

.quiz-question {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #ffffff;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

@media(min-width: 600px) {
    .quiz-options {
        grid-template-columns: 1fr 1fr;
    }
}

.quiz-option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(197, 159, 78, 0.4);
    border-radius: var(--border-radius-sm);
    padding: 12px 18px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffe8a3;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 56px;
    width: 100%;
}

.quiz-option-btn:hover {
    border-color: #c59f4e;
    background: rgba(197, 159, 78, 0.15);
    color: #ffffff;
}

.quiz-option-btn.selected {
    border-color: #ffe8a3;
    background: rgba(197, 159, 78, 0.3);
    color: #ffffff;
}

.quiz-feedback {
    display: none;
    padding: 15px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.quiz-feedback.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.quiz-feedback.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.quiz-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-check {
    background: linear-gradient(135deg, #ffe8a3 0%, #c59f4e 100%);
    color: #0b1a3a;
    border: 2px solid #c59f4e;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-check:hover {
    background: linear-gradient(135deg, #ffffff 0%, #ffe8a3 100%);
    color: #0b1a3a;
    transform: translateY(-1px);
}

/* Hover-translation styling matching French2dutch.html */
span.word {
    position: relative;
    cursor: help;
    border-bottom: 1.5px dashed #c59f4e;
    padding: 0 2px;
    font-weight: 500;
    transition: var(--transition);
}

span.word:hover, span.word:active {
    background-color: rgba(197, 159, 78, 0.3);
    color: #ffffff;
    border-radius: 4px;
}

span.word:hover::after, span.word:active::after {
    content: attr(data-translation);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #0b1a3a;
    color: #ffe8a3;
    border: 1px solid #c59f4e;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Forms and Inputs */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(15, 43, 92, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-danger {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #be123c;
}

/* Admin Dashboard CSS */
.admin-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
}

/* Premium Admin Dashboard Theme */
.admin-card {
    background: linear-gradient(135deg, #0b1a3a 0%, #071127 100%) !important;
    border: 2px solid #c59f4e !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important;
    color: #ffffff !important;
}

.admin-card h3, .admin-card h2, .admin-card h4 {
    color: #ffe8a3 !important;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

.admin-card table {
    color: #ffffff !important;
}

.admin-card th {
    color: #ffe8a3 !important;
    border-bottom: 2px solid rgba(197, 159, 78, 0.4) !important;
}

.admin-card td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.admin-card label {
    color: #ffe8a3 !important;
}

.admin-card .form-control {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(197, 159, 78, 0.3) !important;
    color: #ffffff !important;
}

/* Fix dropdown options readability (white text on dark blue background) */
.admin-card .form-control option,
.admin-card select.form-control option {
    background-color: #0b1a3a !important;
    color: #ffffff !important;
}

.admin-card .form-control:focus {
    border-color: #ffe8a3 !important;
    box-shadow: 0 0 0 3px rgba(197, 159, 78, 0.25) !important;
}

/* Header Row Title and Buttons */
main.container h2:first-of-type {
    font-family: 'Playfair Display', serif;
    background: linear-gradient(135deg, #ffe8a3 0%, #c59f4e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

main.container a.btn-primary, 
main.container button.btn-primary,
main.container .tab-content .action-bar-btn:first-of-type {
    background: linear-gradient(135deg, #ffe8a3 0%, #c59f4e 100%) !important;
    color: #0b1a3a !important;
    border: 2px solid #c59f4e !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

main.container .btn-danger,
main.container button.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%) !important;
    color: #ffffff !important;
    border: 2px solid #ef4444 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

.tab-content .action-bar-btn {
    background: linear-gradient(135deg, #0b1a3a 0%, #071127 100%) !important;
    color: #ffe8a3 !important;
    border: 2px solid #c59f4e !important;
}

.tab-content .action-bar-btn:hover {
    background: rgba(197, 159, 78, 0.1) !important;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media(min-width: 900px) {
    .admin-grid {
        grid-template-columns: 2fr 3fr;
    }
}

.alert {
    padding: 15px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #0b1a3a 0%, #071127 100%);
    color: #ffe8a3;
    padding: 25px 0;
    margin-top: 50px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    border-top: 3px solid #c59f4e;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
}

footer p {
    color: #ffe8a3;
    opacity: 0.9;
}

/* Tabbed Navigation */
.admin-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--accent-red);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 43, 92, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

/* Clickable headers with sorting indicators */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}

th.sortable:hover {
    color: var(--primary-light);
}

th.sortable::after {
    content: ' ↕';
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.5;
}

th.sortable.asc::after {
    content: ' ▲';
    opacity: 1;
    color: var(--primary);
}

th.sortable.desc::after {
    content: ' ▼';
    opacity: 1;
    color: var(--primary);
}

.action-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Responsive Header Mobile Buttons */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 10px;
        gap: 15px;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }
    
    .nav-links > a, .nav-links > span, .nav-links > .dropdown > a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        background: #f1f5f9;
        color: var(--text-main) !important;
        border: 1px solid #cbd5e1;
        border-radius: var(--border-radius-sm);
        font-weight: 600;
        margin: 0;
        box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    }
    
    .nav-links > a:hover, .nav-links > .dropdown > a:hover {
        background: #e2e8f0;
    }
    
    .nav-links > a.active, .nav-links > .dropdown > a.active {
        background: var(--primary) !important;
        color: white !important;
        border-color: var(--primary);
    }
    
    #header-user-points {
        background: #fef08a !important;
        color: #854d0e !important;
        border: 1px solid #fde047 !important;
    }
}

/* Disable text selection and callouts in stories to prevent mobile copy magnifier popup */
.story-text, .story-text *, .clickable-word, .word {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Profile Page Responsive Grid Layout */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: start;
    max-width: 800px;
    margin: 40px auto;
}

@media(min-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr 2fr;
    }
}

/* Matching Game Styles */
.matching-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.matching-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(197, 159, 78, 0.4);
    border-radius: 12px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffe8a3;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    min-height: 56px;
    display: flex;
    align-items: center;
    position: relative;
}

.matching-badge {
    border: 1px solid rgba(197, 159, 78, 0.4);
    border-radius: 6px;
    color: #ffe8a3;
    background: rgba(255, 255, 255, 0.1);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    position: absolute;
    left: 12px;
}

.matching-text {
    width: 100%;
    text-align: center;
    padding: 0 35px;
}

.matching-card:hover {
    border-color: #c59f4e;
    background: rgba(197, 159, 78, 0.15);
    color: #ffffff;
}

.matching-card.selected {
    background: rgba(197, 159, 78, 0.3);
    border-color: #ffe8a3;
    color: #ffffff;
    transform: scale(1.02);
}

.matching-card.matched {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
    cursor: default;
    pointer-events: none;
    opacity: 0.8;
}

.matching-card.wrong {
    background: #fee2e2;
    border-color: var(--error);
    color: #991b1b;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* View Switcher Tabs */
.view-switcher-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
    flex-wrap: wrap;
}

.view-switcher-tabs button {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

/* Mobile Polish Media Queries */
@media (max-width: 768px) {
    .container {
        padding: 0 10px !important;
    }
    main {
        padding: 15px 0 !important;
    }
    .story-card, .vocab-card, .quiz-section, .admin-card {
        padding: 15px !important;
        border-radius: var(--border-radius-sm) !important;
    }
    .story-pane {
        padding: 12px !important;
    }
    .story-text {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    .view-switcher-tabs {
        gap: 6px !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
    }
    .view-switcher-tabs button {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        margin: 0 !important;
    }
    .quiz-question {
        font-size: 1.2rem !important;
        margin-bottom: 15px !important;
    }
    .quiz-option-btn {
        padding: 10px 15px !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
    }
}

/* Dropdown Menu Styles for Custom Wordlists */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-card);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    z-index: 1000;
    right: 0;
    margin-top: 5px;
    overflow: hidden;
}
.dropdown-content a {
    color: var(--text-muted);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    border-radius: 0 !important;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}
.dropdown-content a:last-child {
    border-bottom: none;
}
.dropdown-content a:hover {
    background-color: #f1f5f9;
    color: var(--primary) !important;
}
.dropdown:hover .dropdown-content {
    display: block;
}

/* Header Topic Navigation Tabs - Blue Buttons with Gold Bies */
.nav-tab-btn {
    background: linear-gradient(135deg, #0b1a3a 0%, #071127 100%) !important;
    color: #ffe8a3 !important;
    border: 2px solid #c59f4e !important;
    padding: 7px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.2;
    font-family: inherit;
    outline: none;
}

.nav-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(197, 159, 78, 0.35);
    color: #ffffff !important;
    border-color: #ffe8a3 !important;
}

.nav-tab-btn.active {
    background: linear-gradient(135deg, #ffe8a3 0%, #c59f4e 100%) !important;
    color: #0b1a3a !important;
    border: 2px solid #c59f4e !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(197, 159, 78, 0.5) !important;
}

.nav-tab-btn.nav-back-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f2b5c 100%) !important;
    border: 2px solid #c59f4e !important;
    color: #ffe8a3 !important;
    font-weight: 700;
}

.nav-tab-btn.nav-back-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
}

@media (max-width: 900px) {
    .nav-container {
        height: auto !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        gap: 10px;
    }
    .nav-links {
        gap: 6px !important;
        flex-wrap: wrap;
    }
    .nav-tab-btn {
        padding: 6px 10px !important;
        font-size: 0.82rem !important;
    }
}

/* Header Main-menu Styled Tab Buttons (Clean Text without Icons) */
.nav-menu-link {
    font-weight: 500;
    color: var(--text-muted) !important;
    background: transparent !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: none !important;
    line-height: 1.5;
}

.nav-menu-link:hover {
    color: var(--primary) !important;
    background: #f1f5f9 !important;
    transform: none !important;
}

.nav-menu-link.active {
    color: var(--primary) !important;
    background: #f1f5f9 !important;
    font-weight: 700 !important;
}

/* Submenu Dropdown for Oefenen (Quiz, Combineren, Luisteren) */
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 2px solid #c59f4e;
    border-radius: 10px;
    min-width: 170px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 6px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .nav-dropdown-content {
        left: 0;
        right: auto;
    }
}

.dropdown:hover .nav-dropdown-content,
.nav-dropdown-content.show {
    display: block;
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-main) !important;
    font-weight: 500;
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid #f1f5f9;
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

.nav-dropdown-content a:hover {
    background: #f1f5f9 !important;
    color: var(--primary) !important;
}

.nav-dropdown-content a.active {
    background: rgba(197, 159, 78, 0.15) !important;
    color: var(--primary) !important;
    font-weight: 700;
}

