/**
 * Depromm Course Styles
 * Niestandardowy styl kart kursów Tutor LMS
 */


/* ============================================
   ARCHIWUM - PRZEARANŻOWANIE LAYOUTU (CSS GRID)
   ============================================ */

/*
   Przebudowa natywnego układu Tutor LMS:
   1. Ustaw .tutor-row jako Grid Container
   2. Użyj display: contents na kolumnach Bootstrap (.tutor-col-*), aby ich dzieci stały się elementami Grida
   3. Poukładaj elementy w Grid Areas
*/

.course-archive-page .tutor-row {
    display: grid !important;
    grid-template-columns: 1fr auto;
    /* Kolumna filtrów (lewa) | Kolumna sortowania (prawa) */
    grid-template-rows: auto auto;
    /* Wiersz filtrów+sort | Wiersz kursów */
    grid-template-areas:
        "filters sorting"
        "courses courses";
    gap: 30px 40px;
    align-items: start;
}

/* 1. FILTRY (Lewa strona) */
.course-archive-page .tutor-col-3,
.course-archive-page .tutor-course-filter-container {
    display: contents !important;
    /* Rozpad kolumny, dzieci stają się elementami grida */
}

/* Kontener filtrów (bezpośrednie dziecko .tutor-col-3) */
.course-archive-page .tutor-course-filter-container .tutor-course-filter {
    grid-area: filters;
    position: static !important;
    /* Reset position sticky/fixed sidebar */
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    visibility: visible !important;
    /* Wymuś widoczność (nadpisanie zachowania mobilnego) */
    transform: none !important;
    left: auto !important;
}

/* 2. PRAWA KOLUMNA (Sortowanie + Kursy) */
.course-archive-page .tutor-col-xl-9,
.course-archive-page .tutor-col-xl-8,
.course-archive-page .tutor-col-8,
.course-archive-page .tutor-col-9 {
    display: contents !important;
    /* Rozpad kolumny */
}

/* Sortowanie (zazwyczaj pierwsze dziecko w prawej kolumnie) */
.course-archive-page .tutor-course-filter:not(.tutor-course-filter-container .tutor-course-filter) {
    grid-area: sorting;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* 3. KURSY (Dolny wiersz) */
.course-archive-page .tutor-pagination-wrapper-replaceable {
    grid-area: courses;
    width: 100%;
}

/* ============================================
   STYLIZACJA FILTRÓW (NATIVE WIDGETS -> PILLS)
   ============================================ */

/* Formularz filtrów - ułóż widgety obok siebie */
.course-archive-page .tutor-course-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

/* Ukryj nagłówki widgetów */
.course-archive-page .tutor-widget-title {
    display: none !important;
}

/* Reset stylów widgetów */
.course-archive-page .tutor-widget {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* Lista opcji jako flex */
.course-archive-page .tutor-widget-content .tutor-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.course-archive-page .tutor-list-item {
    margin: 0 !important;
    padding: 0 !important;
}

/* Label jako Pill Button */
.course-archive-page .tutor-list-item label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #9ca3af;
    background: transparent;
    border: 1px solid #374151;
    /* Ciemnoszary border */
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Hover state */
.course-archive-page .tutor-list-item label:hover {
    border-color: #6366f1;
    color: #ffffff;
}

/* Checkbox (ukryty) */
.course-archive-page .tutor-list-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Active state (gdy checkbox zaznaczony) */
.course-archive-page .tutor-list-item input[type="checkbox"]:checked+span,
/* Czasem label wrapuje span */
.course-archive-page .tutor-list-item label:has(:checked),
.course-archive-page .tutor-list-item.is-checked label {
    /* Na wypadek klasy JS */
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

/* Czas trwania - fioletowe tło (jak w projekcie) */
/* .tutor-widget-course-duration ... (jeśli jest klasa) */


/* ============================================
   KARTA KURSU
   ============================================ */

.depromm-course-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    overflow: visible;
    transition: transform 0.3s ease;
    height: 100%;
}

.depromm-course-card:hover {
    transform: translateY(-4px);
}

.depromm-course-card.tutor-card {
    box-shadow: none;
    border: none;
    background: transparent;
}

/* Thumbnail + Badge */
.depromm-card-thumbnail {
    position: relative;
    margin-bottom: 20px;
}

.depromm-category-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    z-index: 10;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 6px 14px;
    border-radius: 30px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.depromm-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    /* Aspect ratio ok. 16:9 */
    border-radius: 16px;
    overflow: hidden;
    background: #1e1e2d;
}

.depromm-thumbnail-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.depromm-course-card:hover .depromm-thumbnail-wrapper img {
    transform: scale(1.06);
}

/* Tytuł + Czas */
.depromm-card-body {
    padding: 0 !important;
}

.depromm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.depromm-course-title {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
    /* Biały tytuł */
}

.depromm-course-title a {
    color: inherit;
    text-decoration: none;
}

.depromm-course-title a:hover {
    color: #a78bfa;
    /* Jaśniejszy fiolet na hover */
}

.depromm-course-duration {
    flex-shrink: 0;
    font-size: 14px;
    color: #6b7280;
    /* Szary */
    font-style: italic;
}

/* Opis (lista) */
.depromm-card-content {
    flex: 1;
    margin-bottom: 24px;
}

.depromm-content-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #9ca3af;
}

.depromm-content-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.depromm-content-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #9ca3af;
    /* Szary tekst */
}

.depromm-content-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6366f1;
    /* Fioletowa kropka */
    font-weight: bold;
}

/* Stopka */
.depromm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding: 0 !important;
    border: none !important;
}

.depromm-points {
    font-size: 13px;
    color: #8b5cf6;
    /* Fioletowy tekst */
    font-weight: 500;
}

.depromm-view-course-btn {
    display: inline-flex;
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    background: transparent;
    border: 1px solid #ffffff;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.depromm-view-course-btn:hover {
    background: #ffffff;
    color: #0c0c14;
}

/* Responsywność */
@media (max-width: 991px) {
    .course-archive-page .tutor-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "filters"
            "sorting"
            "courses";
    }

    .course-archive-page .tutor-course-filter:not(.tutor-course-filter-container .tutor-course-filter) {
        justify-content: flex-start;
    }
}

/* Cleanups */
.depromm-course-card .tutor-card-body,
.depromm-course-card .tutor-card-footer {
    padding: 0;
    border: none;
}

.depromm-course-card .tutor-ratings,
.depromm-course-card .tutor-course-name:not(.depromm-course-title),
.depromm-course-card .tutor-meta:not(.depromm-card-header) {
    display: none !important;
}

/* Ukrycie przycisku "Clear All Filters" */
.tutor-widget-course-filter {
    display: none !important;
}