/* ============================================
   GROUP LESSONS PAGE CUSTOM STYLES
   ============================================ */

/* --- GLOBAL SECTION STYLES --- */
.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-align: center;
}

.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #0066cc 0%, #3399ff 100%);
    margin: 15px auto 30px;
    border-radius: 2px;
}

.zajecia-grupowe-container {
    margin: 0 auto;
}

/* --- HERO HEADER SECTION --- */
.zajecia-header {
    padding: 80px 0 100px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.52) 0%, rgba(51, 153, 255, 0.48) 100%), 
                url('../../img/2025/snowwow-szkola-narciarska-stubai-austria (2).jpg') center center/cover no-repeat fixed;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    text-align: center;
    margin-bottom: 0;
    min-height: 450px;
}

.zajecia-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
}

.zajecia-header .container {
    position: relative;
    z-index: 1;
    top: 80px;
}

.zajecia-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
    color: #ffffff;
    line-height: 1.2;
}

.zajecia-header .subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.95;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* --- TERMINY SECTION --- */
.terminy-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.terminy-grid {
    display: grid;
    /* Stała szerokość kafelka = 1/3 dostępnej przestrzeni (także dla pojedynczego terminu). */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
    margin-bottom: 0;
}

/* --- TERMIN CARDS --- */
.termin-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    /* Kafelek jest zawsze widoczny — filtrowanie steruje wyłącznie właściwością display,
       bez animacji opacity, dzięki czemu terminy nigdy nie „znikają” po klikaniu filtrów. */
    opacity: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.termin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.termin-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.2) 0%, rgba(51, 153, 255, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.termin-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 102, 204, 0.2);
}

.termin-card:hover::after {
    opacity: 1;
}

/* --- STATUS BADGES --- */
.termin-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: 'Montserrat', sans-serif;
}

.status-dostepny { 
    background: #28a745; 
    color: #ffffff;
}

.status-ostatnie_miejsca { 
    background: #ffc107; 
    color: #333;
}

.status-komplet { 
    background: #dc3545;
    color: #ffffff;
}

.status-anulowany { 
    background: #6c757d;
    color: #ffffff;
}

.status-przeterminowany { 
    background: #6c757d;
    color: #ffffff;
}

/* --- PRZETERMINOWANE TERMINY --- */
.termin-card.przeterminowany {
    opacity: 0.6;
    filter: grayscale(50%);
}

.termin-card.przeterminowany .termin-card-content {
    opacity: 0.7;
}

.termin-card.przeterminowany .termin-title {
    text-decoration: line-through;
}

.termin-card.przeterminowany .detail-value {
    color: #999 !important;
}

.termin-card.przeterminowany .detail-value.price {
    color: #999 !important;
}

.termin-card.przeterminowany .detail-value.places {
    color: #999 !important;
}

/* --- SOLD OUT OVERLAY --- */
.termin-card.sold-out::after {
    content: 'SOLD OUT';
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: auto;
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 42px;
    font-weight: 900;
    color: #ffffff;
    background: none;
    opacity: 1;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.55);
    z-index: 10;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 2px;
    pointer-events: none;
}

/* --- SOLD OUT: czarno-białe tło i wyszarzony tekst --- */
.termin-card.sold-out {
    filter: grayscale(100%);
}

.termin-card.sold-out .termin-card-content,
.termin-card.sold-out .termin-glacier,
.termin-card.sold-out .termin-title,
.termin-card.sold-out .termin-dates,
.termin-card.sold-out .termin-description {
    color: #cfcfcf;
}

/* --- TERMIN CARD CONTENT --- */
.termin-card-content {
    position: relative;
    z-index: 3;
    padding: 25px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.termin-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.termin-dates {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.termin-dates .date-separator {
    margin: 0 4px;
    opacity: 0.7;
}

/* --- BADGES --- */
.termin-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.price-badge {
    background: rgba(255, 103, 2, 0.95);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 103, 2, 0.4);
}

.places-badge {
    background: rgba(0, 102, 204, 0.95);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.4);
}

/* --- TERMIN DETAILS --- */
.termin-details {
    margin-bottom: 15px;
}

.detail-item {
    margin-bottom: 8px;
}

.detail-label {
    font-size: 12px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    font-family: 'Montserrat', sans-serif;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.detail-value.price {
    color: #ffc107;
    font-size: 18px;
    font-weight: 700;
}

.detail-value.places {
    color: #4CAF50;
    font-weight: 700;
}

/* --- TERMIN DESCRIPTION --- */
.termin-description {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- CTA BUTTON --- */
.termin-cta {
    margin-top: auto;
}

.btn-rezerwacja {
    display: inline-block;
    width: 100%;
    padding: 12px 25px;
    background: linear-gradient(135deg, #0066cc 0%, #3399ff 100%);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-rezerwacja:hover {
    background: linear-gradient(135deg, #3399ff 0%, #0066cc 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.btn-rezerwacja:disabled,
.btn-rezerwacja.disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- ZAJECIA CONTENT --- */
.zajecia-content {
    padding: 60px 0;
    background: #ffffff;
}

.zajecia-content .container {
    max-width: 1200px;
}

/* --- ZAJECIA INFO --- */
.zajecia-info {
    padding: 60px 0;
    background: #f8f9fa;
}

.zajecia-info .container {
    max-width: 1000px;
}

.zajecia-info-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    font-family: 'Inter', sans-serif;
}

.zajecia-info ul {
    list-style: none;
    padding: 0;
}

.zajecia-info li {
    padding: 12px 0 12px 35px;
    position: relative;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.zajecia-info li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.zajecia-info .fa-check-circle {
    position: absolute;
    left: 0;
    top: 14px;
    color: #0066cc;
}

/* --- NO TERMINY MESSAGE --- */
.no-terminy {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

.no-terminy i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

/* --- INQUIRY FORM SECTION --- */
.inquiry-form-section {
    padding: 60px 0;
    background: #ffffff;
}

.inquiry-form-wrapper {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.inquiry-form-wrapper .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.inquiry-form-wrapper .form-control:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.inquiry-form-wrapper label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.inquiry-form-wrapper .form-check {
    margin-bottom: 10px;
}

.inquiry-form-wrapper .form-check-input {
    border: 2px solid #0066cc;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.inquiry-form-wrapper .form-check-label {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    margin-left: 8px;
}

.btn-snow {
    display: inline-block;
    padding: 14px 35px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.btn-primary-blue {
    background: linear-gradient(135deg, #0066cc 0%, #3399ff 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.35);
}

.btn-primary-blue:hover {
    background: linear-gradient(135deg, #3399ff 0%, #0066cc 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 102, 204, 0.45);
    color: #ffffff;
}

/* --- FILTER STYLES --- */
.terminy-filter {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
}

.terminy-filter h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px 20px;
    align-items: end;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.filter-item label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.filter-item input[type="date"],
.filter-item input[type="text"],
.filter-item select {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: #ffffff;
    color: #333;
    box-sizing: border-box;
}

/* Pole wyboru zakresu dat (Flatpickr) — czytelny kursor i pełna szerokość alt-inputu. */
.filter-item--range input[type="text"] {
    cursor: pointer;
    background: #ffffff;
}

.filter-item--range .flatpickr-input {
    width: 100%;
}

.filter-item--actions {
    flex-direction: row;
    gap: 12px;
}

.filter-item--actions .btn-filter,
.filter-item--actions .btn-reset {
    flex: 1 1 0;
    height: 46px;
    padding: 0 18px;
    white-space: nowrap;
}

.btn-filter, .btn-reset {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-filter {
    background: #0066cc;
    color: #ffffff;
}

.btn-filter:hover {
    background: #0052a3;
    transform: translateY(-1px);
}

.btn-reset {
    background: #6c757d;
    color: #ffffff;
}

.btn-reset:hover {
    background: #5a6268;
}

.filter-info {
    margin-top: 15px;
    padding: 12px;
    background: #e7f3ff;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #0066cc;
}

/* --- SEKCJE MIESIĘCY --- */
.terminy-month {
    margin-bottom: 45px;
}

.terminy-month:last-child {
    margin-bottom: 0;
}

.terminy-month__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #0066cc;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid rgba(0, 102, 204, 0.18);
    text-transform: capitalize;
}

/* Checkbox „tylko dostępne” w filtrze */
.filter-item--check {
    flex-direction: row;
    align-items: center;
    min-height: 46px;
}

.filter-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0 !important;
}

.filter-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0066cc;
    cursor: pointer;
}

/* Komunikat pustego wyniku filtrowania */
.terminy-empty-filter {
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    color: #666;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

/* --- HOVER EFFECTS --- */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1200px) {
    .terminy-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 991px) {
    .zajecia-header {
        padding: 60px 0 70px;
        min-height: 350px;
    }
    
    .zajecia-header h1 {
        font-size: 38px;
    }
    
    .zajecia-header .subtitle {
        font-size: 16px;
    }
    
    .terminy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
    
    .termin-card {
        min-height: 300px;
    }
    
    .termin-title {
        font-size: 20px;
    }
    
    .filter-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .filter-item--actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 28px;
    }
    
    .zajecia-header {
        padding: 50px 0 60px;
        min-height: 300px;
        background-attachment: scroll;
    }
    
    .zajecia-header .container {
        bottom: 0;
    }
    
    .zajecia-header h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    .zajecia-header .subtitle {
        font-size: 15px;
        max-width: 90%;
    }
    
    .terminy-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .termin-card {
        min-height: 280px;
    }
    
    .termin-card-content {
        padding: 20px;
    }
    
    .termin-title {
        font-size: 19px;
        margin-bottom: 10px;
    }
    
    .termin-dates {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .termin-badges {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .price-badge {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .places-badge {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .btn-rezerwacja {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .termin-status-badge {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .zajecia-info-content {
        padding: 25px;
    }
    
    .zajecia-info li {
        font-size: 14px;
        padding: 10px 0 10px 30px;
    }
    
    .inquiry-form-wrapper {
        padding: 25px;
    }
    
    .terminy-filter {
        padding: 20px;
    }
    
    .terminy-filter h3 {
        font-size: 18px;
    }
    
    .filter-controls {
        grid-template-columns: 1fr;
    }
    
    .terminy-section {
        padding: 40px 0;
    }
    
    .zajecia-content,
    .zajecia-info {
        padding: 40px 0;
    }
}

@media (max-width: 480px) {
    .zajecia-header h1 {
        font-size: 26px;
    }
    
    .zajecia-header .subtitle {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .termin-card {
        min-height: 260px;
    }
    
    .termin-card-content {
        padding: 18px;
    }
    
    .termin-title {
        font-size: 17px;
    }
    
    .termin-dates {
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .termin-dates .date-separator {
        display: none;
    }
    
    .termin-badges {
        flex-direction: column;
        gap: 6px;
    }
    
    .price-badge,
    .places-badge {
        width: 100%;
        text-align: center;
    }
    
    .btn-rezerwacja {
        font-size: 12px;
        padding: 10px 15px;
    }
    
    .termin-card.sold-out::after {
        font-size: 32px;
    }
    
    .inquiry-form-wrapper {
        padding: 20px;
    }
    
    .terminy-filter {
        padding: 15px;
    }
}

/* --- LOADING ANIMATION --- */
.terminy-loading {
    text-align: center;
    padding: 60px 20px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
