/* ==========================================================================
   1. GLOBAL & LAYOUT
   ========================================================================== */
html { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; }
main.page-content-wrapper { flex: 1 0 auto; padding-top: 5rem; }

/* Przeźroczysta stopka na profilu publicznym */
.profile-footer-wrapper, 
.profile-footer-wrapper footer.main-footer, 
.profile-footer-wrapper .main-footer .footer-content { 
    background: transparent !important; 
    border: none !important; 
    box-shadow: none !important; 
}
.profile-footer-wrapper p, .profile-footer-wrapper a, 
.profile-footer-wrapper footer.main-footer p, 
.profile-footer-wrapper footer.main-footer a { 
    color: var(--text-color) !important; 
}
.profile-footer-wrapper a:hover { opacity: 0.8; }

/* ==========================================================================
   2. HERO SECTION & DASHBOARD LAYOUT
   ========================================================================== */
.profile-header-bg { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit; 
    z-index: 0;
}
/* Creates a smooth gradient fade to ensure stats & text stay readable */
.profile-header-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(var(--frame-color-rgb), 0.15) 0%, rgba(var(--frame-color-rgb), 0.95) 100%);
    z-index: 1;
    border-radius: inherit;
}

.profile-header-content { 
    position: relative; border-radius: 20px; padding: 1.5rem; 
    margin-bottom: 1.5rem; margin-top: 1rem;
    background-color: rgba(255, 255, 255, 0.85) !important; 
    border: 1px solid rgba(255, 255, 255, 0.5) !important; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.08) !important;
}

.profile-avatar,
.initials-placeholder.profile-avatar { 
    width: 182px !important; 
    height: 182px !important; 
    border-radius: 50% !important; 
    object-fit: cover !important; 
    border: 5px solid var(--inner-frame-color, #ffffff) !important; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important; 
    background-color: var(--inner-frame-color, #ffffff); /* Removed !important so PHP colors work */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 3.5rem !important;
    color: #ffffff !important; 
}

/* Nowy Układ Grid: 3 Kolumny (Info, Przedmioty, Statystyki) */
.hero-dashboard-wrapper { 
    display: block !important; 
    width: 100% !important; 
    position: relative;
    z-index: 2;
    padding-top: 180px !important; /* Replaces the physical gap of the old banner */
}
.hero-info-grid { 
    display: grid; 
    /* minmax(0, ...) is the magic trick that stops Grid columns from blowing out horizontally */
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1.1fr); 
    gap: 1.5rem; 
    align-items: stretch; 
    width: 100%; 
}
.hero-info-left { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.hero-info-middle { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; /* Zmienia ułożenie na środek pionowo */
    height: 100%; 
    margin-top: -90px; /* Podciąga kolumnę do góry, na obszar tła */
}
.hero-info-right { display: flex; flex-direction: column; width: 100%; justify-content: flex-end; align-items: flex-end; height: 100%; }

/* Ensure the button never gets squashed vertically */
.hero-action-btns button { flex-shrink: 0; }
/* Wymusza siatkę 2x2 dla statystyk, dopasowaną szerokością do prawej strony */
/* Bezwzględnie wymusza układ 2x2 dla statystyk niezależnie od szerokości ekranu */
.hero-stats-container { 
    display: grid !important; 
    grid-template-columns: 1fr 1fr !important; /* STRICTLY 2 columns */
    gap: 10px !important; 
    justify-content: end !important; 
    width: 100% !important; 
    max-width: 240px; /* Limits width so it forms a neat square */
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Kontener na długą listę przedmiotów (pełna wysokość) */
.subjects-scroller {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
    align-items: center;
    width: 100%;
}

/* Statystyki Box Styling */
.hero-stat-box { 
    background: rgba(255, 255, 255, 0.7) !important; backdrop-filter: blur(5px) !important; border: 1px solid rgba(255, 255, 255, 0.8) !important; 
    border-radius: 12px !important; padding: 10px 15px !important; box-shadow: 0 4px 10px rgba(0,0,0,0.04) !important; 
    text-align: center !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; 
    /* Remove flex sizing to allow CSS Grid to control width completely */
    width: 100% !important; height: 100% !important;
}
.hero-stat-number { font-size: 1.5rem !important; font-weight: 800 !important; line-height: 1 !important; margin-bottom: 4px !important; }
.hero-stat-label { font-size: 0.75rem !important; text-transform: uppercase !important; font-weight: 700 !important; color: var(--text-color) !important; opacity: 0.8 !important; }

/* Przyciski Akcji */
.hero-action-btns { display: flex !important; gap: 10px !important; margin-top: 15px !important; flex-wrap: wrap !important; }
.hero-btn { background: #ffffff !important; color: #333333 !important; border: 1px solid #dddddd !important; padding: 6px 18px !important; border-radius: 50px !important; font-weight: 700 !important; font-size: 0.85rem !important; display: inline-flex !important; align-items: center !important; gap: 6px !important; cursor: pointer !important; box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important; text-decoration: none !important; transition: all 0.2s ease !important; }
.hero-btn:hover { background: #f8f9fa !important; transform: translateY(-2px) !important; box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important; }
.hero-btn.text-danger { color: #dc3545 !important; }
.hero-btn.text-primary { color: #0d6efd !important; }

/* Przedmioty */
.profile-subjects { display: flex !important; flex-wrap: wrap !important; gap: 0.8rem !important; margin-top: 2rem !important; justify-content: center !important; width: 100% !important; }
.subject-badge { 
    display: flex !important; 
    width: 100% !important; 
    align-items: center !important; 
    justify-content: flex-start !important; 
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word !important;
    font-size: 1.15rem !important; 
    font-weight: 800 !important; 
    padding: 0.6rem 1.5rem !important; 
    border-radius: 12px !important; 
    background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.2)) !important; 
    color: var(--text-color) !important; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important; 
    border: 1px solid rgba(255,255,255,0.6) !important; 
}

@media (max-width: 992px) {
    .hero-dashboard-wrapper { padding-top: 140px !important; }
    
    .profile-avatar,
    .initials-placeholder.profile-avatar { 
        width: 150px !important; 
        height: 150px !important; 
        font-size: 3rem !important; 
    }
    
    .hero-avatar-container { margin-top: -75px !important; }
    .hero-info-grid { grid-template-columns: 1fr; gap: 1.5rem; align-items: center; }
    
    .hero-info-left { justify-content: flex-start !important; }
    
.hero-info-left, .hero-info-middle, .hero-info-right { align-items: center !important; text-align: center !important; width: 100%; }
        .hero-info-middle { margin-top: 0 !important; } /* Resetuje pozycję na telefonach */
        .hero-info-left .text-start { text-align: center !important; }
        .hero-action-btns { justify-content: center !important; width: 100%; }
    .hero-stats-container { justify-content: center !important; margin: 0 auto !important; max-width: 400px; }
}
@media (max-width: 576px) {
    /* Wymusza idealną siatkę 2x2 dla statystyk na telefonach */
    .hero-stat-box { flex: 0 0 calc(50% - 5px) !important; min-width: 0 !important; }
}

/* ==========================================================================
   3. STICKY GLASS TABS NAVIGATION
   ========================================================================== */
ul.glass-tabs {
    list-style: none !important; margin: 0 0 1.5rem 0 !important;
    display: grid !important; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px !important; border: none !important; 
    position: sticky !important;
    top: 75px !important; /* Domyślny offset na Desktop */
    z-index: 1020 !important;
    background-color: var(--frame-color) !important; 
    backdrop-filter: blur(20px) !important; -webkit-backdrop-filter: blur(20px) !important;
    padding: 10px !important; border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

ul.glass-tabs li.nav-item { display: block !important; width: 100%; margin: 0 !important; padding: 0 !important; }

.glass-tab-btn {
    background: rgba(255, 255, 255, 0.6) !important; 
    backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important;
    color: #495057 !important; border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 14px !important; padding: 0.8rem 0.5rem !important; 
    font-weight: 600 !important; font-size: 0.9rem !important; display: flex !important;
    flex-direction: column !important; align-items: center !important; justify-content: center !important;
    gap: 6px !important; width: 100%; height: 100%; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03), inset 0 1px 1px rgba(255,255,255,0.6) !important;
    position: relative; overflow: hidden; cursor: pointer;
}
.glass-tab-btn::before { content: ''; position: absolute; top: 0; left: -150%; width: 50%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.9), transparent); transform: skewX(-25deg); transition: all 0.6s ease; z-index: 0; display: block !important; }
.glass-tab-btn:hover::before { left: 150%; }
.glass-tab-btn i, .glass-tab-btn span { position: relative; z-index: 1; pointer-events: none; }
.glass-tab-btn i { font-size: 1.6rem !important; margin: 0 !important; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s !important; }
.glass-tab-btn:hover { border-color: rgba(13, 110, 253, 0.2) !important; background: rgba(255, 255, 255, 0.9) !important; transform: translateY(-3px) !important; box-shadow: 0 10px 20px rgba(0,0,0,0.06), inset 0 1px 1px rgba(255,255,255,1) !important; }
.glass-tab-btn:hover i { transform: scale(1.1) rotate(5deg) !important; }
.glass-tab-btn.active { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05), inset 0 2px 5px rgba(255, 255, 255, 0.5) !important; transform: translateY(-2px) !important; }
.glass-tab-btn.active i { animation: iconPopBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important; }

@keyframes iconPopBounce { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1.1); } }

/* Dynamic Active Colors */
#tab-info-btn.active { background: linear-gradient(135deg, rgba(204, 229, 255, 0.8), rgba(184, 218, 255, 0.8)) !important; border-color: rgba(13, 110, 253, 0.4) !important; color: #004085 !important; }
#tab-info-btn.active i { color: #004085 !important; }
#tab-ai-btn.active { background: linear-gradient(135deg, rgba(233, 213, 255, 0.8), rgba(216, 180, 254, 0.8)) !important; border-color: rgba(168, 85, 247, 0.4) !important; color: #6b21a8 !important; }
#tab-ai-btn.active i { color: #6b21a8 !important; }
#tab-posts-btn.active { background: linear-gradient(135deg, rgba(235, 214, 255, 0.8), rgba(220, 189, 255, 0.8)) !important; border-color: rgba(111, 66, 193, 0.4) !important; color: #431482 !important; }
#tab-posts-btn.active i { color: #431482 !important; }
#tab-content-btn.active { background: linear-gradient(135deg, rgba(212, 237, 218, 0.8), rgba(195, 230, 203, 0.8)) !important; border-color: rgba(40, 167, 69, 0.4) !important; color: #155724 !important; }
#tab-content-btn.active i { color: #155724 !important; }
#tab-offerings-btn.active { background: linear-gradient(135deg, rgba(255, 243, 205, 0.8), rgba(255, 235, 168, 0.8)) !important; border-color: rgba(255, 193, 7, 0.4) !important; color: #856404 !important; }
#tab-offerings-btn.active i { color: #856404 !important; }
#tab-media-btn.active { background: linear-gradient(135deg, rgba(209, 247, 255, 0.8), rgba(181, 238, 255, 0.8)) !important; border-color: rgba(13, 202, 240, 0.4) !important; color: #0c5460 !important; }
#tab-media-btn.active i { color: #0c5460 !important; }

/* MOBILE: TABS (Sticks to the very top, no radius when sticky) */
@media (max-width: 992px) {
    ul.glass-tabs {
        top: 60px !important; /* Domyślnie dla gości z paskiem menu na górze */
    }
    
    /* Dla zalogowanych na telefonach pasek jest na dole, więc zakładki kleją się do samego sufitu! */
    body.student-mobile-view ul.glass-tabs,
    body.teacher-mobile-view ul.glass-tabs {
        top: 0px !important;
        border-top-left-radius: 0 !important; 
        border-top-right-radius: 0 !important; 
        z-index: 990 !important; /* Zmieniono z 1050, aby nie przykrywać elementów menu */
    }
}

@media (max-width: 768px) {
    ul.glass-tabs {
        display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; overflow: visible !important; 
        justify-content: space-between !important; padding: 6px !important; gap: 4px !important; 
    }
    .glass-tab-btn { padding: 0.6rem 0 !important; min-width: 0 !important; flex: 1 1 0px !important; border-radius: 12px !important; }
    .glass-tab-btn span { display: none !important; }
    .glass-tab-btn i { font-size: 1.3rem !important; margin: 0 !important; }
}

/* ==========================================================================
   4. CONTENT & COMPONENTS
   ========================================================================== */
.custom-tab-content-wrapper {
    background-color: var(--frame-color, rgba(255, 255, 255, 0.65)) !important; 
    backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important; border-radius: 20px; padding: 2rem; box-shadow: 0 10px 40px rgba(0,0,0,0.08); margin-bottom: 2rem; min-height: 400px; 
    scroll-margin-top: 150px; /* Zostawia miejsce na przyklejone zakładki */
    display: flex; flex-direction: column; /* Umożliwia rozciągnięcie zakładek do 400px */
}
@media (max-width: 768px) { 
    .custom-tab-content-wrapper { padding: 1rem; border-radius: 15px; scroll-margin-top: 100px; } 
}

.custom-tab-pane { 
    display: none; opacity: 0; 
    scroll-margin-top: 150px; /* Offset dla zjeżdżania przyciskiem */
    flex-grow: 1; /* Zakładka wypełnia całą przestrzeń rodzica */
}
@media (max-width: 992px) { 
    .custom-tab-pane { scroll-margin-top: 100px; } 
}
.custom-tab-pane.active { display: flex; flex-direction: column; animation: paneFadeIn 0.4s ease forwards; }
@keyframes paneFadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   TEACHER FEED POSTS
   ========================================= */
.teacher-feed-container { max-width: 900px; margin: 0 auto; padding: 0; }
#feed-posts-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { #feed-posts-list { grid-template-columns: 1fr; } }

.feed-post { 
    background-color: var(--inner-frame-color, #ffffff); border: 1px solid rgba(255,255,255,0.2); border-radius: 16px; text-align: left; box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    display: flex; flex-direction: column; min-width: 0; width: 100%; overflow: visible !important; margin-bottom: 1.5rem; position: relative;
}
.feed-post-header { display: flex; align-items: center; padding: 1rem; position: relative; border-bottom: 1px solid rgba(128,128,128,0.1); }
.feed-post-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; margin-right: 12px; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.5); }
.feed-post-info { display: flex; flex-direction: column; min-width: 0; }
.feed-post-author { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-post-date { font-size: 0.75rem; opacity: 0.7; }

.feed-post-text-wrapper { padding-bottom: 0.5rem; }
.feed-post-text { line-height: 1.6; padding: 1rem; overflow-wrap: break-word; font-size: 0.95rem; }
.feed-post-text.collapsed { max-height: 120px; overflow: hidden; position: relative; padding-bottom: 0; }
.feed-post-text.collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(to top, var(--inner-frame-color, white), transparent); }
.read-more-link { display: none; padding: 0 1rem 0.5rem 1rem; color: #0d6efd; font-weight: 600; cursor: pointer; text-decoration: none; }
.read-more-link:hover { text-decoration: underline; }

.feed-post-media { margin-top: 0; border-top: 1px solid rgba(128,128,128,0.1); width: 100%; background-color: rgba(0,0,0,0.05); }
.feed-post-media img { width: 100%; height: auto; display: block; max-height: 400px; object-fit: contain; }
.feed-post-media .video-container { margin-top: 0; border-radius: 0; }

.feed-content-preview { display: block; text-decoration: none; border-radius: 12px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; margin: 0 1rem 1rem 1rem; }
.feed-content-preview:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.feed-preview-image { min-height: 180px !important; width: 100%; display: block; background-size: cover; background-position: center; position: relative; }
.feed-preview-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.2); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.feed-content-preview:hover .feed-preview-overlay { opacity: 1; }
.feed-preview-overlay i { font-size: 3rem; color: white; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
.feed-content-info { padding: 12px 16px; }
.feed-content-meta { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; opacity: 0.7; margin-bottom: 6px; text-transform: uppercase; font-weight: 600; }
.feed-content-type { padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; letter-spacing: 0.5px; }
.type-lesson { background-color: rgba(29, 78, 216, 0.1); color: #1d4ed8; border: 1px solid rgba(29, 78, 216, 0.2); }
.type-flashcard { background-color: rgba(21, 128, 61, 0.1); color: #15803d; border: 1px solid rgba(21, 128, 61, 0.2); }
.feed-content-title { font-size: 1.05rem; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Feed Menu */
.feed-post-menu { position: absolute; top: 1rem; right: 1rem; }
.feed-post-menu-btn { background: none; border: none; cursor: pointer; padding: 0.25rem; border-radius: 50%; opacity: 0.5; transition: opacity 0.2s; color: inherit; }
.feed-post-menu-btn:hover { opacity: 1; background-color: rgba(128,128,128,0.1); }
.feed-post-dropdown { display: none; position: absolute; right: 0; top: 100%; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border: 1px solid #e5e7eb; z-index: 1050 !important; width: 140px; overflow: hidden; }
.feed-post-dropdown a { display: block; padding: 0.6rem 1rem; font-size: 0.9rem; color: #374151; text-decoration: none; }
.feed-post-dropdown a:hover { background-color: #f9fafb; }

#load-more-posts-btn { display: block; width: 100%; max-width: 300px; margin: 2rem auto; padding: 0.75rem 1rem; background-color: #0d6efd; color: white; border: none; border-radius: 25px; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
#load-more-posts-btn:hover { background-color: #0b5ed7; }

/* ==========================================================================
   5. GALLERY, VIDEO, AND OFFERINGS SLIDERS
   ========================================================================== */
.video-container { position: relative; overflow: hidden; width: 100%; contain: strict; aspect-ratio: 16 / 9; padding-top: 0 !important; transform: translateZ(0); border-radius: 1.5rem !important; background-color: #000; }
.video-container iframe { position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%; }

.gallery-container { position: relative; padding-bottom: 30px; max-width: 100%; overflow: hidden; }
.swiper-container { width: 100%; max-width: 100%; height: 250px; border-radius: 1.5rem !important; overflow: hidden !important; background: transparent; }
.swiper-slide { text-align: center; font-size: 18px; display: flex; justify-content: center; align-items: center; }
.gallery-slider img { border-radius: 1.5rem !important; display: block; width: 100%; height: 100%; object-fit: cover !important; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.gallery-container .swiper-button-next, .gallery-container .swiper-button-prev { color: #333; transition: all 0.2s; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; margin-top: -15px; background-color: rgba(255, 255, 255, 0); border-radius: 50%; }
.gallery-container .swiper-button-next::after, .gallery-container .swiper-button-prev::after { font-size: 16px; font-weight: bold; }
.gallery-container .swiper-button-prev { left: 10px; }
.gallery-container .swiper-button-next { right: 10px; }
@media (min-width: 768px) { 
    .gallery-container .swiper-button-next { right: -40px; background-color: transparent; width: 44px; height: 44px; margin-top: -22px; } 
    .gallery-container .swiper-button-prev { left: -40px; background-color: transparent; width: 44px; height: 44px; margin-top: -22px; } 
    .gallery-container .swiper-button-next::after, .gallery-container .swiper-button-prev::after { font-size: 44px; }
}

/* Modale Galerii */
.modal-fullscreen-gallery { display: none; position: fixed; z-index: 1055; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.9); }
.modal-content-gallery { margin: auto; display: block; max-width: 90%; max-height: 90%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(1); transition: transform 0.3s ease; }
.modal-content-gallery.zoomed { transform: translate(-50%, -50%) scale(1.5); cursor: zoom-out; }
.close-gallery, .zoom-gallery { position: absolute; top: 15px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.close-gallery { right: 35px; } .zoom-gallery { right: 90px; }
.close-gallery:hover, .zoom-gallery:hover { color: #bbb; text-decoration: none; }
.gallery-container .swiper-pagination { position: absolute; bottom: 8px; left: 0; width: 100%; text-align: center; }
.gallery-container .swiper-pagination-bullet { background: rgba(0,0,0,0.4); opacity: 1; transition: background-color 0.2s; }
.gallery-container .swiper-pagination-bullet-active { background: #333; }

/* Offerings Slider */
.offerings-slider-container { width: 100%; position: relative; padding: 0; margin: 0 auto; height: 100%; display: flex; flex-direction: column; flex-grow: 1; }
.offerings-slider.swiper { padding: 0 !important; overflow: hidden !important; flex-grow: 1; width: 100%; display: flex; } 
.offerings-slider .swiper-slide { height: auto; display: flex; }

.offering-card { 
    background-color: color-mix(in srgb, var(--inner-frame-color) 65%, transparent) !important; 
    border: 1px solid rgba(255, 255, 255, 0.15); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 1.5rem; padding: 1.5rem; display: flex; flex-direction: column; text-align: left; 
    width: 100%; height: 100%; position: relative; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); color: inherit; min-height: 320px;
}
.offering-card h4 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.4rem; color: inherit !important; flex-shrink: 0; }
.offering-price { font-size: 1.5rem; font-weight: 800; color: inherit !important; margin-bottom: 0.6rem; flex-shrink: 0; }
.offering-price .currency { font-size: 0.85rem; font-weight: 600; opacity: 0.7; }
.offering-description-wrapper { flex-grow: 1; overflow-y: auto; min-height: 0; scrollbar-width: none; -ms-overflow-style: none; }
.offering-description { font-size: 0.85rem; color: inherit !important; opacity: 0.85; margin: 0; padding: 0; overflow-wrap: break-word; }
.offering-description-wrapper::-webkit-scrollbar { display: none; }

.offering-icon-cluster { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(128, 128, 128, 0.15); display: flex; justify-content: center; align-items: center; gap: 0.75rem; width: 100%; }
.offering-signup-btn { flex-grow: 1; background-color: var(--btn-bg, #007bff); color: var(--btn-text, #ffffff) !important; text-align: center; padding: 0.6rem 1rem; border-radius: 20px; font-weight: 700; font-size: 0.9rem; text-decoration: none; transition: all 0.2s; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.offering-signup-btn:hover { transform: translateY(-2px); filter: brightness(110%); box-shadow: 0 6px 15px rgba(0,0,0,0.15); }
.offering-contact-icon { width: 40px; height: 40px; flex-shrink: 0; background-color: rgba(128, 128, 128, 0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: all 0.2s; color: inherit !important; }
.offering-contact-icon:hover { background-color: rgba(128, 128, 128, 0.3); transform: scale(1.05); }
.offering-contact-icon svg { width: 18px; height: 18px; fill: currentColor; }

.offerings-slider-container .swiper-button-next, .offerings-slider-container .swiper-button-prev { 
    background-color: var(--inner-frame-color) !important; border: 1px solid rgba(128, 128, 128, 0.2); box-shadow: 0 4px 12px rgba(0,0,0,0.15); color: inherit !important; 
    top: 50%; transform: translateY(-50%); width: 44px !important; height: 44px !important; margin-top: 0 !important; border-radius: 50% !important;
}
.offerings-slider-container .swiper-button-next::after, .offerings-slider-container .swiper-button-prev::after { font-size: 1.2rem !important; font-weight: 900 !important; }
.offerings-slider-container .swiper-button-prev { left: -15px !important; }
.offerings-slider-container .swiper-button-next { right: -15px !important; }
.offerings-slider-container .swiper-pagination { bottom: -1.5rem !important; } 
.offerings-slider-container .swiper-pagination-bullet { background: rgba(128,128,128,0.5); opacity: 1; }
.offerings-slider-container .swiper-pagination-bullet-active { background: var(--text-color); }

/* MOBILE: Zewnętrzne strzałki, wąski slider */
@media (max-width: 768px) {
    .offerings-slider-container { width: 100% !important; padding: 0 !important; height: auto !important; }
    .offerings-slider.swiper { padding: 0 35px !important; overflow: hidden !important; border-radius: 0 !important; margin: 0 !important; } 
    .offerings-slider-container .swiper-button-next, .offerings-slider-container .swiper-button-prev { 
        display: flex !important; width: 35px !important; height: 40px !important; 
        background: transparent !important; border: none !important; box-shadow: none !important; 
    }
    .offerings-slider-container .swiper-button-prev { left: 0px !important; justify-content: center !important; }
    .offerings-slider-container .swiper-button-next { right: 0px !important; justify-content: center !important; }
    .offerings-slider-container .swiper-button-next::after, .offerings-slider-container .swiper-button-prev::after { 
        font-size: 1.5rem !important; text-shadow: 0 2px 5px rgba(0,0,0,0.5); color: #ffffff !important;
    }
    .offerings-slider-container .swiper-pagination { bottom: -1rem !important; }
}
@media (min-width: 768px) {
    .offerings-slider .swiper-wrapper { 
        display: grid; 
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Automatycznie i proporcjonalnie układa kafelki */
        gap: 1.5rem; 
        height: 100%; 
        transform: none !important; 
        width: 100% !important; 
        align-items: stretch; /* Karty rozciągną się z góry na sam dół */
    }
    .offerings-slider .swiper-slide { width: auto !important; height: auto !important; }
    .offerings-slider-container .swiper-button-next, .offerings-slider-container .swiper-button-prev, .offerings-slider-container .swiper-pagination { display: none !important; }
}

/* ==========================================================================
   6. GRID TILES (LESSONS / FLASHCARDS)
   ========================================================================== */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.content-tile { border-radius: 10px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: inherit; display: flex; flex-direction: column; background: #fff; }
.content-tile:hover { transform: translateY(-5px); }
.content-tile-img-wrapper { position: relative; height: 150px; background-color: #e9ecef; overflow: hidden; }
.content-tile-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.content-tile:hover .content-tile-img { transform: scale(1.05); }
.play-button-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; text-decoration: none; opacity: 0; transition: opacity 0.3s ease, background-color 0.3s ease; }
.content-tile:hover .play-button-overlay { opacity: 1; background: rgba(0, 0, 0, 0.6); }
.play-button-overlay svg { width: 48px; height: 48px; margin-bottom: 0.5rem; }
.content-tile-body { padding: 1rem; flex-grow: 1; display: flex; flex-direction: column; }
.content-tile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.content-type-badge { display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 500; padding: 0.25rem 0.6rem; border-radius: 12px; }
.content-type-badge svg { width: 14px; height: 14px; }
.content-lesson-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-left: auto; padding-left: 0.5rem; justify-content: flex-end; }
.lesson-tag { font-size: 0.75rem; font-weight: 500; padding: 0.2rem 0.5rem; border-radius: 10px; }
.tag-grammar { background-color: #e0e7ff; color: #4338ca; }
.tag-video { background-color: #ffe4e6; color: #be123c; }
.tag-thematic { background-color: #d1fae5; color: #065f46; }
.content-tile-meta-wrapper { font-size: 0.8rem; opacity: 0.7; margin-bottom: 0.25rem; font-weight: 500; display: flex; align-items: center; }
.meta-separator { margin: 0 0.4rem; opacity: 0.5; }
.content-tile-title { font-weight: bold; margin-bottom: 0.25rem; font-size: 1.1rem; line-height: 1.3; overflow-wrap: break-word; }
.content-tile-skills { font-size: 0.8rem; opacity: 0.8; margin-top: auto; padding-top: 0.5rem; }
.badge-lesson { background-color: #e7f3ff; color: #0056b3; }
.badge-flashcard { background-color: #e9f7ef; color: #155724; }

/* SIGNUP BUTTON */
.signup-button-container { padding: 1.5rem 2rem 0.5rem 2rem; border-top: 1px solid rgba(0, 0, 0, 0.1); margin-top: 2rem; }
.signup-button-large { display: block; width: 100%; padding: 1rem; text-align: center; font-size: 1.1rem; font-weight: 600; text-decoration: none; border-radius: 10px; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); background-color: var(--btn-bg); color: var(--btn-text); }
.signup-button-large:hover { filter: brightness(90%); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); transform: translateY(-2px); }

/* AI BADGES & ALERTS */
.ai-badge { background: linear-gradient(135deg, #6e8efb, #a777e3); color: white; font-size: 0.75rem; padding: 0.4em 0.8em; border-radius: 20px; box-shadow: 0 2px 5px rgba(110, 142, 251, 0.3); display: inline-flex; align-items: center; gap: 5px; }
.alert { position: relative; padding: 1rem 1.25rem; margin-bottom: 1.5rem; border: 1px solid transparent; border-radius: 8px; font-size: 0.95rem; line-height: 1.5; text-align: left; }
.alert-danger { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; border-left: 5px solid #dc3545; }
.alert-warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; border-left: 5px solid #ffc107; }

/* MODALS */
/* Wymusza wyświetlanie wszystkich okien modalnych PONAD przyklejonymi zakładkami (które mają z-index: 1050) */
.modal-overlay, .modal, .modal-backdrop, .custom-modal-backdrop {
    z-index: 999999 !important;
}

.glass-modal-backdrop { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 999999; display: none; align-items: center; justify-content: center; background-color: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); margin: 0 !important; }
.glass-modal-content { background: #ffffff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); border-radius: 24px; width: 90%; max-width: 450px; position: relative; overflow: hidden; animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); display: flex; flex-direction: column; }
.glass-modal-header { padding: 25px 30px 10px 30px; text-align: center; background: linear-gradient(to bottom, #ffffff, #fcfcfc); }
.glass-modal-body { padding: 10px 30px 30px 30px; display: flex; flex-direction: column; }
.glass-textarea { background: #f9fafb; border: 2px solid #f3f4f6; border-radius: 12px; padding: 15px; width: 100%; resize: none; font-family: inherit; font-size: 0.95rem; transition: all 0.2s; }
.btn-glass-submit-danger { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; border: none; width: 100%; padding: 12px; border-radius: 12px; font-weight: 600; margin-top: 15px; cursor: pointer; transition: transform 0.2s; }
.btn-glass-submit-danger:hover { transform: translateY(-1px); opacity: 0.9; }
.btn-close-glass { background: transparent; border: none; color: #9ca3af; width: 100%; padding: 10px; margin-top: 5px; cursor: pointer; font-size: 0.9rem; }
@keyframes modalPop { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ==========================================================================
   7. MOBILE LOGGED-IN VIEW FIXES (Top Padding & Cover Radius)
   ========================================================================== */
@media (max-width: 992px) {
    /* Usuwa padding od góry dla zalogowanych na urządzeniach mobilnych */
    body.student-mobile-view main.page-content-wrapper,
    body.teacher-mobile-view main.page-content-wrapper {
        padding-top: 0 !important;
    }
    
    /* Usuwa górny margines głównego kontenera profilu */
    body.student-mobile-view main.page-content-wrapper .container,
    body.teacher-mobile-view main.page-content-wrapper .container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

/* Zaokrąglone wszystkie kąty tła również na urządzeniach mobilnych */
    body.student-mobile-view .profile-header-bg,
    body.teacher-mobile-view .profile-header-bg {
        border-radius: 1rem !important;
    }
}