/* =============================================
   CLSN LMS — Custom CSS
   Matches clsn-main brand: candlelight + navy
   ============================================= */

/* ── Progress Bar ───────────────────────────── */
.progress-bar-wrap {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFA726, #FB8C00);
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* ── Module Sidebar ─────────────────────────── */
.module-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.module-sidebar::-webkit-scrollbar { width: 4px; }
.module-sidebar::-webkit-scrollbar-thumb { background: #FFB74D; border-radius: 2px; }

.module-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: #374151;
}
.module-nav-item:hover    { background: #FFF3E0; color: #E65100; }
.module-nav-item.active   { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); color: #E65100; font-weight: 600; }
.module-nav-item.locked   { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.module-nav-item.completed .mod-icon { color: #16a34a; }

/* ── Tabs ───────────────────────────────────── */
.tab-btn {
    padding: 10px 20px;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}
.tab-btn:hover  { color: #FB8C00; }
.tab-btn.active { border-bottom-color: #FFA726; color: #FB8C00; }

.tab-panel      { display: none; }
.tab-panel.active { display: block; }

/* ── Video Container ────────────────────────── */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
}
.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    border-radius: 16px;
}

/* ── Quiz ───────────────────────────────────── */
.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}
.quiz-option:hover { border-color: #FFA726; background: #FFF9F0; }
.quiz-option input[type="radio"] { display: none; }
.quiz-option input[type="radio"]:checked + .option-indicator {
    background: #FFA726;
    border-color: #FFA726;
}
.quiz-option input[type="radio"]:checked + .option-indicator::after {
    display: block;
}
.quiz-option:has(input:checked) { border-color: #FFA726; background: #FFF3E0; }
.option-indicator {
    width: 22px; height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    margin-top: 2px;
}
.option-indicator::after {
    content: '';
    display: none;
    width: 10px; height: 10px;
    background: white;
    border-radius: 50%;
}
.quiz-option.correct-ans  { border-color: #16a34a !important; background: #f0fdf4 !important; }
.quiz-option.wrong-ans    { border-color: #dc2626 !important; background: #fef2f2 !important; }

/* ── Certificate ────────────────────────────── */
/* Self-hosted fonts for certificate */
@font-face {
    font-family: 'ChunkFive';
    src: url('/clsn-lms/fonts/ChunkFive-Regular.woff2') format('woff2'),
         url('/clsn-lms/fonts/ChunkFive-Regular.woff')  format('woff'),
         url('/clsn-lms/fonts/ChunkFive-Regular.ttf')   format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Garet';
    src: url('/clsn-lms/fonts/Garet-Heavy.woff2') format('woff2'),
         url('/clsn-lms/fonts/Garet-Heavy.ttf')   format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Garet';
    src: url('/clsn-lms/fonts/Garet-Book.woff2') format('woff2'),
         url('/clsn-lms/fonts/Garet-Book.ttf')   format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
/* TODO: Download AmsterdamOne-Regular.ttf from dafont.com/amsterdam-one.font
   and place it in /clsn-lms/fonts/, then uncomment:
@font-face {
    font-family: 'Amsterdam One';
    src: url('/clsn-lms/fonts/AmsterdamOne-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
*/

/* Outer wrapper — centers and constrains the scaled cert */
.cert-print-area {
    max-width: 960px;
    margin: 0 auto;
    /* Height is set by JS to match the scaled cert height */
}

/* The cert is rendered at a fixed 960px wide internally,
   then scaled down to fit the container via JS transform.
   This guarantees identical proportions on any screen. */
.cert-paper {
    position: relative;
    width: 960px;
    height: 679px; /* 960 / 1.414 */
    background: url('/clsn-lms/images/certificate-bg.png') center / cover no-repeat;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    transform-origin: top left;
    /* transform: scale(X) set by JS */
}

/* Entire inner content absolutely placed so it overlays the bg image */
.cert-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 48px 67px 38px;
}

/* Top row: title block left + logo right */
.cert-top-row {
    position: relative;
    margin-bottom: 4px;
}

.cert-title-block {
    width: 100%;
    text-align: center;
}

.cert-big-title {
    font-family: 'ChunkFive', Georgia, serif;
    font-size: 58px;
    font-weight: normal;
    letter-spacing: 0.04em;
    color: #1B6B7B;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
}

.cert-subtitle {
    font-family: 'Garet', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #C2185B;
    margin: 2px 0 5px;
}

.cert-presented-to {
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-size: 17px;
    color: #444;
    margin: 0;
}

/* Logo top-right */
.cert-logo-col {
    position: absolute;
    top: 0;
    right: 0;
    text-align: center;
    margin-left: 0;
}
.cert-logo-col img {
    width: 163px;
    height: auto;
    display: block;
}

/* Recipient name */
.cert-name-row {
    margin: 0 auto 3px;
    border-bottom: 1.5px solid #555;
    padding: 0 12px 4px;
    display: inline-block;
    min-width: 42%;
    max-width: 72%;
}
.cert-name-cursive {
    font-family: 'Amsterdam One', 'Dancing Script', cursive; /* replace Dancing Script once Amsterdam One TTF is added */
    font-size: 64px;
    font-weight: normal;
    color: #1A237E;
    line-height: 1.1;
    display: block;
}

/* Recognition */
.cert-recognition {
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-size: 17px;
    color: #444;
    margin: 4px 0 2px;
}

/* Course title */
.cert-course-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: #C2185B;
    margin: 0 0 4px;
    line-height: 1.3;
}

/* Program description */
.cert-program-desc {
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-size: 13.5px;
    color: #555;
    line-height: 1.45;
    max-width: 84%;
    margin: 0 auto 5px;
    text-align: center;
}

/* Date line */
.cert-date-row {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: #222;
    margin: 0;
    text-align: center;
}
.cert-date-row span {
    display: inline-block;
    width: 200px;
    border-bottom: 1.5px solid #333;
    margin-left: 6px;
}

/* Footer: seal + sig */
.cert-footer-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-top: 6px;
    margin-top: auto;
}

.cert-seal-wrap {
    flex: 0 0 auto;
    position: relative;
    width: 110px;
    height: 110px;
}
.cert-seal-wrap img { width: 100%; height: 100%; object-fit: contain; }
/* Fallback seal if no image */
.cert-seal-fallback {
    width: 100%; height: 100%;
    background: radial-gradient(circle at 38% 38%, #FFF9E0, #D4A017);
    border-radius: 50%;
    border: 3px solid #B8860B;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 6px rgba(184,134,11,0.2);
}
.cert-seal-fallback i { color: #7B5000; font-size: 2.2rem; }

.cert-sig-block {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    padding-right: 70px;
}
.cert-sig-name-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #222;
    margin: 0 0 1px;
    text-align: center;
}
.cert-sig-role-text {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #555;
    margin: 0;
    text-align: center;
}
/* No actual sig image — show a line */
.cert-sig-line-h {
    width: 190px;
    height: 1.5px;
    background: #333;
    margin: 0 auto 4px;
}

.cert-sig-scribble {
    font-family: 'Dancing Script', cursive;
    font-size: 36px;
    color: #111;
    line-height: 1;
    margin: 0 0 -6px;
    opacity: 0.9;
}

.cert-uid-corner {
    position: absolute;
    right: 3.5%;
    bottom: 2.8%;
    font-family: monospace;
    font-size: 7px;
    color: rgba(0,0,0,0.28);
    text-align: right;
    line-height: 1.45;
}

/* UID watermark */
.cert-uid-bar {
    font-family: monospace;
    font-size: 0.48rem;
    color: rgba(0,0,0,0.3);
    text-align: center;
    margin-top: auto;
    padding-top: 2px;
}

/* ── Course split-pane scroll columns ───────── */
.course-col-scroll::-webkit-scrollbar       { width: 5px; }
.course-col-scroll::-webkit-scrollbar-track { background: #F3F4F6; }
.course-col-scroll::-webkit-scrollbar-thumb { background: #1A237E; border-radius: 4px; }

/* ── Notes Content ──────────────────────────── */
.notes-content h2  { font-size: 1.5rem; font-weight: 700; color: #1A237E; margin: 1.5rem 0 0.75rem; font-family: 'Playfair Display', serif; }
.notes-content h3  { font-size: 1.2rem; font-weight: 700; color: #283593; margin: 1.25rem 0 0.5rem; }
.notes-content h4  { font-size: 1rem;   font-weight: 700; color: #374151; margin: 1rem 0 0.4rem; }
.notes-content p   { color: #4b5563; line-height: 1.8; margin-bottom: 1rem; }
.notes-content ul,
.notes-content ol  { margin: 0.75rem 0 1rem 1.5rem; color: #4b5563; line-height: 1.8; }
.notes-content li  { margin-bottom: 0.4rem; }
.notes-content strong { color: #1A237E; }

/* ── Form Inputs ────────────────────────────── */
.lms-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    color: #111827;
}
.lms-input:focus {
    outline: none;
    border-color: #FFA726;
    box-shadow: 0 0 0 4px rgba(255, 167, 38, 0.1);
}
.lms-input::placeholder { color: #9ca3af; }

/* ── Buttons ─────────────────────────────────── */
.btn-lms-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #FFA726, #FB8C00);
    color: white;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(255, 167, 38, 0.3);
    cursor: pointer;
    border: none;
}
.btn-lms-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 167, 38, 0.45);
}
.btn-lms-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px;
    background: white;
    color: #1A237E;
    border: 2px solid #1A237E;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-lms-secondary:hover { background: #1A237E; color: white; }

/* ── Card Hover ──────────────────────────────── */
.lms-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 20px;
}
.lms-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.10);
}

/* ── Course Thumbnail Placeholder ────────────── */
.course-thumb-ph {
    background: linear-gradient(135deg, #1A237E 0%, #283593 50%, #3949AB 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 3rem;
}

/* ── Alert / Toast ───────────────────────────── */
.lms-alert { padding: 14px 18px; border-radius: 14px; margin-bottom: 1rem; font-size: 0.9rem; }
.lms-alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.lms-alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.lms-alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }

/* ── PDF download card ───────────────────────── */
.pdf-card {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.pdf-card:hover { border-color: #FFA726; background: #FFF9F0; }

/* ── Q&A ─────────────────────────────────────── */
.qa-item { border-left: 3px solid #FFA726; padding-left: 1rem; }
.qa-answer { border-left: 3px solid #1A237E; padding-left: 1rem; background: #f0f4ff; border-radius: 0 8px 8px 0; padding: 12px 16px; }

/* ── Print: Certificate ──────────────────────── */
@media print {
    body * { visibility: hidden; }
    .cert-print-area, .cert-print-area * { visibility: visible; }
    .cert-print-area { position: fixed; top: 0; left: 0; width: 100%; }
    .no-print        { display: none !important; }
    .cert-paper      { box-shadow: none !important; }
    @page            { size: A4 landscape; margin: 0; }
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
    #dash-sidebar { position: fixed; top: 0; left: 0; height: 100vh; }
}
