/* ========================================
   CAJO AML/CFT/CPF Training - Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #1a202c;
    --secondary: #d69e2e;
    --secondary-light: #ecc94b;
    --accent: #319795;
    --accent-light: #4fd1c5;
    --background: #f7fafc;
    --background-alt: #edf2f7;
    --surface: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --success: #38a169;
    --success-light: #68d391;
    --warning: #ed8936;
    --warning-light: #fbd38d;
    --danger: #e53e3e;
    --danger-light: #fc8181;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, var(--background-alt) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none !important;
    min-height: 100vh;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: flex !important;
}

#dashboard-screen.active {
    display: flex !important;
    flex-direction: column;
}

#quiz-screen.active,
#certificate-screen.active,
#redflag-game-screen.active,
#match-game-screen.active,
#admin-dashboard-screen.active {
    display: block !important;
}

#module-screen.active {
    display: flex !important;
    flex-direction: column;
    height: 100vh;
}

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

/* ========================================
   Welcome Screen
   ======================================== */
#welcome-screen.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.welcome-container {
    max-width: 600px;
    width: 100%;
}

.logo-section {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.logo {
    width: 140px;
    height: auto;
    margin-bottom: 1rem;
    background: white;
    padding: 10px;
    border-radius: 8px;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.welcome-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

.welcome-card h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.welcome-card > p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.training-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--radius);
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text);
}

.overview-icon {
    font-size: 1.5rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--background-alt);
}

.auth-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
}

.auth-tab:hover {
    color: var(--text);
    background: var(--background);
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* Auth Forms */
.auth-form.hidden {
    display: none !important;
}

/* Forms */
.registration-form,
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 151, 149, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.returning-user {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.returning-user a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.returning-user a:hover {
    text-decoration: underline;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--background);
    color: var(--primary);
    border: 2px solid var(--background-alt);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--background-alt);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-text {
    background: transparent;
    color: var(--text-light);
    padding: 0.5rem 1rem;
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* ========================================
   Dashboard
   ======================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--background-alt);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 45px;
    width: auto;
}

.header-left h1 {
    font-size: 1.25rem;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
    color: var(--text);
}

/* Dashboard Body — sidebar + content flex layout */
.dashboard-body {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 70px);
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-width: 0;
}

/* ========================================
   Sidebar Navigation (always visible)
   ======================================== */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--background-alt);
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding-top: 1rem;
    z-index: 50;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 0.875rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    background: var(--background-alt);
    color: var(--text);
}

.sidebar-nav a.active {
    border-left-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.06);
    font-weight: 600;
}

[data-theme="dark"] .sidebar {
    background: var(--surface);
    border-right-color: var(--background-alt);
}

[data-theme="dark"] .sidebar-nav a:hover {
    background: var(--background-alt);
}

[data-theme="dark"] .sidebar-nav a.active {
    background: rgba(96, 165, 250, 0.1);
}

/* Tab Panes */
.tab-pane {
    display: none;
}

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

/* Mobile: sidebar on top */
@media (max-width: 768px) {
    .dashboard-body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--background-alt);
        padding-top: 0;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .sidebar-nav li {
        flex-shrink: 0;
    }

    .sidebar-nav a {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .sidebar-nav a.active {
        border-left: none;
        border-bottom-color: var(--primary);
    }
}

/* Print: show all tab panes */
@media print {
    .tab-pane {
        display: block !important;
    }
}

/* ========================================
   Welcome Page
   ======================================== */
.welcome-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 0;
}

.welcome-page h2 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.welcome-guide {
    background: var(--surface);
    border: 1px solid var(--background-alt);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.welcome-guide h3 {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.guide-step strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.guide-step p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

[data-theme="dark"] .welcome-guide {
    background: var(--surface);
    border-color: var(--background-alt);
}

[data-theme="dark"] .step-number {
    background: var(--primary-light);
}

/* Progress Section */
.progress-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    color: white;
    margin-bottom: 2rem;
}

.progress-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--secondary-light) 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    margin-top: 0.75rem;
    font-size: 1rem;
    opacity: 0.9;
}

/* Section Titles */
.section-title {
    margin: 2rem 0 1rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--primary);
}

.section-title p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.optional-badge {
    background: var(--background-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.required-badge {
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.module-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

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

.module-card.completed {
    border-color: var(--success);
}

.module-card.completed::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.module-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.module-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.module-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.resume-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.module-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--background-alt);
}

.module-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Games Grid */
/* Training Manual Card */
.training-manual-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary);
    transition: var(--transition);
}

.training-manual-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.manual-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.manual-info {
    flex: 1;
}

.manual-info h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.manual-info p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
}

.manual-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .training-manual-card {
        flex-direction: column;
        text-align: center;
    }
    .manual-actions {
        width: 100%;
        flex-direction: column;
    }
    .manual-actions .btn {
        width: 100%;
    }
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.game-card.completed {
    border: 2px solid var(--success);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.game-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.game-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    background: var(--background-alt);
    color: var(--text-light);
}

.game-card.completed .game-status {
    background: var(--success-light);
    color: var(--success);
}

/* Quiz Card */
.quiz-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 2rem;
    align-items: center;
}

.quiz-info h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.quiz-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.quiz-note {
    font-style: italic;
    margin-top: 0.5rem;
}

.quiz-stats {
    text-align: center;
    padding: 1rem 2rem;
    background: var(--background);
    border-radius: var(--radius);
}

.quiz-stats p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.quiz-stats .score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Certificate Section */
.certificate-section {
    margin-top: 2rem;
}

.certificate-card {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    color: var(--primary-dark);
}

.certificate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.certificate-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.certificate-card p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* ========================================
   Module View
   ======================================== */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--background-alt);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-arrow {
    margin-right: 0.5rem;
}

.module-progress {
    font-weight: 500;
    color: var(--primary);
}

.module-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.module-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.module-section.active {
    display: block;
}

.module-section h2 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--secondary);
}

.module-section h3 {
    font-size: 1.25rem;
    color: var(--primary-light);
    margin: 1.5rem 0 1rem;
}

.module-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.module-section ul, .module-section ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.module-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.highlight-box {
    background: var(--background);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
}

.warning-box {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    padding: 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
}

.case-study {
    background: var(--surface);
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.case-study h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.definition-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.definition-table th,
.definition-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--background-alt);
}

.definition-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.definition-table tr:hover {
    background: var(--background);
}

.module-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border-top: 1px solid var(--background-alt);
    flex-shrink: 0;
}

.section-dots {
    display: flex;
    gap: 0.5rem;
}

.section-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--background-alt);
    transition: var(--transition);
}

.section-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.section-dot.completed {
    background: var(--success);
}

/* ========================================
   Games
   ======================================== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--background-alt);
    gap: 2rem;
    flex-wrap: wrap;
}

.game-header h2 {
    color: var(--primary);
    margin: 0;
    flex-shrink: 0;
}

.game-score {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.1rem;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background: var(--background);
    border-radius: var(--radius);
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Red Flag Game */
.scenario-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.scenario-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
}

.scenario-header h3 {
    font-size: 1.25rem;
}

.scenario-number {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.scenario-body {
    padding: 2rem;
}

.scenario-details {
    background: var(--background);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.scenario-details p {
    margin-bottom: 0.75rem;
}

.scenario-details strong {
    color: var(--primary);
}

.decision-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.decision-btn {
    padding: 1rem;
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.decision-btn:hover {
    border-color: var(--accent);
    background: var(--background);
}

.decision-btn.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.decision-btn.incorrect {
    border-color: var(--danger);
    background: var(--danger-light);
}

.decision-btn h4 {
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.decision-btn p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.feedback-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
}

.feedback-box.correct {
    background: var(--success-light);
    border: 1px solid var(--success);
}

.feedback-box.incorrect {
    background: var(--danger-light);
    border: 1px solid var(--danger);
}

.feedback-box h4 {
    margin-bottom: 0.5rem;
}

/* Match Game */
.match-game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

.match-column-header {
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 2px solid var(--secondary);
}

.match-item {
    padding: 1rem;
    background: var(--surface);
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    min-height: 56px;
}

.match-item:hover:not(.locked) {
    border-color: var(--accent);
    background: var(--background);
}

.match-item.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.match-item.locked {
    cursor: default;
    pointer-events: none;
    opacity: 0.85;
}

.match-item.locked.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.match-item.locked.incorrect {
    border-color: var(--danger);
    background: var(--danger-light);
}

.game-complete {
    text-align: center;
    padding: 3rem;
}

.game-complete h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.game-complete .score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 1rem 0;
}

.game-complete p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ========================================
   Quiz
   ======================================== */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--background-alt);
}

.quiz-header h2 {
    color: var(--primary);
}

.quiz-progress {
    font-weight: 500;
    color: var(--text-light);
}

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
}

.question-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.question-number {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.options-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

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

.option-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--background);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.option-btn:hover {
    background: var(--background-alt);
}

.option-btn.selected {
    border-color: var(--accent);
    background: rgba(49, 151, 149, 0.1);
}

.option-btn.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.option-btn.incorrect {
    border-color: var(--danger);
    background: var(--danger-light);
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.option-text {
    flex: 1;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.quiz-result {
    text-align: center;
    padding: 3rem;
}

.quiz-result h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.quiz-result.passed h2 {
    color: var(--success);
}

.quiz-result.failed h2 {
    color: var(--danger);
}

.quiz-result .score {
    font-size: 4rem;
    font-weight: 700;
    margin: 1rem 0;
}

.quiz-result.passed .score {
    color: var(--success);
}

.quiz-result.failed .score {
    color: var(--danger);
}

/* Quiz Recommendations */
.recommendations-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    text-align: left;
}

.recommendations-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.recommendation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    margin-top: 0.4rem;
    background: var(--background-alt);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.recommendation-item:hover {
    background: var(--primary);
    color: white;
}

.recommendation-item:hover .recommendation-category,
.recommendation-item:hover .recommendation-module {
    color: white;
}

.recommendation-category {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.recommendation-module {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

/* ========================================
   Certificate - Professional Design
   ======================================== */
.certificate-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
}

.certificate {
    background: #ffffff;
    max-width: 850px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.cert-border {
    border: 3px solid var(--primary);
    margin: 8px;
    padding: 8px;
}

.cert-inner {
    border: 1px solid var(--secondary);
    padding: 3rem 4rem;
    position: relative;
}

/* Corner decorations */
.cert-inner::before,
.cert-inner::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid var(--secondary);
}

.cert-inner::before {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}

.cert-inner::after {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}

.cert-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cert-logo {
    height: 80px;
    width: auto;
    margin-bottom: 1rem;
}

.cert-org-name h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.cert-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.cert-title h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 6px;
    margin: 0 0 1rem 0;
}

.cert-divider {
    width: 150px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    margin: 0 auto;
}

.cert-body {
    text-align: center;
    margin-bottom: 2.5rem;
}

.cert-intro {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.cert-name {
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--primary);
    margin: 0.5rem 0 1rem;
    font-family: 'Georgia', serif;
}

.cert-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.cert-course {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cert-description {
    font-size: 0.95rem;
    color: #777;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.cert-footer {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 2rem;
}

.cert-footer .cert-detail {
    text-align: center;
}

.cert-label {
    display: block;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

.cert-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.certificate-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Print styles for certificate - Landscape Letter (11" x 8.5") - Full Page */
@media print {
    @page {
        size: letter landscape;
        margin: 0.3in;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .screen:not(#certificate-screen),
    .certificate-actions,
    #loading-overlay,
    #toast-container {
        display: none !important;
    }

    #certificate-screen {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
    }

    .certificate-view {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        display: flex !important;
        align-items: stretch !important;
        justify-content: center !important;
    }

    .certificate {
        box-shadow: none !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .cert-border {
        margin: 6px !important;
        padding: 6px !important;
        border-width: 3px !important;
        height: calc(100% - 12px) !important;
        display: flex !important;
    }

    .cert-inner {
        padding: 1.5rem 2.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: 100% !important;
        flex: 1 !important;
    }

    .cert-inner::before,
    .cert-inner::after {
        width: 50px !important;
        height: 50px !important;
    }

    .cert-inner::before {
        top: 12px !important;
        left: 12px !important;
    }

    .cert-inner::after {
        bottom: 12px !important;
        right: 12px !important;
    }

    .cert-header {
        margin-bottom: 0.75rem !important;
    }

    .cert-logo {
        height: 60px !important;
        margin-bottom: 0.5rem !important;
    }

    .cert-org-name h2 {
        font-size: 0.9rem !important;
        letter-spacing: 2px !important;
    }

    .cert-title {
        margin-bottom: 1rem !important;
    }

    .cert-title h1 {
        font-size: 2rem !important;
        letter-spacing: 5px !important;
        margin: 0 0 0.5rem 0 !important;
    }

    .cert-divider {
        width: 120px !important;
        height: 2px !important;
    }

    .cert-body {
        margin-bottom: 1rem !important;
        flex-grow: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    .cert-intro {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }

    .cert-name {
        font-size: 2rem !important;
        margin: 0.25rem 0 0.5rem !important;
    }

    .cert-text {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }

    .cert-course {
        font-size: 1.1rem !important;
        margin: 0.25rem 0 !important;
    }

    .cert-description {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-top: 0.25rem !important;
    }

    .cert-footer {
        padding-top: 0.75rem !important;
        margin-top: 0.75rem !important;
        gap: 3rem !important;
        flex-direction: row !important;
    }

    .cert-label {
        font-size: 0.6rem !important;
        margin-bottom: 0.25rem !important;
    }

    .cert-value {
        font-size: 0.85rem !important;
    }

    .cert-qr {
        margin-top: 0.5rem !important;
        padding-top: 0.5rem !important;
    }

    .cert-qr-img {
        width: 80px !important;
        height: 80px !important;
    }

    .cert-qr-text {
        font-size: 0.55rem !important;
        margin-top: 0.2rem !important;
    }

    .cert-developer {
        margin-top: 0.5rem !important;
        padding-top: 0.5rem !important;
        gap: 0.5rem !important;
    }

    .cert-developer-logo {
        height: 18px !important;
    }

    .cert-developer span {
        font-size: 0.55rem !important;
    }
}

/* ========================================
   Loading & Toast
   ======================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

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

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--background-alt);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

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

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

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .training-overview {
        grid-template-columns: 1fr;
    }

    .quiz-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .decision-buttons {
        grid-template-columns: 1fr;
    }

    .match-game-area {
        grid-template-columns: 1fr;
    }

    .cert-details {
        flex-direction: column;
        gap: 1rem;
    }

    .certificate-actions {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .certificate-actions {
        display: none;
    }

    .certificate {
        box-shadow: none;
        border: 8px double var(--secondary);
    }
}

/* ========================================
   Developer Footer - Phantom Cyberlink
   ======================================== */
.developer-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.developer-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.developer-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.developer-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.developer-text strong {
    color: white;
}

.developer-text .copyright {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Dashboard footer variant */
.dashboard-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--background-alt);
}

.dashboard-footer .developer-credit {
    gap: 0.75rem;
}

.dashboard-footer .developer-logo {
    height: 45px;
}

.dashboard-footer .developer-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

.dashboard-footer .developer-text strong {
    color: var(--text);
}

.dashboard-footer .developer-text .copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Certificate developer attribution */
.cert-developer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.cert-developer-logo {
    height: 25px;
    width: auto;
    object-fit: contain;
}

.cert-developer span {
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 0.5px;
}

/* Print styles for developer attribution */
@media print {
    .cert-developer {
        margin-top: 1.5rem;
    }

    .cert-developer-logo {
        height: 20px;
    }
}

/* ========================================
   Admin Link on Welcome Screen
   ======================================== */
.admin-link {
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: center;
}

.admin-link a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.admin-link a:hover {
    color: var(--primary);
}

/* ========================================
   Admin Login Screen
   ======================================== */
#admin-login-screen.active {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.admin-login-container {
    max-width: 450px;
    width: 100%;
}

.admin-login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
}

.admin-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-logo {
    height: 80px;
    width: auto;
    margin-bottom: 1.5rem;
}

.admin-login-header h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.admin-login-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.admin-login-form .form-group {
    margin-bottom: 1.5rem;
}

.admin-login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.admin-login-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.admin-login-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.back-to-training {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.back-to-training a {
    color: var(--accent);
    text-decoration: none;
}

.back-to-training a:hover {
    text-decoration: underline;
}

/* ========================================
   Admin Dashboard Screen
   ======================================== */
#admin-dashboard-screen.active {
    display: block !important;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--background-alt);
}

.admin-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.admin-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Admin Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--background-alt);
    padding-bottom: 0;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -2px;
}

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

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Admin Panels */
.admin-panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--background-alt);
}

.panel-header h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin: 0;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--background-alt);
    border-radius: var(--radius);
    font-size: 0.9rem;
    width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Admin Tables */
.table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--background-alt);
}

.admin-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    font-size: 0.95rem;
    color: var(--text);
}

.admin-table tbody tr:hover {
    background: var(--background);
}

/* Progress bar in table */
.progress-mini {
    width: 100px;
    height: 8px;
    background: var(--background-alt);
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.progress-mini-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-mini-bar.complete {
    background: var(--success);
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: #b7791f;
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: rgba(49, 151, 149, 0.2);
    color: var(--accent);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1rem;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .search-input {
        width: 100%;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .game-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .cert-footer {
        flex-direction: column;
        gap: 1.5rem;
    }

    .cert-inner {
        padding: 2rem 1.5rem;
    }

    .cert-title h1 {
        font-size: 1.75rem;
        letter-spacing: 3px;
    }

    .cert-name {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .decision-buttons {
        grid-template-columns: 1fr;
    }

    .decision-btn {
        padding: 0.875rem;
    }

    .decision-btn h4 {
        font-size: 0.95rem;
    }

    .decision-btn p {
        font-size: 0.8rem;
    }

    .quiz-card {
        padding: 1.25rem;
    }

    .module-content {
        padding: 1.25rem;
    }

    .module-section h2 {
        font-size: 1.4rem;
    }

    .module-section p {
        font-size: 0.95rem;
    }

    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Modal Overlay
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 1rem;
}

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

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.3s ease;
}

.modal-card h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.modal-card .form-group {
    margin-bottom: 1.25rem;
}

.modal-card .form-group input {
    width: 100%;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ========================================
   Small Button & Panel Header Actions
   ======================================== */
.btn-small {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .panel-header-actions {
        flex-direction: column;
        width: 100%;
    }
}

/* ========================================
   Certificate QR Code
   ======================================== */
.cert-qr {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.cert-qr-img {
    width: 120px;
    height: 120px;
}

.cert-qr-text {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.5rem;
    letter-spacing: 0.5px;
}

@media print {
    .cert-qr-img {
        width: 100px;
        height: 100px;
    }
}

/* ========================================
   Content Management System (CMS)
   ======================================== */

/* Content Sub-tabs */
.content-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--background-alt);
    border-radius: var(--radius);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.content-tab {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.content-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.5);
}

.content-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.content-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 6px;
}

.content-tab.active .content-count {
    background: var(--primary);
}

/* Content Sub-panels */
.content-subpanel {
    animation: fadeIn 0.2s ease;
}

.content-subpanel.hidden {
    display: none;
}

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

.content-panel-header h3 {
    font-size: 1.1rem;
    color: var(--text);
}

/* Content Cards */
.content-card {
    background: var(--surface);
    border: 1px solid var(--background-alt);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.content-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.content-card.inactive {
    opacity: 0.6;
    border-left: 3px solid var(--danger);
}

.content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.content-card-title {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.content-card-title h4 {
    font-size: 0.95rem;
    color: var(--text);
    margin: 0;
    word-break: break-word;
}

.content-card-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.content-card-badges {
    flex-shrink: 0;
}

.content-card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0.5rem 0 0;
    padding-left: 2.75rem;
}

.content-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-left: 2.75rem;
}

.content-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}

.content-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Wide Modal */
.modal-card-wide {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transition: max-width 0.3s ease, width 0.3s ease;
}

.modal-card-wide.expanded {
    max-width: 98vw;
    width: 98vw;
    max-height: 95vh;
}

.modal-card-wide.expanded .ql-editor {
    min-height: 300px;
}

/* Modal expand toggle button */
.modal-expand-btn {
    background: none;
    border: 1px solid var(--background-alt);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-light);
    font-family: inherit;
    transition: var(--transition);
}

.modal-expand-btn:hover {
    background: var(--background);
    color: var(--text);
    border-color: var(--text-muted);
}

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

/* Form Row (side-by-side fields) */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Sections Editor */
.sections-editor {
    margin-top: 1rem;
    border-top: 1px solid var(--background-alt);
    padding-top: 1rem;
}

.section-editor-item {
    background: var(--background);
    border: 1px solid var(--background-alt);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.section-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-editor-header strong {
    font-size: 0.9rem;
    color: var(--primary);
}

/* ========================================
   Quill Rich Text Editor Overrides
   ======================================== */
.section-editor-item .ql-toolbar {
    border: 2px solid var(--background-alt);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--surface);
    padding: 6px 8px;
}

.section-editor-item .ql-container {
    border: 2px solid var(--background-alt);
    border-radius: 0 0 var(--radius) var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 150px;
    background: var(--surface);
}

.section-editor-item .ql-editor {
    min-height: 150px;
    padding: 0.75rem;
    line-height: 1.6;
    color: var(--text);
}

.section-editor-item .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: italic;
}

.section-editor-item .ql-container.ql-snow:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 151, 149, 0.1);
}

.section-editor-item .ql-toolbar.ql-snow + .ql-container.ql-snow:focus-within {
    border-color: var(--accent);
}

.section-editor-item .ql-toolbar .ql-formats {
    margin-right: 10px;
}

.section-editor-item .ql-toolbar button:hover,
.section-editor-item .ql-toolbar button.ql-active,
.section-editor-item .ql-toolbar .ql-picker-label:hover,
.section-editor-item .ql-toolbar .ql-picker-label.ql-active {
    color: var(--primary);
}

.section-editor-item .ql-toolbar button:hover .ql-stroke,
.section-editor-item .ql-toolbar button.ql-active .ql-stroke,
.section-editor-item .ql-toolbar .ql-picker-label:hover .ql-stroke {
    stroke: var(--primary);
}

.section-editor-item .ql-toolbar button:hover .ql-fill,
.section-editor-item .ql-toolbar button.ql-active .ql-fill {
    fill: var(--primary);
}

.section-editor-item .ql-toolbar .ql-header .ql-picker-label {
    min-width: 90px;
}

/* Ensure Quill dropdowns render above the toolbar */
.section-editor-item .ql-toolbar .ql-picker-options {
    z-index: 10;
}

/* Dark Mode overrides for Quill */
[data-theme="dark"] .section-editor-item .ql-toolbar {
    border-color: #4a5568;
    background: var(--background);
}

[data-theme="dark"] .section-editor-item .ql-container {
    border-color: #4a5568;
    background: var(--background);
}

[data-theme="dark"] .section-editor-item .ql-editor {
    color: var(--text);
}

[data-theme="dark"] .section-editor-item .ql-toolbar button .ql-stroke {
    stroke: var(--text-light);
}

[data-theme="dark"] .section-editor-item .ql-toolbar button .ql-fill {
    fill: var(--text-light);
}

[data-theme="dark"] .section-editor-item .ql-toolbar .ql-picker-label {
    color: var(--text-light);
}

[data-theme="dark"] .section-editor-item .ql-toolbar .ql-picker-options {
    background: var(--surface);
    border-color: #4a5568;
}

[data-theme="dark"] .section-editor-item .ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] .section-editor-item .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent);
}

[data-theme="dark"] .section-editor-item .ql-toolbar button:hover .ql-fill,
[data-theme="dark"] .section-editor-item .ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent);
}

[data-theme="dark"] .section-editor-item .ql-container.ql-snow:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.15);
}

[data-theme="dark"] .ql-tooltip {
    background: var(--surface);
    color: var(--text);
    border-color: #4a5568;
    box-shadow: var(--shadow);
}

[data-theme="dark"] .ql-tooltip input[type="text"] {
    background: var(--background);
    color: var(--text);
    border-color: #4a5568;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

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

.actions-cell {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Danger Outline Button */
.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

/* Form Elements for CMS */
.modal-card-wide textarea,
.modal-card-wide select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-card-wide textarea:focus,
.modal-card-wide select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.modal-card-wide select {
    appearance: auto;
    cursor: pointer;
}

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

/* ========================================
   Dark Mode
   ======================================== */
[data-theme="dark"] {
    --primary: #63b3ed;
    --primary-light: #90cdf4;
    --primary-dark: #2b6cb0;
    --secondary: #ecc94b;
    --secondary-light: #fbd38d;
    --accent: #4fd1c5;
    --accent-light: #81e6d9;
    --background: #1a202c;
    --background-alt: #2d3748;
    --surface: #2d3748;
    --text: #e2e8f0;
    --text-light: #a0aec0;
    --text-muted: #718096;
    --success: #68d391;
    --success-light: rgba(104, 211, 145, 0.2);
    --warning: #fbd38d;
    --warning-light: rgba(251, 211, 141, 0.2);
    --danger: #fc8181;
    --danger-light: rgba(252, 129, 129, 0.2);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
    background: var(--background);
}

[data-theme="dark"] .welcome-card,
[data-theme="dark"] .admin-panel,
[data-theme="dark"] .modal-card {
    background: var(--surface);
    border-color: var(--background-alt);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--background);
    color: var(--text);
    border-color: #4a5568;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.2);
}

[data-theme="dark"] .admin-table th {
    background: var(--background);
    color: var(--text-light);
}

[data-theme="dark"] .admin-table td {
    border-color: #4a5568;
}

[data-theme="dark"] .stat-card {
    background: var(--surface);
    border-color: var(--background-alt);
}

[data-theme="dark"] .content-card {
    background: var(--surface);
    border-color: #4a5568;
}

[data-theme="dark"] .section-editor-item {
    background: var(--background);
    border-color: #4a5568;
}

[data-theme="dark"] .content-tabs {
    background: var(--background);
}

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

[data-theme="dark"] .content-tab.active {
    background: var(--surface);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .module-card {
    background: var(--surface);
}

[data-theme="dark"] .quiz-card {
    background: var(--surface);
}

[data-theme="dark"] .training-manual-card {
    background: var(--surface);
}

[data-theme="dark"] .game-card {
    background: var(--surface);
}

/* Welcome screen: always use original light-theme colors regardless of dark mode */
[data-theme="dark"] #welcome-screen {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #1a202c;
    --surface: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --background: #f7fafc;
    --background-alt: #edf2f7;
    --accent: #319795;
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Dark Mode Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--text-muted);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ========================================
   Accessibility & Focus
   ======================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.match-item:focus-visible,
.option-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   Password Strength Indicator
   ======================================== */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
    height: 4px;
}

.password-strength-bar {
    flex: 1;
    border-radius: 2px;
    background: var(--background-alt);
    transition: background 0.3s ease;
}

.password-strength-bar.active.weak { background: var(--danger); }
.password-strength-bar.active.medium { background: var(--warning); }
.password-strength-bar.active.strong { background: var(--success); }

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--text-light);
}

.password-strength-text.weak { color: var(--danger); }
.password-strength-text.medium { color: var(--warning); }
.password-strength-text.strong { color: var(--success); }

/* ========================================
   Confirmation Modal
   ======================================== */
.confirm-modal-body {
    text-align: center;
    padding: 1rem 0;
}

.confirm-modal-body p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.confirm-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-modal-actions .btn {
    min-width: 100px;
}

/* ========================================
   Analytics
   ======================================== */
.analytics-card {
    background: var(--surface);
    border: 1px solid var(--background-alt);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.analytics-card h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.analytics-note {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.analytics-breakdown {
    font-size: 0.9rem;
    color: var(--text);
}

.analytics-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bar-label {
    font-size: 0.8rem;
    color: var(--text-light);
    min-width: 55px;
    text-align: right;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: var(--background-alt);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    min-width: 30px;
}

/* ========================================
   Multimedia in Modules
   ======================================== */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    background: #000;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.audio-container {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius);
}

.audio-container audio {
    width: 100%;
}

/* ========================================
   Post-Training Feedback
   ======================================== */
.star-rating {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.star-rating .star {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.star-rating .star:hover,
.star-rating .star.active {
    color: var(--secondary);
    transform: scale(1.15);
}

.star-rating .star:hover ~ .star {
    color: var(--text-muted);
}

.feedback-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background: var(--surface);
    color: var(--text);
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* ========================================
   Leaderboard
   ======================================== */
.leaderboard-section {
    margin: 2rem 0;
}

.leaderboard-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: none;
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: var(--transition);
}

.leaderboard-toggle:hover {
    box-shadow: var(--shadow);
}

.leaderboard-toggle h2 {
    font-size: 1.1rem;
    margin: 0;
}

.leaderboard-toggle .toggle-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.leaderboard-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.leaderboard-content {
    display: none;
    padding-top: 1rem;
}

.leaderboard-content.open {
    display: block;
}

.leaderboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .leaderboard-cards {
        grid-template-columns: 1fr;
    }
}

.leaderboard-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.leaderboard-card h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--background-alt);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.leaderboard-item .rank {
    font-weight: 700;
    min-width: 28px;
    color: var(--text-light);
}

.leaderboard-item:nth-child(1) .rank { color: #d4a017; }
.leaderboard-item:nth-child(2) .rank { color: #a0a0a0; }
.leaderboard-item:nth-child(3) .rank { color: #cd7f32; }

.leaderboard-item .name {
    flex: 1;
    margin: 0 0.5rem;
}

.leaderboard-item .score {
    font-weight: 600;
    color: var(--primary);
}

.leaderboard-item.current-user {
    background: var(--background);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-weight: 600;
}

.leaderboard-stat {
    text-align: center;
    padding: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.leaderboard-stat .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

/* ========================================
   Searchable Glossary
   ======================================== */
.glossary-section {
    margin: 2rem 0;
}

.glossary-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: none;
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: var(--transition);
}

.glossary-toggle:hover {
    box-shadow: var(--shadow);
}

.glossary-toggle h2 {
    font-size: 1.1rem;
    margin: 0;
}

.glossary-toggle .toggle-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.glossary-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.glossary-content {
    display: none;
    padding-top: 1rem;
}

.glossary-content.open {
    display: block;
}

.glossary-search-bar {
    margin-bottom: 0.75rem;
}

.glossary-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--background-alt);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}

.glossary-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 151, 149, 0.15);
}

.glossary-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.glossary-letter-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--background-alt);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    min-width: 2rem;
    text-align: center;
}

.glossary-letter-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

.glossary-letter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.glossary-term-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--accent);
}

.glossary-term-name {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.glossary-term-def {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.glossary-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* ========================================
   Content Version History
   ======================================== */
.version-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--background-alt);
}

.version-row:last-child {
    border-bottom: none;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.version-number {
    font-weight: 700;
    color: var(--primary);
    min-width: 2rem;
}

.version-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.version-admin {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.version-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

.version-preview {
    background: var(--background-alt);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent);
}

.version-preview h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.version-preview p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

/* ========================================
   Enhanced Analytics
   ======================================== */
.trend-chart,
.funnel-chart {
    margin: 0.5rem 0;
}

.dual-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.dual-bar-tracks {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bar-fill-blue {
    background: linear-gradient(90deg, #3182ce, #63b3ed) !important;
}

.bar-fill-green {
    background: linear-gradient(90deg, #38a169, #68d391) !important;
}

.bar-fill-funnel {
    background: linear-gradient(90deg, var(--primary), var(--accent)) !important;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.legend-blue { background: #3182ce; }
.legend-green { background: #38a169; }

.funnel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.funnel-label {
    min-width: 140px;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-highlight-card {
    text-align: center;
}

.stat-highlight {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.75rem 0;
}

/* ========================================
   Printable Training Log
   ======================================== */
.print-log-btn {
    background: none;
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.print-log-btn:hover {
    background: var(--accent);
    color: white;
}

#training-log-print {
    display: none;
}

@media print {
    /* Hide everything except the training log when printing it */
    body.printing-log * {
        visibility: hidden;
    }
    body.printing-log #training-log-print,
    body.printing-log #training-log-print * {
        visibility: visible;
    }
    body.printing-log #training-log-print {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        color: #333;
        padding: 2rem;
    }

    body.printing-log .print-header {
        text-align: center;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 3px solid #1a365d;
    }

    body.printing-log .print-header h1 {
        font-size: 1.5rem;
        color: #1a365d;
        margin-bottom: 0.25rem;
    }

    body.printing-log .print-header p {
        font-size: 0.9rem;
        color: #666;
    }

    body.printing-log .print-section {
        margin-bottom: 1.5rem;
        page-break-inside: avoid;
    }

    body.printing-log .print-section h2 {
        font-size: 1.1rem;
        color: #1a365d;
        border-bottom: 2px solid #eee;
        padding-bottom: 0.3rem;
        margin-bottom: 0.75rem;
    }

    body.printing-log .print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.85rem;
    }

    body.printing-log .print-table th,
    body.printing-log .print-table td {
        border: 1px solid #ddd;
        padding: 0.4rem 0.6rem;
        text-align: left;
    }

    body.printing-log .print-table th {
        background: #f0f0f0;
        font-weight: 600;
    }

    body.printing-log .print-info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    body.printing-log .print-info-grid dt {
        font-weight: 600;
        color: #555;
    }

    body.printing-log .print-footer {
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 2px solid #1a365d;
        text-align: center;
        font-size: 0.8rem;
        color: #999;
    }
}

/* Admin Feedback Panel */
.feedback-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.feedback-stat-card {
    background: var(--background);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.feedback-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.feedback-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feedback-entry {
    background: var(--background);
    border-radius: var(--radius);
    padding: 1rem;
}

.feedback-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.feedback-entry-stars {
    color: var(--secondary);
}

.feedback-entry-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feedback-entry-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.feedback-entry-comment {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Survey Dashboard Card */
.survey-dashboard-card {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid #c8e6c9;
}

[data-theme="dark"] .survey-dashboard-card {
    background: linear-gradient(135deg, #1b3a1e, #1e3320);
    border-color: #2e5a32;
}

.survey-dashboard-card h3 {
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .survey-dashboard-card h3 {
    color: #81c784;
}

.survey-dashboard-card p {
    color: #558b2f;
    margin-bottom: 1rem;
}

[data-theme="dark"] .survey-dashboard-card p {
    color: #a5d6a7;
}

.survey-section {
    margin: 1.5rem 0;
}

/* ========================================
   Anonymous Survey Modal
   ======================================== */
.survey-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.survey-intro {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.survey-question-card {
    background: var(--background);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    transition: border-color 0.3s;
}

.survey-question-card.answered {
    border-left-color: var(--success);
}

.survey-question-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.survey-question-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

.survey-question-card.answered .survey-question-number {
    background: var(--success);
}

.survey-question-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
}

.likert-scale {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.likert-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all 0.2s;
    min-width: 90px;
    text-align: center;
}

.likert-option:hover {
    border-color: var(--primary);
    background: var(--background);
}

.likert-option.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.likert-option .likert-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.likert-option .likert-label {
    font-size: 0.7rem;
    line-height: 1.2;
    opacity: 0.85;
}

.likert-option.selected .likert-label {
    opacity: 1;
}

.survey-star-rating {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.5rem 0;
}

.survey-star-rating .star {
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.survey-star-rating .star:hover,
.survey-star-rating .star.active {
    color: var(--secondary);
    transform: scale(1.15);
}

.survey-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 2px solid var(--background-alt);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background: var(--surface);
    color: var(--text);
}

.survey-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.survey-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--background-alt);
}

.survey-progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.survey-skip-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
    padding: 0;
}

.survey-skip-link:hover {
    color: var(--text);
}

/* ========================================
   Admin Survey Results
   ======================================== */
.survey-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.survey-stat-card {
    background: var(--background);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.survey-stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.survey-stat-card .stat-value.stars-display {
    font-size: 1.4rem;
    color: var(--secondary);
}

.survey-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.survey-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--background-alt);
}

.survey-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.survey-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.survey-bar-label {
    font-size: 0.8rem;
    color: var(--text-light);
    min-width: 200px;
    flex-shrink: 0;
    line-height: 1.3;
}

.survey-bar-track {
    flex: 1;
    height: 28px;
    background: var(--background);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.survey-bar-fill {
    height: 100%;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    transition: width 0.6s ease;
    min-width: 0;
}

.survey-bar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    min-width: 45px;
    text-align: right;
}

.survey-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

.survey-dist-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.survey-dist-label {
    font-size: 0.85rem;
    min-width: 20px;
    text-align: center;
    color: var(--secondary);
}

.survey-dist-bar-track {
    flex: 1;
    height: 22px;
    background: var(--background);
    border-radius: 11px;
    overflow: hidden;
}

.survey-dist-bar-fill {
    height: 100%;
    border-radius: 11px;
    background: var(--secondary);
    transition: width 0.6s ease;
}

.survey-dist-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 30px;
}

.survey-responses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.survey-response-card {
    background: var(--background);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.survey-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.survey-response-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.survey-response-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.survey-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.survey-score-badge.score-high {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.survey-score-badge.score-mid {
    background: rgba(255, 193, 7, 0.15);
    color: var(--secondary);
}

.survey-score-badge.score-low {
    background: rgba(244, 67, 54, 0.15);
    color: var(--danger);
}

.suggestion-quote {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.survey-no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.survey-no-data .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.survey-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--background-alt);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.survey-export-btn:hover {
    background: var(--background);
    color: var(--text);
}

/* Responsive survey */
@media (max-width: 600px) {
    .likert-scale {
        flex-direction: column;
        align-items: stretch;
    }
    .likert-option {
        flex-direction: row;
        justify-content: flex-start;
        min-width: unset;
    }
    .survey-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .survey-bar-label {
        min-width: 120px;
        font-size: 0.75rem;
    }
}
