:root {
    --primary-color: #2148C0;
    --secondary-color: #FF5722;
    --morning: #d97706;
    --afternoon: #e85d26;
    --evening: #7c3aed;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    overflow-x: hidden;
}

/* navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}

.navbar-brand img {
    height: 80px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.nav-link {
    color: #333 !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 10px 0;
    margin-top: 10px;
}

.dropdown-item {
    padding: 10px 25px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding-left: 30px;
}

.btn-login {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 25px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-login:hover {
    background: var(--primary-color);
    color: white;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0 60px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -200px;
    right: -100px;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 15px;
    animation: fadeInUp 0.8s;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s 0.2s backwards;
}

/* Stats Box */
.stats-section {
    background: white;
    border: 2px solid #ffc107;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    padding: 40px;
    margin-bottom: 30px;
}

.stat-box {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-box>div:last-child {
    color: #555;
    font-weight: 500;
}

/* Filters Box */
.filters-section {
    background: white;
    border: 2px solid #ffc107;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    padding: 30px;
    margin-bottom: 40px;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 25px;
    margin: 5px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 14px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s;
    font-size: 14px;
}

.search-box input:focus {
    border-color: var(--primary-color);
}

.search-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Section Title */
.courses-grid {
    margin-bottom: 50px;
}

/* bootstrap's grid gutter (padding on columns / negative margin on .row) gets wiped out by the global `* { padding:0 }` reset above */
.courses-grid .row {
    margin-left: -12px;
    margin-right: -12px;
    row-gap: 24px;
}

.courses-grid .row > [data-category] {
    padding-left: 12px;
    padding-right: 12px;
}

.course-category-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Course Card */
.course-card {
    background: white;
    border: 2px solid #ffc107;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    margin-bottom: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
    border-color: #ffb300;
}

.course-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffc107;
    padding: 28px 20px 20px;
    text-align: center;
    font-size: 3rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.course-icon .icon-symbol {
    font-size: 2.8rem;
    line-height: 1;
}

.course-icon .icon-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--bs-highlight-bg);
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.course-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: bold;
}

.course-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-body h4 {
    display: none;
}

.course-body>p {
    color: #555;
    margin-bottom: 12px;
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
}

/* Online Live Badge */
.online-live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 7px 12px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #1e40af;
    font-weight: 600;
}

.online-live-badge .live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3)
    }
}

/* Schedule Strip */
.sched-strip {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 13px;
    margin-bottom: 12px;
}

.sched-strip-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.sched-day {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    background: #eff6ff;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
}

.sched-tbd {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
}

.sched-levels {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sched-lvl {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid;
}

.sched-lvl-top {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sched-lvl-m {
    background: #fffbeb;
    border-color: #fde68a;
}

.sched-lvl-a {
    background: #fff7f4;
    border-color: #fed7c3;
}

.sched-lvl-e {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

.sched-lvl-name {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    width: 62px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.sched-lvl-time {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    width: 56px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.sched-lvl-dates {
    font-size: 9.5px;
    color: #64748b;
    line-height: 1.3;
    padding-left: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sched-lvl-dates i {
    font-size: 9px;
    flex-shrink: 0;
}

.sched-lvl-dur {
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 5px;
    background: #eff6ff;
    color: var(--primary-color);
    flex-shrink: 0;
    box-sizing: border-box;
    width: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    margin-left: auto;
}

.ss-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3px 6px;
    line-height: 1;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 60px;
    white-space: nowrap;
}

.ss-on {
    background: #dcfce7;
    color: #15803d;
}

.ss-up {
    background: #fef9c3;
    color: #854d0e;
}

.ss-end {
    background: #f3f4f6;
    color: #6b7280;
}

.ss-none {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Level Selector */
.level-selector {
    margin-bottom: 12px;
}

.level-selector label {
    font-weight: 700;
    color: #333;
    font-size: .82rem;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.level-tabs {
    display: flex;
    gap: 6px;
}

.level-tab {
    flex: 1;
    padding: 14px 5px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
    text-align: center;
    transition: all .22s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-tab:hover {
    border-color: var(--primary-color);
    background: #eef1fb;
}

.level-name {
    font-weight: 700;
    font-size: .85rem;
}

.level-tab.sel-basic {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.level-tab.sel-intermediate {
    border-color: #fd7e14;
    background: #fd7e14;
    color: white;
}

.level-tab.sel-advanced {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.level-tab.level-full {
    opacity: .55;
    cursor: not-allowed;
}

.level-tab.level-full::after {
    content: 'FULL';
    position: absolute;
    top: 4px;
    right: 4px;
    background: #dc3545;
    color: white;
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}

.slot-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: 3px;
}

.slot-ok {
    background: #d4edda;
    color: #155724;
}

.slot-half {
    background: #fff3cd;
    color: #856404;
}

.slot-warn {
    background: #ffe5d0;
    color: #7d3a00;
}

.slot-full {
    background: #f8d7da;
    color: #721c24;
}

/* Selected Level Info */
.selected-level-info {
    background: #f0f4ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: .88rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    color: #555;
}

.info-value {
    font-weight: 700;
    color: var(--primary-color);
}

.slot-bar-wrap {
    margin-top: 8px;
}

.slot-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    color: #555;
    margin-bottom: 4px;
}

.slot-bar {
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    overflow: hidden;
}

.slot-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s;
}

.bar-ok {
    background: #28a745;
}

.bar-half {
    background: #fd7e14;
}

.bar-warn {
    background: #e07000;
}

.bar-full {
    background: #dc3545;
}

/* Course Actions */
.course-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-course {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: all .3s;
    cursor: pointer;
    font-size: .9rem;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.btn-course:hover {
    background: #E64A19;
    color: white;
    transform: translateY(-2px);
}

.btn-course.btn-disabled {
    background: #aaa;
    pointer-events: none;
}

.btn-details {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: all .3s;
    cursor: pointer;
    font-size: .9rem;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.btn-details:hover {
    background: var(--primary-color);
    color: white;
}

/* close button on the Course Outline / Level Details popups */
.btn-modal-close {
    background: transparent;
    color: var(--primary-color);
    border: none;
    box-shadow: inset 0 0 0 2px var(--primary-color);
    font-weight: 600;
    transition: all .3s;
}

.btn-modal-close:hover {
    background: var(--primary-color);
    color: white;
}

/* close + Enroll buttons in the outline/level-detail modal footers, each sized to its own text (not stretched) */
.modal-footer.justify-content-between {
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;               /* Close and View Batches stay on one line */
}
.modal-footer.justify-content-between > * { margin: 0; }
@media (max-width: 400px) {
    .modal-footer.justify-content-between { flex-wrap: wrap; }   /* very small phones: let it drop below */
}

/* Per-Level Detail Modal */
.lvl-modal-header-basic,
.lvl-modal-header-intermediate,
.lvl-modal-header-advanced {
    color: white;
}

.lvl-modal-header-basic {
    background: linear-gradient(135deg, #1a7a35, #28a745);
}

.lvl-modal-header-intermediate {
    background: linear-gradient(135deg, #b85c00, #fd7e14);
}

.lvl-modal-header-advanced {
    background: linear-gradient(135deg, #9b1c2e, #dc3545);
}

.lvl-detail-box {
    background: #f8faff;
    border: 1px solid #dbe4ff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
    font-size: .93rem;
    line-height: 1.7;
    color: #334155;
}

.lvl-outline-section {
    margin-bottom: 20px;
}

.lvl-outline-section h6 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 7px;
}

.outline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.outline-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .83rem;
    color: #374151;
}

.outline-item i {
    margin-top: 2px;
    flex-shrink: 0;
}

.outline-num {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    margin-top: 1px;
}

.outline-empty {
    color: #9ca3af;
    font-style: italic;
    font-size: .85rem;
    padding: 10px 0;
}

.lvl-sched-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: .88rem;
}

.lvl-sched-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.lvl-sched-row:last-child {
    margin-bottom: 0;
}

.lvl-sched-label {
    color: #64748b;
    width: 70px;
    flex-shrink: 0;
    font-size: .82rem;
}

.lvl-sched-val {
    font-weight: 700;
    color: #1e293b;
}

.lvl-slot-bar-wrap {
    margin-top: 14px;
}

.lvl-slot-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    color: #555;
    margin-bottom: 5px;
}

.lvl-slot-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.lvl-slot-bar-fill {
    height: 100%;
    border-radius: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 2px solid #ffc107;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.empty-state i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 20px;
    display: block;
}

/* footer */
.footer {
    background: linear-gradient(180deg, var(--bs-emphasis-color) 0%, #2c3e50 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
    border-top: 3px solid var(--secondary-color);
}

.footer h5 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: bold;
}

.footer a {
    color: #bbb;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: color .3s;
}

.footer a:hover {
    color: white;
}

.social-icons a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    margin-right: 10px;
    transition: all .3s;
}

.social-icons a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #34495e;
    color: #bbb;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .navbar-brand img {
        height: 50px;
    }
}

/* modal "Close" button: white with a blue border, same look as the Previous / Next buttons */
.btn-lx-close,
.btn.btn-lx-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: #fff;
    color: #2148C0;
    border: 2px solid #2148C0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
    transition: background .2s;
}
.btn-lx-close:hover,
.btn.btn-lx-close:hover,
.btn.btn-lx-close:focus,
.btn.btn-lx-close:active {
    background: #eff6ff;
    color: #2148C0;
    border-color: #2148C0;
}

/* category filter buttons in each category's own colour (set in Admin > Manage Categories) */
.filter-btn.filter-btn-cat {
    border-color: var(--cat-color);
    color: var(--cat-color);
}
.filter-btn.filter-btn-cat:hover,
.filter-btn.filter-btn-cat.active {
    background: var(--cat-color);
    border-color: var(--cat-color);
    color: #fff;
}

/* course opened from a footer link (all_courses.php#course-ID) */
.course-card.ac-highlight {
    border-color: var(--secondary-color);
    animation: ac-highlight-pulse 1.5s ease-in-out 2;
}
@keyframes ac-highlight-pulse {
    0%, 100% { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 87, 34, .4), 0 12px 30px rgba(0, 0, 0, 0.25); }
}

/* Outline popup: the "View Batches" button follows the level colour (same colours as the popup header and level tabs) */
.btn.btn-modal-batches { color: #fff; font-weight: 600; transition: background .25s, border-color .25s;
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13.5px; border-radius: 8px; white-space: nowrap; }
.btn.btn-modal-batches.lx-batches-basic        { background: #28a745; border-color: #28a745; }
.btn.btn-modal-batches.lx-batches-intermediate { background: #fd7e14; border-color: #fd7e14; }
.btn.btn-modal-batches.lx-batches-advanced     { background: #dc3545; border-color: #dc3545; }
.btn.btn-modal-batches.lx-batches-basic:hover,        .btn.btn-modal-batches.lx-batches-basic:focus        { background: #1e7e34; border-color: #1e7e34; color: #fff; }
.btn.btn-modal-batches.lx-batches-intermediate:hover, .btn.btn-modal-batches.lx-batches-intermediate:focus { background: #d96a00; border-color: #d96a00; color: #fff; }
.btn.btn-modal-batches.lx-batches-advanced:hover,     .btn.btn-modal-batches.lx-batches-advanced:focus     { background: #b02a37; border-color: #b02a37; color: #fff; }

/* white buttons with a coloured border fill with that colour on hover / click (site-wide rule) */
.btn-lx-close:hover,
.btn-lx-close:active,
.btn.btn-lx-close:hover,
.btn.btn-lx-close:active {
    background: #2148C0;
    border-color: #2148C0;
    color: #fff;
}

.btn-lx-close:hover i,
.btn-lx-close:active i,
.btn.btn-lx-close:hover i,
.btn.btn-lx-close:active i {
    color: inherit;
}