/* Online Academy Platform - Custom Styles */

:root {
    --theme-color: #2563eb;
}

.btn-primary {
    background-color: var(--theme-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.course-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.875rem;
}

@media (min-width: 640px) {
    .course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .course-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

.course-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.course-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.course-card__media {
    flex-shrink: 0;
    height: 11rem;
    overflow: hidden;
    position: relative;
}

.course-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.course-card__faculty {
    min-height: 1.25rem;
    margin-bottom: 0.25rem;
}

.course-card__title {
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card__desc {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.course-card__meta {
    min-height: 1.25rem;
}

.course-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0.875rem;
}

@media (min-width: 640px) {
    .course-card__body {
        padding: 1rem;
    }
}

.courses-page-section {
    margin-bottom: 1.75rem;
}

.courses-page-section:last-child {
    margin-bottom: 0;
}

.course-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    margin-top: auto;
    border-top: 1px solid #f3f4f6;
}

.course-card__price {
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.25;
    color: var(--theme-color);
}

.course-card__price-original {
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 0.25rem;
}

.course-card__price-badge {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.95);
    color: var(--theme-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

@media (max-width: 639px) {
    .course-card__media {
        height: 9.5rem;
    }

    .course-card__body {
        padding: 0.75rem;
    }

    .course-card__title {
        font-size: 0.9375rem;
        min-height: auto;
        margin-bottom: 0.375rem;
    }

    .course-card__desc {
        font-size: 0.6875rem;
        margin-bottom: 0.375rem;
    }

    .course-card__footer {
        padding-top: 0.375rem;
    }

    .course-card__price {
        font-size: 1rem;
    }

    .course-card__price-badge {
        font-size: 0.75rem;
        bottom: 0.5rem;
        left: 0.5rem;
        padding: 0.2rem 0.5rem;
    }

    .course-card .qual-badge {
        font-size: 0.625rem;
        padding: 0.15rem 0.4rem;
        top: 0.5rem;
        left: 0.5rem;
    }

    .course-card .badge {
        font-size: 0.625rem;
        top: 0.5rem;
        right: 0.5rem;
    }
}

.toast-alert {
    animation: slideIn 0.3s ease-out;
}

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

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--theme-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.table-responsive {
    overflow-x: auto;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.progress-bar {
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--theme-color);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.page-hero {
    background: linear-gradient(135deg, var(--hero-bg-start, #1e3a8a) 0%, var(--hero-bg-end, #312e81) 100%);
}

.page-hero-diploma {
    background: linear-gradient(135deg, var(--hero-bg-end, #312e81) 0%, var(--hero-bg-start, #4338ca) 100%);
}

.dashboard-sidebar .sidebar-link {
    color: rgba(255, 255, 255, 0.75);
}

.dashboard-sidebar .sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dashboard-sidebar .sidebar-link-active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 600;
}

.dashboard-sidebar .sidebar-logout {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-sidebar .sidebar-logout:hover {
    background-color: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.85);
    color: #fff;
}

.nav-logout-btn {
    color: var(--theme-color);
    border: 1px solid var(--theme-color);
    background: transparent;
}

.nav-logout-btn:hover {
    background: var(--theme-color);
    color: #fff;
}

.qual-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qual-badge-certificate {
    background: #dbeafe;
    color: #1d4ed8;
}

.qual-badge-diploma {
    background: #e0e7ff;
    color: #4338ca;
}

.qual-type-card {
    display: block;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    background: #fafafa;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.qual-type-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #bfdbfe;
}

.learn-lesson-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    color: #4b5563;
    margin-bottom: 0.125rem;
    text-decoration: none;
}

.learn-lesson-link:hover {
    background: #f9fafb;
}

.learn-lesson-link.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.learn-lesson-link.done {
    color: #059669;
}

.learn-lesson-link.locked {
    color: #9ca3af;
    cursor: not-allowed;
    display: flex;
}

.lesson-dot {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.learn-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
}

.learn-reading {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.learn-reading__title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
    margin-bottom: 1.5rem;
}

.learn-reading__footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.lesson-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #374151;
    text-align: justify;
    hyphens: auto;
}

.lesson-content p,
.lesson-content li,
.lesson-content blockquote {
    text-align: justify;
}

.lesson-content p {
    margin-bottom: 1.125rem;
}

.lesson-content h2,
.lesson-content h3,
.lesson-content h4 {
    font-weight: 700;
    color: #111827;
    margin: 1.75rem 0 0.75rem;
    text-align: left;
}

.lesson-content h2 { font-size: 1.375rem; }
.lesson-content h3 { font-size: 1.2rem; }
.lesson-content h4 { font-size: 1.0625rem; }

.lesson-content ul,
.lesson-content ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
    padding: 0;
}

.lesson-content li {
    margin-bottom: 0.5rem;
}

.lesson-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--theme-color, #2563eb);
    background: #f9fafb;
    color: #4b5563;
}

.lesson-content strong,
.lesson-content b {
    font-weight: 700;
    color: #111827;
}

.learn-outline__heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.learn-outline__module {
    margin-bottom: 1.25rem;
}

.learn-outline__module-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    margin-bottom: 0.375rem;
}

.learn-outline__lessons {
    list-style: none;
    margin: 0;
    padding: 0;
}

.learn-outline__assessments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.lesson-editor-wrap {
    min-height: 14rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.lesson-editor-wrap .ql-editor {
    min-height: 12rem;
    font-size: 1rem;
    line-height: 1.6;
}

.lesson-editor-wrap .ql-toolbar {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.lesson-editor-wrap .ql-container {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.instructor-card {
    border: 1px solid #f3f4f6;
}

.hero-uniathena {
    min-height: 0;
}

.page-hero {
    min-height: 0;
}

.assessment-timer-fixed {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.625rem 0.875rem;
    background: #fff;
    border: 2px solid #ef4444;
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

.assessment-timer-fixed__label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.assessment-timer-fixed__time {
    font-family: ui-monospace, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
    line-height: 1;
}

.assessment-take-wrap {
    padding-top: 0.5rem;
}

@media (min-width: 1024px) {
    .assessment-timer-fixed {
        left: calc(16rem + 1rem);
    }
}

.media-frame {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.media-frame-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.media-frame-video .media-frame-label {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
}

.media-frame-audio .media-frame-label {
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    color: #fff;
}

.media-frame-body {
    background: #0f172a;
}

.media-frame-video .media-frame-body video {
    display: block;
    object-fit: contain;
    background: #000;
}

.media-frame-audio-body {
    background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
    padding: 2rem 1.5rem;
}

.media-frame-audio-body audio {
    width: 100%;
    min-height: 48px;
}

@media print {
    .no-print { display: none !important; }
}

/* Homepage — outcome-focused layout */
.home-hero-collage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.home-hero-collage__cell {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    min-height: 0;
    background: rgba(255, 255, 255, 0.08);
}

.home-hero-collage img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.pathway-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pathway-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.pathway-card img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: #111827;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item[open] summary { color: var(--theme-color); }
