/* --- TharnLMS Upgraded Stylesheet --- */
/* --- NEW THEME: Academic Blue (Default) --- */
:root {
    /* Default to Academic Blue theme variables */
    --primary-grad: linear-gradient(145deg, #4a90e2 0%, #50e3c2 100%);
    --success-grad: linear-gradient(135deg, #28a745 0%, #218838 100%);
    --danger-grad: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    --coin-grad: linear-gradient(45deg, #ffc107, #e0a800);
    --text-light: #1a2b48; /* Dark navy text for light background */
    --text-muted: #526c89; /* Desaturated blue-grey text */
    --bg-glass-1: #ffffff; /* White cards */
    --bg-glass-2: #f8f9fa; /* Slightly off-white for hover */
    --border-glass: #dee2e6; /* Light grey border */
    --shadow-color: rgba(0, 0, 0, 0.1); /* Softer shadow */
    --body-bg: #f0f4f8; /* Light blueish-grey main background */
    --primary-text-color: #ffffff; /* Text color for on-primary backgrounds */
}

body.theme-academic-blue {
    --primary-grad: linear-gradient(145deg, #4a90e2 0%, #50e3c2 100%);
    --success-grad: linear-gradient(135deg, #28a745 0%, #218838 100%);
    --danger-grad: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    --coin-grad: linear-gradient(45deg, #ffc107, #e0a800);
    --text-light: #1a2b48;
    --text-muted: #526c89;
    --bg-glass-1: #ffffff;
    --bg-glass-2: #f8f9fa;
    --border-glass: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --body-bg: #f0f4f8;
    --primary-text-color: #ffffff; /* CHANGED: White text on buttons for better contrast */
}

body.theme-dark {
    --primary-grad: linear-gradient(145deg, #6e7fe8 0%, #764ba2 100%);
    --success-grad: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --danger-grad: linear-gradient(135deg, #f5564e 0%, #fe8c00 100%);
    --coin-grad: linear-gradient(45deg, #ffd32a, #ff9f43);
    --text-light: #f0f2ff;
    --text-muted: #c5cae9;
    --bg-glass-1: rgba(255, 255, 255, 0.08);
    --bg-glass-2: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.15);
    --shadow-color: rgba(25, 28, 66, 0.3);
    --body-bg: var(--primary-grad);
}

body.theme-hacker {
    --primary-grad: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    --success-grad: linear-gradient(135deg, #00ff87, #6fffb4);
    --coin-grad: linear-gradient(45deg, #00ff87, #6fffb4);
    --text-light: #00ff87;
    --text-muted: #6fffb4;
    --bg-glass-1: rgba(0, 255, 135, 0.05);
    --bg-glass-2: rgba(0, 255, 135, 0.03);
    --border-glass: rgba(0, 255, 135, 0.1);
    --shadow-color: rgba(0,0,0,0.5);
    --body-bg: #0a0c0f;
    font-family: 'Courier New', Courier, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Sarabun', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--body-bg); color: var(--text-light);
    line-height: 1.6; min-height: 100vh;
    transition: background 0.5s ease, color 0.5s ease;
}
.hidden { display: none !important; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- UPDATED AUTH PAGE STYLES --- */
#auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--body-bg); /* Use main theme background */
    padding: 20px;
}
.auth-card {
    width: 90%;
    max-width: 380px;
    /* Use styles from the main .card theme */
    background: var(--bg-glass-1);
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 40px var(--shadow-color);
    color: var(--text-light);
    border-radius: 20px;
    padding: 30px;
}
#auth-page .section-title {
    /* Match the inner logo style */
    color: var(--text-light);
    text-shadow: none;
}
.auth-form input {
    width: 100%; padding: 12px 18px; margin-bottom: 15px; border-radius: 25px;
    border: 1px solid var(--border-glass); /* Use theme border */
    background: var(--bg-glass-2); /* Use theme secondary background */
    color: var(--text-light); /* Use theme text color */
    font-size: 16px;
    transition: all 0.3s ease;
}
.auth-form input:focus {
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
    border-color: #80bdff;
    background: #ffffff;
}
.auth-form input::placeholder { color: var(--text-muted); opacity: 1; }
.auth-buttons { display: flex; gap: 10px; margin-top: 10px; }
.auth-buttons .btn { flex-grow: 1; }
#auth-error { color: #dc3545; margin-top: 15px; text-align: center; font-weight: 500; }

#auth-switch-links a {
    color: var(--text-muted); /* Use theme muted color */
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    text-shadow: none; /* Remove shadow */
}

#auth-switch-links a:hover {
    color: var(--text-light);
    text-decoration: underline;
}

.btn {
    padding: 10px 20px; border-radius: 25px; border: none; cursor: pointer;
    font-weight: 600; font-size: 15px; text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary { background: var(--primary-grad); color: var(--primary-text-color); }
.btn-success { background: var(--success-grad); color: white; }
.btn-danger { background: var(--danger-grad); color: white; }
.btn-secondary {
    background: var(--bg-glass-2);
    color: var(--text-light);
    border: 1px solid var(--border-glass);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--shadow-color); }
.btn:active { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.header {
    background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px);
    padding: 8px 24px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border-glass);
}
.logo { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.nav-menu { display: flex; gap: 8px; align-items: center; }
.nav-btn {
    padding: 8px 15px; background: transparent; border: 1px solid transparent;
    border-radius: 20px; color: var(--text-muted); cursor: pointer; transition: all 0.3s ease;
    font-size: 14px; text-decoration: none; font-weight: 500;
}
.nav-btn .fa-solid, .nav-btn .fas { margin-right: 6px; }
.nav-btn.active { background: var(--primary-grad); color: var(--primary-text-color); border-color: transparent; }
.nav-btn:hover:not(.active) { background: var(--bg-glass-2); color: var(--text-light); }

.user-info { display: flex; align-items: center; gap: 12px; }
.user-profile { font-size: 13px; display: flex; align-items: center; }
#user-email { font-weight: 500; }

.tharncoin-balance {
    background: var(--coin-grad); padding: 6px 15px; border-radius: 20px;
    font-weight: 700; display: flex; align-items: center; gap: 8px;
    color: #212529; text-shadow: 1px 1px 2px rgba(255,255,255,0.2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.lang-switcher { display: flex; gap: 5px; }
.lang-switcher .nav-btn { font-size: 14px; padding: 8px; width: 36px; height: 36px; text-align: center; line-height: 1; }

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.page { display: none; animation: fadeIn 0.6s cubic-bezier(0.165, 0.84, 0.44, 1); }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.card {
    background: var(--bg-glass-1); border-radius: 20px; padding: 24px;
    border: 1px solid var(--border-glass);
    margin-bottom: 20px; box-shadow: 0 10px 40px var(--shadow-color);
}
.section-title { font-size: 26px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }

.shop-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shop-item { background: var(--bg-glass-2); border-radius: 16px; padding: 20px; text-align: center; border: 1px solid transparent; transition: all 0.3s ease; display: flex; flex-direction: column; }
.shop-item:hover { transform: translateY(-5px); box-shadow: 0 12px 25px var(--shadow-color); background: var(--bg-glass-1); }
.shop-item.purchased { border-color: var(--coin-grad); }
.shop-item-icon { font-size: 44px; margin-bottom: 15px; }
.shop-item p { color: var(--text-muted); font-size: 14px; flex-grow: 1; margin-bottom: 15px; }
.shop-item .btn { width: 100%; margin-top: auto; }

.leaderboard-list, .user-list { display: flex; flex-direction: column; gap: 10px; }
.leaderboard-item, .user-item { display: flex; align-items: center; background: var(--bg-glass-2); padding: 12px 20px; border-radius: 12px; font-size: 16px; transition: background 0.3s; }
.leaderboard-item:hover, .user-item:hover { background: var(--bg-glass-1); }
.leaderboard-item.is-user { border: 2px solid; border-image-slice: 1; border-image-source: var(--coin-grad); background: var(--bg-glass-1); }
.leaderboard-rank { font-weight: 700; font-size: 18px; width: 50px; color: var(--text-muted); }
.leaderboard-item.is-user .leaderboard-rank { color: var(--text-light); }
.leaderboard-name, .user-email { flex-grow: 1; font-weight: 500; }
.leaderboard-score, .user-role { font-weight: 700; }
.user-role { text-transform: capitalize; padding: 4px 10px; font-size: 12px; border-radius: 10px; }
.user-role-admin { background-color: #e84393; color: white; }
.user-role-teacher { background-color: #0984e3; color: white; }
.user-role-student { background-color: #00b894; color: white; }

.daily-streak .stat-number { color: #ff793f; }

.courses-grid, .achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.course-card { background: var(--bg-glass-1); border-radius: 16px; overflow: hidden; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: 1px solid var(--border-glass); display: flex; flex-direction: column; }
.course-card-clickable { cursor: pointer; }
.course-card-clickable:hover { transform: translateY(-8px); box-shadow: 0 20px 40px var(--shadow-color); }
.course-thumbnail { height: 140px; background: var(--primary-grad); display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--primary-text-color); }
.course-info { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.course-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.course-description { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.5; flex-grow: 1; }
.course-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; }
.course-footer { margin-top: auto; }
.progress-bar { width: 100%; height: 8px; background: rgba(0, 0, 0, 0.1); border-radius: 4px; margin-bottom: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success-grad); transition: width 0.5s ease; border-radius: 4px; }
.completed-badge {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    background: var(--success-grad);
    color: white;
    font-weight: 600;
    margin-bottom: 10px;
}

.learning-layout { display: grid; grid-template-columns: 1fr 350px; gap: 20px; align-items: start; }
.video-section { background: var(--bg-glass-1); border-radius: 16px; padding: 15px; position: sticky; top: 80px; }
.video-container { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 15px; }
#video-player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.side-panel { background: var(--bg-glass-1); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }

#video-unmute-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); color: white;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; z-index: 2; font-size: 18px; text-align: center; padding: 20px;
    opacity: 1; transition: opacity 0.3s ease;
}
#video-unmute-overlay.hidden { opacity: 0; pointer-events: none; }
#video-unmute-overlay i { font-size: 48px; margin-bottom: 15px; }

#transcript-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.transcript-controls { margin-bottom: 10px; flex-shrink: 0; }
.transcript-lang-select { width: 100%; padding: 8px; border-radius: 8px; background: var(--bg-glass-2); color: var(--text-light); border: 1px solid var(--border-glass); }
#transcript-container { flex-grow: 1; overflow-y: auto; padding-right: 10px; }
.transcript-line { padding: 10px; border-radius: 8px; margin-bottom: 5px; cursor: pointer; transition: background-color 0.3s; }
.transcript-line:hover { background-color: var(--bg-glass-2); }
.transcript-line.active { background-color: rgba(74, 144, 226, 0.15); font-weight: 600; }

.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 12, 28, 0.7); backdrop-filter: blur(10px);
    z-index: 2000; display: none; justify-content: center; align-items: center;
    animation: modalFadeIn 0.3s; padding: 20px;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop.show { display: flex; }
.modal-content {
    background: var(--bg-glass-1); border: 1px solid var(--border-glass);
    padding: 30px; border-radius: 16px; width: 100%; max-width: 600px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-content.large { max-width: 900px; }
.modal-footer, .confirm-modal-buttons { margin-top: 25px; text-align: right; }
.confirm-modal-buttons { display: flex; justify-content: center; gap: 15px; }

/* --- NEW QUIZ STYLES --- */
#quiz-section {
    max-width: 700px;
    margin: 20px auto;
    background: var(--bg-glass-1);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 40px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

#quiz-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

#quiz-progress-container {
    flex-grow: 1;
    height: 10px;
    background-color: var(--bg-glass-2);
    border-radius: 5px;
    overflow: hidden;
}

#quiz-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-grad);
    border-radius: 5px;
    transition: width 0.4s ease-in-out;
}

#quiz-counter {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

#quiz-card-container {
    position: relative;
    min-height: 300px; /* Adjust as needed */
}

.quiz-card {
    width: 100%;
    text-align: center;
}

.quiz-card.animate-in {
    animation: slideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.quiz-card.animate-out {
    animation: slideOut 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

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

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50px);
    }
}

.quiz-question {
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 30px;
    line-height: 1.5;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.quiz-option {
    width: 100%;
    padding: 15px 20px;
    background: var(--bg-glass-2);
    border: 2px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 16px;
    text-align: left;
}

.quiz-option:hover:not(:disabled) {
    background: var(--bg-glass-1);
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.1);
}

.quiz-option.correct {
    background: var(--success-grad);
    border-color: transparent;
    color: white;
    font-weight: 600;
}

.quiz-option.incorrect {
    background: var(--danger-grad);
    border-color: transparent;
    color: white;
}

.quiz-option:disabled {
    cursor: not-allowed;
}

#quiz-feedback-actions {
    margin-top: 25px;
    text-align: center;
    min-height: 50px;
}

#quiz-feedback-actions .feedback-text {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    animation: fadeIn 0.3s;
}
#quiz-feedback-actions .feedback-text.correct {
    background-color: rgba(40, 167, 69, 0.1);
}
#quiz-feedback-actions .feedback-text.incorrect {
     background-color: rgba(220, 53, 69, 0.1);
}
#quiz-feedback-actions .feedback-text strong {
    font-size: 18px;
    margin-right: 10px;
}

/* --- END NEW QUIZ STYLES --- */

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; color: var(--text-muted); }
.form-group input, .form-group textarea {
    width: 100%; padding: 10px 15px; border-radius: 8px;
    border: 1px solid var(--border-glass); background: var(--bg-glass-2);
    color: var(--text-light); font-size: 14px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.stat-card { background: var(--bg-glass-1); border-radius: 12px; padding: 20px; text-align: center; }
.stat-number { font-size: 32px; font-weight: 700; margin-bottom: 5px; color: #4a90e2; }
.stat-label { font-size: 14px; color: var(--text-muted); }

.achievement-card, .completed-course-card {
    background: var(--bg-glass-1); border-radius: 12px; padding: 20px;
    display: flex; align-items: center; gap: 20px;
    border: 1px solid var(--border-glass); transition: all 0.4s ease; margin-bottom: 15px;
}
.achievement-card { opacity: 0.6; filter: grayscale(80%); }
.achievement-card.unlocked, .completed-course-card { opacity: 1; filter: grayscale(0%); }
.achievement-card.unlocked { border-left: 5px solid #ffc107; }
.completed-course-card { border-left: 5px solid; border-image-slice: 1; border-image-source: var(--success-grad); }
.achievement-icon { font-size: 40px; color: #ffc107; flex-shrink: 0; width: 45px; text-align: center; }
.completed-course-card .achievement-icon { color: var(--text-light); }
.achievement-details { flex-grow: 1; }
.achievement-title { font-weight: bold; font-size: 18px; }
.achievement-desc { font-size: 14px; color: var(--text-muted); }

.achievement-progress { margin-top: 15px; }
.achievement-progress-text { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; display: block; text-align: right; }
.achievement-progress-bar { width: 100%; height: 6px; background: rgba(0, 0, 0, 0.1); border-radius: 3px; overflow: hidden; }
.achievement-progress-fill { height: 100%; background: var(--primary-grad); border-radius: 3px; transition: width 0.5s ease; }
.achievement-card.unlocked .achievement-progress { display: none; }
.btn-share-achievement { margin-top: 15px; padding: 6px 15px; font-size: 13px; }

.notification {
    position: fixed; top: 80px; right: 20px; background: white; color: #333;
    padding: 15px 20px; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    z-index: 10000; transform: translateX(calc(100% + 30px));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 5px solid #4a90e2; max-width: 320px;
}
.notification.show { transform: translateX(0); }
.notification.success { border-left-color: #28a745; }
.notification.error { border-left-color: #dc3545; }
.notification.achievement { border-left-color: #ffc107; }

.filter-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.search-wrapper { position: relative; flex-grow: 1; min-width: 250px; }
.search-wrapper i { position: absolute; top: 50%; left: 18px; transform: translateY(-50%); color: var(--text-muted); }
#search-input { width: 100%; padding: 10px 15px 10px 45px; border-radius: 20px; border: 1px solid var(--border-glass); background: var(--bg-glass-1); color: var(--text-light); font-size: 14px; outline: none; transition: all 0.3s ease; }
#search-input::placeholder { color: var(--text-muted); }
#search-input:focus { background: white; box-shadow: 0 0 15px rgba(74, 144, 226, 0.2); border-color: #80bdff; }
.category-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.category-btn { padding: 8px 16px; border: 1px solid var(--border-glass); background: transparent; color: var(--text-light); border-radius: 20px; cursor: pointer; transition: all 0.3s ease; }
.category-btn:hover { background: var(--bg-glass-2); }
.category-btn.active { background: var(--primary-grad); color: var(--primary-text-color); font-weight: bold; border-color: transparent; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state i { font-size: 52px; margin-bottom: 20px; opacity: 0.6; }

#certificate-modal-backdrop { z-index: 2001; }
#certificate-modal-content.certificate-v2-container {
    font-family: 'Taviraj', serif; background-color: #f4f6f9;
    background-image:
        linear-gradient(45deg, rgba(0, 57, 114, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 57, 114, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 57, 114, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 57, 114, 0.05) 75%);
    background-size: 20px 20px; color: #1a2b48; padding: 0;
    border: 1px solid #d4af37; max-width: 850px; box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    position: relative; overflow: hidden;
}
.cert-v2-border { border: 10px solid #003972; padding: 25px; }
.cert-v2-header { text-align: center; margin-bottom: 20px; }
.cert-v2-header .logo { font-size: 24px; font-weight: 700; color: #003972; display: flex; align-items: center; justify-content: center; gap: 10px; }
.cert-v2-header h2 {
    font-family: 'Taviraj', serif; font-size: 38px; color: #d4af37;
    text-transform: uppercase; letter-spacing: 2px; margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
.cert-v2-body { text-align: center; margin: 30px 0; }
.cert-v2-body p { margin: 8px 0; font-size: 18px; color: #334e68; }
#cert-v2-user-name {
    font-size: 32px; font-weight: 600; color: #003972;
    border-bottom: 2px solid #d4af37; display: inline-block;
    padding-bottom: 5px; margin: 10px 0;
}
#cert-v2-course-name { font-style: normal; font-weight: 600; font-size: 22px; }
.cert-v2-footer { margin-top: 40px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 10px; }
.cert-v2-verification { text-align: left; }
.cert-v2-verification .qr-placeholder {
    width: 80px; height: 80px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3e%3crect width='100' height='100' fill='%23f4f6f9'/%3e%3crect x='10' y='10' width='20' height='20' fill='%231a2b48'/%3e%3crect x='40' y='10' width='10' height='10' fill='%231a2b48'/%3e%3crect x='60' y='10' width='30' height='10' fill='%231a2b48'/%3e%3crect x='10' y='40' width='10' height='10' fill='%231a2b48'/%3e%3crect x='30' y='30' width='10' height='20' fill='%231a2b48'/%3e%3crect x='50' y='30' width='20' height='10' fill='%231a2b48'/%3e%3crect x='80' y='20' width='10' height='30' fill='%231a2b48'/%3e%3crect x='10' y='60' width='30' height='10' fill='%231a2b48'/%3e%3crect x='50' y='50' width='10' height='20' fill='%231a2b48'/%3e%3crect x='70' y='60' width='20' height='10' fill='%231a2b48'/%3e%3crect x='10' y='80' width='10' height='10' fill='%231a2b48'/%3e%3crect x='30' y='80' width='10' height='20' fill='%231a2b48'/%3e%3crect x='50' y='80' width='40' height='10' fill='%231a2b48'/%3e%3c/svg%3e");
    background-size: contain; margin-bottom: 5px;
}
.cert-v2-verification p { font-size: 11px; color: #526c89; margin: 0; line-height: 1.3; }
.cert-v2-verification strong { font-family: 'Courier New', monospace; font-size: 12px; }
.cert-v2-seal { position: relative; width: 120px; height: 120px; display: flex; justify-content: center; align-items: center; }
.cert-v2-seal::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; background: #d4af37; border-radius: 50%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.cert-v2-seal-inner {
    position: relative; width: 80%; height: 80%; background: #003972;
    border-radius: 50%; color: #fff; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    font-size: 10px; font-weight: bold; line-height: 1.2; padding: 5px;
    text-transform: uppercase;
}
.cert-v2-seal-inner .fa-graduation-cap { font-size: 24px; margin-bottom: 5px; color: #d4af37; }

.congrats-modal-content {
    background: var(--primary-grad); color: var(--primary-text-color); padding: 40px;
    border-radius: 20px; width: 90%; max-width: 500px; text-align: center;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5); border: 1px solid var(--border-glass);
    position: relative; overflow: hidden;
}
.congrats-modal-content::before { content: '✨'; position: absolute; top: -20px; left: -20px; font-size: 80px; opacity: 0.1; transform: rotate(-20deg); }
.congrats-modal-content::after { content: '🏆'; position: absolute; bottom: -30px; right: -20px; font-size: 100px; opacity: 0.1; transform: rotate(15deg); }
.congrats-icon { font-size: 72px; animation: tada 1.5s ease infinite; margin-bottom: 15px; }
.congrats-modal-content h2 { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.congrats-modal-content p { font-size: 18px; color: var(--primary-text-color); opacity: 0.8; margin-bottom: 25px; }
.congrats-modal-content p strong { color: var(--primary-text-color); font-weight: 600; opacity: 1; }
.congrats-buttons { display: flex; justify-content: center; gap: 15px; }

@keyframes tada {
    0% {transform: scale(1);} 10%, 20% {transform: scale(0.9) rotate(-3deg);}
    30%, 50%, 70%, 90% {transform: scale(1.1) rotate(3deg);} 40%, 60%, 80% {transform: scale(1.1) rotate(-3deg);}
    100% {transform: scale(1) rotate(0);}
}

.activity-feed {
    position: fixed; bottom: 20px; left: 20px; background: var(--bg-glass-1);
    backdrop-filter: blur(10px); border: 1px solid var(--border-glass);
    border-radius: 12px; padding: 15px 20px; z-index: 9999;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); display: flex;
    align-items: center; gap: 15px; transform: translateX(-150%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
}
.activity-feed.show { transform: translateX(0); }
.activity-feed-icon { font-size: 24px; }
.activity-feed-text { font-size: 14px; }
.activity-feed-text strong { color: var(--text-light); font-weight: 600; }

.progress-stat {
    display: flex; justify-content: space-between; font-size: 14px;
    margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border-glass);
}
.progress-stat:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.progress-stat span:first-child { color: var(--text-muted); }
.progress-stat span:last-child { font-weight: 600; }

#ai-quiz-generator-content {
    display: grid; grid-template-columns: 3fr 5fr; gap: 20px;
    margin-top: 20px; overflow-y: auto; flex-grow: 1;
}
.ai-transcript-view {
    background: var(--bg-glass-2); border-radius: 8px; padding: 15px;
    height: 55vh; overflow-y: auto; font-size: 14px;
    line-height: 1.7; border: 1px solid var(--border-glass);
}
.ai-generated-quizzes { height: 55vh; overflow-y: auto; padding-right: 10px; }
.ai-quiz-item {
    background: var(--bg-glass-2); border-radius: 8px; padding: 15px;
    margin-bottom: 15px; border-left: 4px solid var(--border-glass);
}
.ai-quiz-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ai-quiz-item-header label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.ai-quiz-item-question { font-weight: 600; margin-bottom: 10px; }
.ai-quiz-item-options li { list-style: none; padding: 5px 0; font-size: 14px; }
.ai-quiz-item-options .correct-answer { color: var(--text-light); font-weight: bold; }
.ai-quiz-item-explanation {
    font-size: 13px; color: var(--text-muted); margin-top: 10px;
    padding-top: 10px; border-top: 1px dashed var(--border-glass);
}
.loader {
    width: 50px; height: 50px; border: 5px solid var(--text-muted);
    border-bottom-color: var(--text-light); border-radius: 50%;
    display: inline-block; box-sizing: border-box;
    animation: rotation 1s linear infinite; margin: 20px auto;
}
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--primary-grad); display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: bold; color: var(--primary-text-color); flex-shrink: 0;
}
.profile-info h2 { font-size: 24px; margin: 0; }
.profile-info p { font-size: 16px; color: var(--text-muted); text-transform: capitalize; }

#profile .course-card .course-thumbnail { height: 100px; font-size: 36px; }
#profile .course-card .course-title { font-size: 16px; }
#profile .course-card .course-info { padding: 15px; }

.user-profile .nav-btn {
    background: var(--bg-glass-2); border-radius: 50%; width: 36px; height: 36px;
    padding: 0; font-size: 16px; display: inline-flex;
    align-items: center; justify-content: center; margin-left: 8px;
}
.user-profile .nav-btn .fas { margin-right: 0; }

#comments-section { margin-top: 20px; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 25px; }
.comment-form textarea {
    flex-grow: 1; border-radius: 12px; padding: 12px 18px;
    border: 1px solid var(--border-glass); background: var(--bg-glass-2);
    color: var(--text-light); font-size: 15px; resize: vertical; min-height: 50px;
}
.comment-form button { flex-shrink: 0; }
#comments-list-container { display: flex; flex-direction: column; gap: 20px; }
.comment { display: flex; gap: 15px; }
.comment-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-grad); color: var(--primary-text-color);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; flex-shrink: 0; font-size: 18px;
}
.comment-content { flex-grow: 1; }
.comment-header { font-size: 14px; margin-bottom: 5px; }
.comment-author { font-weight: 600; }
.comment-role { font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; }
.comment-timestamp { color: var(--text-muted); margin-left: 8px; }
.comment-body { background: var(--bg-glass-2); padding: 12px 18px; border-radius: 12px; font-size: 15px; line-height: 1.7; }
.comment-actions { margin-top: 8px; }
.comment-action-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 500; padding: 5px; }
.comment-action-btn:hover { color: var(--text-light); }
.replies-container { margin-top: 15px; padding-left: 55px; display: flex; flex-direction: column; gap: 15px; }
.reply-form { margin-top: 10px; }

.analytics-table-container { overflow-x: auto; }
.analytics-table {
    width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 15px;
}
.analytics-table th, .analytics-table td {
    padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-glass);
}
.analytics-table th { background-color: var(--bg-glass-2); font-weight: 600; color: var(--text-muted); }
.analytics-table tbody tr:hover { background-color: var(--bg-glass-2); }
.analytics-table td { color: var(--text-light); }

.notification-area { position: relative; }
.notification-bell {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 16px;
}
.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid var(--bg-glass-1);
}
.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    max-height: 400px;
    background: var(--bg-glass-1);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--shadow-color);
    z-index: 1100;
    display: flex;
    flex-direction: column;
}
.notification-panel-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
}
.notification-panel-header h4 {
    margin: 0;
    font-size: 16px;
}
.notification-list {
    overflow-y: auto;
    flex-grow: 1;
}
.notification-item {
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-glass);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.notification-item:hover {
    background-color: var(--bg-glass-2);
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item.unread {
    background-color: rgba(74, 144, 226, 0.05);
}
.notification-icon {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    padding-top: 2px;
}
.notification-content p {
    margin: 0;
    line-height: 1.5;
}
.notification-timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 992px) {
    .learning-layout { grid-template-columns: 1fr; }
    .side-panel { max-height: 400px; }
    .video-section { position: static; }
    #ai-quiz-generator-content { grid-template-columns: 1fr; }
    .ai-transcript-view, .ai-generated-quizzes { height: 40vh; }
}
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 10px; padding: 15px; }
    .nav-menu { width: 100%; justify-content: center; flex-wrap: wrap; }
    .courses-grid, .achievements-grid { grid-template-columns: 1fr; }
    .filter-container { flex-direction: column; align-items: stretch; }
}

}
