/* =========================================
   1. STYLE BAZOWE
   ========================================= */
body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. SIDEBAR & MENU
   ========================================= */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    color: white;
    padding: 10px;
    z-index: 1000;
    cursor: pointer;
    border-radius: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
}

.sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background: #1a1a1a;
    transition: 0.3s;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    padding-top: 60px;
}

.sidebar.active {
    left: 0;
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid #333;
    transition: 0.2s;
}

.sidebar-nav a:hover {
    background: #333;
    color: #fff;
    padding-left: 25px;
}

/* =========================================
   3. SIATKA ZAWODNIKÓW (Full Screen + Fixy)
   ========================================= */

.team-section {
    width: 100%;
    /* Zwiększony padding po bokach (marginesy) */
    padding: 0 40px;
    box-sizing: border-box;
    margin-top: 60px;

    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);

    /* KLUCZOWE: To blokuje pojawianie się pasków przewijania przy animacji */
    overflow: hidden;
}

.page-title {
    text-align: center;
    font-size: 3rem;
    margin: 30px 0;
    /* Trochę więcej oddechu dla tytułu */
    text-transform: uppercase;
    letter-spacing: 5px;
    color: #fff;
    flex-shrink: 0;
}

.team-grid {
    display: flex;
    flex-wrap: nowrap;
    /* Większy odstęp między kartami (było 5px, jest 20px) */
    gap: 20px;
    width: 100%;
    max-width: 100%;

    flex-grow: 1;
    /* Margines od dołu, żeby karty nie dotykały krawędzi ekranu */
    margin-bottom: 40px;
    align-items: stretch;
}

/* Pojedynczy kafelek */
.player-card-mini {
    flex: 1;
    /* BARDZO WAŻNE: To naprawia problem z dużymi zdjęciami rozwalającymi układ */
    min-width: 0;

    background: #1a1a1a;
    border-radius: 15px;
    /* Ładniejsze, bardziej zaokrąglone rogi */
    overflow: hidden;
    cursor: pointer;
    /* Płynniejsza animacja flexa */
    transition: flex 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid #333;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Efekt HOVER */
.player-card-mini:hover {
    flex: 2.5;
    /* Mocniejsze rozepchanie aktywnej karty */
    background: #222;
    border-color: #4CAF50;
    z-index: 10;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.2);
    /* Delikatna poświata */
}

/* Zdjęcie w kafelku */
.player-card-mini img {
    width: 100%;
    height: 100%;
    display: block;
    /* Usuwa "magic space" pod zdjęciem */
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: grayscale(100%) brightness(0.6);
    /* Mocniejszy kontrast spoczynkowy */
}

.player-card-mini:hover img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
}

.mini-info {
    padding: 20px 10px;
    text-align: center;
    position: absolute;
    bottom: 0;
    width: 100%;
    /* Gradient, żeby tekst był czytelny na każdym tle */
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.4) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-info h3 {
    margin: 0;
    font-size: 1.8rem;
    /* Duży, czytelny nick */
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 1);
}

.mini-info span {
    color: #4CAF50;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- RESPONSYWNOŚĆ --- */
/* Poniżej 1024px wracamy do układu kafelkowego, bo pionowe pasy są niewygodne */

@media (max-width: 1024px) {
    .team-section {
        height: auto;
        padding: 0 20px;
        overflow-y: auto;
        /* Tu pozwalamy na scroll */
    }

    .team-grid {
        flex-wrap: wrap;
        height: auto;
        gap: 20px;
        margin-bottom: 20px;
    }

    .player-card-mini {
        flex: 0 0 45%;
        height: 400px;
        /* Stała wysokość na tablecie */
    }

    .player-card-mini:hover {
        flex: 0 0 45%;
        /* Wyłączamy rozpychanie */
        transform: translateY(-5px);
        /* Tylko lekkie uniesienie */
    }
}

@media (max-width: 600px) {
    .player-card-mini {
        flex: 0 0 100%;
        height: 350px;
    }
}

/* =========================================
   4. MODAL (POPUP) - KOMPLETNY KOD
   ========================================= */

/* --- 1. MECHANIKA OKNA (To zniknęło, a jest niezbędne) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    /* Domyślnie ukryte */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    /* Po kliknięciu się pokazuje */
    opacity: 1;
}

.modal-content {
    background: #181818;
    width: 90%;
    max-width: 1000px;
    /* Szerokie okno dla nowych statystyk */
    border-radius: 15px;
    border: 1px solid #444;
    padding: 30px;
    position: relative;
    transform: translateY(50px);
    transition: transform 0.3s ease;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    max-height: 95vh;
    /* Żeby nie uciekło poza ekran */
    overflow-y: auto;
    /* Scrollowanie jak się nie mieści */
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover {
    color: #ff4444;
}

/* Układ wewnątrz modala (Lewo: Foto, Prawo: Info) */
.modal-body {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

/* Lewa strona - Zdjęcie */
.modal-left {
    flex-shrink: 0;
}

.modal-left img {
    width: 300px;
    /* Trochę szersze dla lepszego efektu */
    height: 450px;
    object-fit: cover;
    object-position: top center;
    border-radius: 10px;
    border: 2px solid #333;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* --- 2. NOWY DESIGN WNĘTRZA (To co chciałeś ostatnio) --- */

.modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Rozciągamy treść */
    padding: 10px 0;
}

/* Nagłówek */
.modal-header-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.modal-right h2 {
    font-size: 3.5rem;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #000;
}

.badge {
    display: inline-block;
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

/* Powiększony opis */
.modal-desc {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #ddd;
    font-style: italic;
    margin-bottom: 30px;
    border-left: 4px solid #4CAF50;
    padding-left: 20px;
    flex-grow: 1;
}

/* --- KONTENER STATYSTYK --- */
.modal-stats-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #121212;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #333;
}

/* SEKCJA 1: Rating Cluster */
.stats-primary {
    display: flex;
    gap: 15px;
    height: 140px;
}

.big-rating-box {
    flex: 1.5;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    border: 1px solid #444;
}

.stat-value-big {
    font-size: 4rem;
    color: #f1c40f;
    /* Złoty */
    line-height: 1;
    text-shadow: 0 4px 10px rgba(241, 196, 15, 0.3);
}

.rating-split {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.small-box {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #333;
}

.t-side strong {
    color: #e74c3c;
    font-size: 1.4rem;
}

/* Czerwony */
.ct-side strong {
    color: #3498db;
    font-size: 1.4rem;
}

/* Niebieski */

/* SEKCJA 2: Reszta statystyk */
.stats-secondary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stats-secondary .stat-box {
    background: #1e1e1e;
    padding: 15px 10px;
    border-radius: 8px;
    border: 1px solid #333;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stats-secondary strong {
    font-size: 1.8rem;
    color: #fff;
}

/* VIDEO SECTION */
.modal-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    margin-top: 20px;
}

.modal-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* RESPONSYWNOŚĆ MODALA */
@media (max-width: 900px) {
    .modal-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .modal-desc {
        border-left: none;
        padding-left: 0;
        border-top: 3px solid #4CAF50;
        padding-top: 15px;
    }

    .stats-primary {
        flex-direction: column;
        height: auto;
    }

    .big-rating-box {
        padding: 20px 0;
    }

    .rating-split {
        height: 160px;
        /* Miejsce na dwa klocki T/CT */
    }
}