:root {
    --pinkar-primary: #003366;
    --pinkar-accent: #0066cc;
    --pinkar-light: #f0f4f8;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--pinkar-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-primary {
    background-color: var(--pinkar-primary) !important;
}

.btn-primary {
    background-color: var(--pinkar-accent);
    border-color: var(--pinkar-accent);
}

.btn-primary:hover {
    background-color: #0052a3;
    border-color: #0052a3;
}

.course-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.course-card .card-img-top {
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
}

.course-card .placeholder-cover {
    height: 160px;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.badge-mandatory {
    background-color: #dc3545;
}

.progress-thin {
    height: 8px;
    border-radius: 4px;
}

.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.lesson-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
}

.lesson-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.lesson-nav-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
}

.lesson-nav-item {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    gap: 0.65rem;
    align-items: start;
    padding: 0.85rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    margin-bottom: 0.25rem;
}

.lesson-nav-item:hover {
    background: #f1f5f9;
    color: var(--pinkar-primary);
}

.lesson-nav-item.active {
    background: #e8f0fe;
    border-left-color: var(--pinkar-accent);
    color: var(--pinkar-primary);
    font-weight: 600;
}

.lesson-nav-item.completed:not(.active) {
    border-left-color: #22c55e;
}

.lesson-nav-index {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lesson-nav-item.active .lesson-nav-index {
    background: var(--pinkar-accent);
    color: #fff;
}

.lesson-nav-item.completed:not(.active) .lesson-nav-index {
    background: #dcfce7;
    color: #16a34a;
}

.lesson-nav-title {
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
    hyphens: auto;
}

.lesson-nav-status {
    padding-top: 0.15rem;
    flex-shrink: 0;
}

.lesson-sidebar .list-group-item {
    border-left: 3px solid transparent;
}

.lesson-sidebar .list-group-item.active {
    border-left-color: var(--pinkar-accent);
    background-color: #e8f0fe;
    color: var(--pinkar-primary);
}

.lesson-sidebar .list-group-item.completed {
    border-left-color: #28a745;
}

.lesson-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-height: 500px;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video,
.video-container iframe {
    width: 100%;
    min-height: 400px;
}

.video-speed-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #1e293b;
    color: #e2e8f0;
    border-top: 1px solid #334155;
}

.video-speed-label {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.video-speed-buttons {
    display: flex;
    gap: 0.35rem;
}

.video-speed-btn {
    border: 1px solid #475569;
    background: transparent;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.video-speed-btn:hover {
    background: #334155;
}

.video-speed-btn.active {
    background: var(--pinkar-accent);
    border-color: var(--pinkar-accent);
    color: #fff;
}

.video-speed-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: #94a3b8;
}

@media (max-width: 576px) {
    .video-speed-hint {
        margin-left: 0;
        width: 100%;
    }
}

.login-card {
    max-width: 420px;
    margin: 80px auto;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.certificate-verify {
    max-width: 600px;
    margin: 40px auto;
}

.course-search-form .form-control {
    border: none;
    border-radius: 10px 0 0 10px;
    padding: 0.65rem 1rem;
}

.course-search-form .btn {
    border-radius: 0 10px 10px 0;
    border: none;
    padding: 0 1.25rem;
}

/* --- Admin portal legacy --- */
.admin-portal .table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

footer.footer {
    margin-top: auto;
}

/* --- Page Hero --- */
.page-hero {
    background: linear-gradient(135deg, var(--pinkar-primary) 0%, var(--pinkar-accent) 100%);
    border-radius: 16px;
    padding: 2rem 2.25rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 51, 102, 0.2);
}

.page-hero-compact {
    padding: 1.75rem 2rem;
}

.page-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.page-hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
}

.hero-stats-row {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.hero-stat-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 80px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat-pill .hero-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.hero-stat-pill .hero-stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Section headers --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--pinkar-primary);
}

/* --- Course card enhancements --- */
.course-card-cover {
    position: relative;
}

.course-card-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
}

.course-category-badge {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--pinkar-primary) !important;
    font-weight: 600;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.course-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #64748b;
}

.participant-stats {
    display: flex;
    gap: 0.5rem;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.65rem;
    border: 1px solid #e2e8f0;
}

.participant-stats-vertical {
    flex-direction: column;
}

.participant-stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.participant-stat i {
    font-size: 1.1rem;
    color: #64748b;
    width: 20px;
    text-align: center;
}

.participant-stat.in-progress i { color: #f59e0b; }
.participant-stat.completed i { color: #22c55e; }

.participant-stat strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--pinkar-primary);
}

.participant-stat small {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.progress-thick {
    height: 12px;
    border-radius: 6px;
}

.user-progress-box {
    background: #f0f7ff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid #bfdbfe;
}

.lesson-preview-list .list-group-item {
    border-left: none;
    border-right: none;
}

.lesson-type-badge {
    background: #e8f0fe !important;
    color: var(--pinkar-accent) !important;
    font-weight: 500;
}

.completed-course-card {
    border-left: 4px solid #22c55e !important;
}

.completed-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dcfce7;
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.course-description {
    line-height: 1.7;
}

@media (max-width: 768px) {
    .page-hero { padding: 1.5rem; }
    .page-hero-title { font-size: 1.35rem; }
    .hero-stats-row { justify-content: flex-start; }
    .participant-stats { flex-direction: column; }
}

/* --- Course notes panel --- */
.notes-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 1rem;
    border: 1px solid #fde68a;
}

.notes-panel-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-bottom: 1px solid #fde68a;
    border-radius: 12px 12px 0 0;
}

.notes-panel-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.note-textarea {
    font-size: 0.9rem;
    resize: vertical;
    min-height: 90px;
    border-color: #e2e8f0;
}

.note-textarea:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notes-empty {
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: #94a3b8;
}

.notes-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.note-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem;
    transition: border-color 0.15s;
}

.note-item:hover {
    border-color: #fbbf24;
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.note-time-badge {
    font-size: 0.75rem;
    background: #dbeafe;
    color: var(--pinkar-accent);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

.note-time-badge:hover {
    background: #bfdbfe;
}

.note-date {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

.note-item-body {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.note-item-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

.learn-layout .lesson-sidebar {
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 1rem;
}

/* --- Learn page wide layout --- */
.learn-main {
    width: 100%;
    padding-left: clamp(1rem, 2.5vw, 2.5rem);
    padding-right: clamp(1rem, 2.5vw, 2.5rem);
}

.learn-page {
    max-width: 1760px;
    margin: 0 auto;
}

.learn-page-header {
    background: white;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.learn-back-link {
    color: var(--pinkar-primary);
    font-weight: 600;
    font-size: 1.05rem;
    display: inline-block;
    max-width: 100%;
}

.learn-progress-wrap {
    max-width: 100%;
}

.learn-layout .lesson-content {
    min-height: 560px;
}

.learn-layout .video-container video,
.learn-layout .video-container iframe,
.learn-layout #youtubePlayer {
    min-height: min(56vw, 520px);
}

@media (min-width: 1400px) {
    .learn-layout .video-container video,
    .learn-layout .video-container iframe,
    .learn-layout #youtubePlayer {
        min-height: 480px;
    }
}

@media (max-width: 991px) {
    .notes-panel, .learn-layout .lesson-sidebar {
        max-height: none;
        position: static;
    }
}

/* --- Orientation --- */
.orientation-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.orientation-home-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 1.5rem 2rem;
}

.orientation-course-card {
    border-left: 4px solid #f59e0b !important;
}

.orientation-progress-card {
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.orientation-lesson-list li {
    padding-left: 0.25rem;
}

.feedback-stars .btn-link {
    text-decoration: none;
    padding: 0 0.25rem;
}

.feedback-stars .btn-link:hover {
    transform: scale(1.1);
}

/* --- Exam --- */
.exam-ready-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 1rem 1.5rem;
}

.exam-take-header {
    background: white;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.exam-question-card {
    border-left: 4px solid var(--pinkar-accent) !important;
}

.exam-question-number {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exam-option-label {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.exam-option-label:hover {
    border-color: var(--pinkar-accent);
    background: #f0f7ff;
}

.exam-result-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.exam-celebration {
    text-align: center;
    border-radius: 24px;
    padding: 3rem 2rem;
    max-width: 560px;
    width: 100%;
    color: white;
}

.exam-celebration.passed {
    background: linear-gradient(135deg, #065f46 0%, #10b981 50%, #34d399 100%);
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.35);
}

.exam-celebration.failed {
    background: linear-gradient(135deg, #1e3a5f 0%, #475569 100%);
    box-shadow: 0 20px 60px rgba(30, 58, 95, 0.3);
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.celebration-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.celebration-message {
    font-size: 1.05rem;
    opacity: 0.95;
    line-height: 1.6;
}

.score-ring {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin-top: 1.5rem;
    border: 4px solid rgba(255,255,255,0.4);
}

.score-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}
