/*
 * Haftalik onlayn darslar jadvali (profile/lesson-schedule).
 *
 * Ikkala rejim uchun ham qoidalar shu faylda: yorug' rejim `.ws-*`, tungi rejim
 * `.dark .ws-*`. Fayl har doim yuklanadi (dark-mode.css dan farqli), shuning
 * uchun palitra shu yerda to'liq berilgan.
 * Tungi palitra: fon #131022, kartochka #2b2838, matn #b9b7c0.
 */

.weekly-schedule {
    padding: 20px 24px 8px;
    border-bottom: 1px solid #e9ecef;
}

/* --- Sarlavha va hafta navigatsiyasi ---------------------------------- */

.ws-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ws-head-title {
    font-size: 17px;
    font-weight: 600;
    color: #1f1f1f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-head-title i {
    color: #ff875a;
    font-size: 20px;
}

.ws-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ws-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    background: #fff;
    text-decoration: none;
    transition: all .15s ease;
    white-space: nowrap;
}

.ws-nav-btn:hover {
    border-color: #ff875a;
    color: #ff875a;
}

.ws-nav-label {
    font-size: 13px;
    font-weight: 600;
    color: #777;
    padding: 0 8px;
    white-space: nowrap;
}

/* --- Kunlar to'ri ------------------------------------------------------ */

.ws-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.ws-day {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 8px;
    min-height: 90px;
}

.ws-day-empty {
    background: #fbfbfc;
}

.ws-day-today {
    border-color: #ff875a;
    background: #fff6f2;
}

.ws-day-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #555;
    text-align: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e4e6e9;
    line-height: 1.4;
}

.ws-day-today .ws-day-name {
    color: #ff875a;
    border-bottom-color: #ffd0bd;
}

.ws-today-badge {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #fff;
    background: #ff875a;
    border-radius: 10px;
    padding: 1px 8px;
    margin: 4px auto 0;
    width: fit-content;
}

.ws-no-lesson {
    font-size: 12px;
    color: #adb5bd;
    text-align: center;
    padding: 8px 0;
}

/* --- Dars kartochkasi -------------------------------------------------- */

.ws-lesson {
    background: #fff;
    border: 1px solid #e9ecef;
    border-left: 3px solid #ff875a;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
}

.ws-lesson:last-child {
    margin-bottom: 0;
}

.ws-lesson-past {
    opacity: .55;
    border-left-color: #adb5bd;
}

.ws-lesson-live {
    border-left-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, .12);
}

.ws-time {
    font-size: 14px;
    font-weight: 700;
    color: #ff875a;
    line-height: 1.2;
}

.ws-lesson-past .ws-time {
    color: #868e96;
}

.ws-lesson-live .ws-time {
    color: #28a745;
}

.ws-title {
    font-size: 12px;
    font-weight: 600;
    color: #1f1f1f;
    line-height: 1.35;
    margin-top: 4px;
    word-break: break-word;
}

.ws-course,
.ws-teacher {
    font-size: 11px;
    color: #777;
    line-height: 1.35;
    margin-top: 3px;
    word-break: break-word;
}

.ws-teacher i {
    font-size: 12px;
    vertical-align: -1px;
}

/* --- Holat belgilari (badge) ------------------------------------------ */

.ws-badge {
    display: block;
    margin-top: 7px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    text-decoration: none;
}

.ws-badge-join {
    background: #28a745;
    color: #fff;
    cursor: pointer;
}

.ws-badge-join:hover {
    background: #22913c;
    color: #fff;
}

.ws-badge-soon {
    background: #fff3cd;
    color: #8a6d3b;
}

.ws-badge-past {
    background: #f1f3f5;
    color: #868e96;
}

.ws-badge-lock {
    background: #e9ecef;
    color: #6c757d;
}

.ws-badge-pay {
    background: #ffc107;
    color: #533f03;
}

.ws-badge-pay:hover {
    background: #eeb100;
    color: #533f03;
}

/* --- Bo'sh hafta ------------------------------------------------------- */

.ws-empty {
    text-align: center;
    padding: 32px 12px;
    color: #adb5bd;
}

.ws-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.ws-empty p {
    margin: 0;
    font-size: 14px;
}

/* --- Pastki havola ----------------------------------------------------- */

.ws-foot {
    margin-top: 14px;
    padding-bottom: 6px;
}

.ws-foot-link,
.weekly-schedule-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #ff875a;
    text-decoration: none;
}

.ws-foot-link:hover,
.weekly-schedule-link:hover {
    color: #e56a3d;
}

/* "Onlayn darslar" sahifasidagi havola — kartochka ko'rinishida */
.weekly-schedule-link {
    padding: 10px 14px;
    border: 1px solid #ffd0bd;
    border-radius: 8px;
    background: #fff6f2;
}

.weekly-schedule-link:hover {
    border-color: #ff875a;
}

/* --- Mobil / planshet -------------------------------------------------- */

@media (max-width: 1199px) {
    .ws-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .weekly-schedule {
        padding: 16px 14px 8px;
    }
    .ws-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .ws-head {
        flex-direction: column;
        align-items: stretch;
    }
    .ws-nav {
        width: 100%;
        justify-content: space-between;
    }
    .ws-nav-label {
        padding: 0 4px;
        text-align: center;
    }
}

@media (max-width: 575px) {
    .ws-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    /* Bitta ustunda bo'sh kunlar joyni behuda egallaydi — yashiramiz */
    .ws-day-empty {
        display: none;
    }
    .ws-day {
        min-height: 0;
    }
    /* Bitta ustunda vaqt va nom yonma-yon turgani ixchamroq */
    .ws-lesson {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr);
        column-gap: 10px;
        align-items: start;
    }
    .ws-time {
        grid-row: 1 / span 4;
        padding-top: 1px;
    }
    .ws-title,
    .ws-course,
    .ws-teacher,
    .ws-badge {
        grid-column: 2;
    }
    .ws-title {
        margin-top: 0;
        font-size: 13px;
    }
    .ws-badge {
        justify-self: start;
        min-width: 130px;
    }
}

/* ======================================================================
 * TUNGI REJIM
 * ====================================================================== */

.dark .weekly-schedule {
    border-bottom-color: rgba(199, 199, 199, .25);
}

.dark .ws-head-title {
    color: #fff;
}

.dark .ws-nav-btn {
    background: #2b2838;
    border-color: rgba(199, 199, 199, .25);
    color: #b9b7c0;
}

.dark .ws-nav-btn:hover {
    border-color: #ff875a;
    color: #ff875a;
}

.dark .ws-nav-label {
    color: #b9b7c0;
}

.dark .ws-day,
.dark .ws-day-empty {
    background: #232030;
    border-color: rgba(199, 199, 199, .2);
}

.dark .ws-day-today {
    background: #33222a;
    border-color: #ff875a;
}

.dark .ws-day-name {
    color: #b9b7c0;
    border-bottom-color: rgba(199, 199, 199, .2);
}

.dark .ws-day-today .ws-day-name {
    color: #ff875a;
    border-bottom-color: rgba(255, 135, 90, .4);
}

.dark .ws-no-lesson {
    color: #7d7a88;
}

.dark .ws-lesson {
    background: #2b2838;
    border-color: rgba(199, 199, 199, .2);
    border-left-color: #ff875a;
}

.dark .ws-lesson-past {
    border-left-color: #6c6a77;
}

.dark .ws-lesson-live {
    border-left-color: #2fd46f;
}

.dark .ws-lesson-live .ws-time {
    color: #2fd46f;
}

.dark .ws-title {
    color: #fff;
}

.dark .ws-course,
.dark .ws-teacher {
    color: #b9b7c0;
}

.dark .ws-badge-join {
    background: #2fd46f;
    color: #16202a;
}

.dark .ws-badge-join:hover {
    background: #29bd62;
    color: #16202a;
}

.dark .ws-badge-soon {
    background: #4a3f1f;
    color: #ffd970;
}

.dark .ws-badge-past,
.dark .ws-badge-lock {
    background: #383548;
    color: #b9b7c0;
}

.dark .ws-empty {
    color: #7d7a88;
}

.dark .weekly-schedule-link {
    background: #33222a;
    border-color: rgba(255, 135, 90, .4);
}
