/* =========================================================
   WARSTWA ZGODNOŚCI DLA JESZCZE NIEPRZEROBIONYCH PODSTRON
   Stare strony często ładują wyłącznie style.css.
========================================================= */
@import url("/assets/css/components.css");
@import url("/assets/css/forms.css");
@import url("/assets/css/buttons.css");
@import url("/assets/css/header.css");
@import url("/assets/css/footer.css");

/* --- WŁASNY PASEK PRZEWIJANIA (SCROLLBAR) --- */
::-webkit-scrollbar {
    width: 12px;  /* Szerokość paska pionowego */
    height: 12px; /* Wysokość paska poziomego (np. w tabelach) */
}

::-webkit-scrollbar-track {
    background: #121212; /* Ciemne tło pod suwakiem */
}

::-webkit-scrollbar-thumb {
    background: #333; /* Kolor samego suwaka */
    border-radius: 6px; /* Zaokrąglone rogi */
    border: 3px solid #121212; /* Odstęp od krawędzi (żeby suwak nie był na całą szerokość) */
}

::-webkit-scrollbar-thumb:hover {
    background: #39ff14; /* Neonowy zielony po najechaniu myszką! */
}

/* =========================================
   1. ZMIENNE KOLORÓW (DOMYŚLNY DARK MODE)
========================================= */
:root {
    --primary-color: #28a745;
    --primary-hover: #218838;
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #0a0a0a;
    --header-text: #fff;
    --panel-bg: #1e1e1e;
    --border-color: #333;
    --footer-bg: #0a0a0a;
    --footer-text: #888;
    --input-bg: #2d2d2d;
}

/* =========================================
   2. STYLE GLOBALNE
========================================= */
body { 
    margin: 0; padding: 0; font-family: Arial, sans-serif; 
    display: flex; flex-direction: column; min-height: 100vh; 
    background-color: var(--bg-color); color: var(--text-color);
}

.container { 
    max-width: 800px; width: 90%; margin: 40px auto; background: var(--panel-bg); 
    color: var(--text-color); padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
    border: 1px solid var(--border-color); box-sizing: border-box;
}

form .password-container, form { max-width: 100%; }

body:not(.seo-home):not(.dashboard-page) h1,
body:not(.seo-home):not(.dashboard-page) h2 {
    text-align: center;
    margin-top: 0;
    color: var(--text-color);
}
.container h2 { padding-bottom: 10px; } 
h3 { margin-top: 25px; font-size: 18px; color: var(--text-color); }
p { line-height: 1.6; }
hr { border: 0; border-top: 1px solid var(--border-color); margin: 25px 0; }
/* --- GLOBALNE NAGŁÓWKI (ŻEBY NIE BYŁY SZARE XD) --- */
body:not(.seo-home):not(.dashboard-page) h1,
body:not(.seo-home):not(.dashboard-page) h2,
body:not(.seo-home):not(.dashboard-page) h3,
body:not(.seo-home):not(.dashboard-page) h4,
body:not(.seo-home):not(.dashboard-page) h5,
body:not(.seo-home):not(.dashboard-page) h6 {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Lekki lifting dla największych tytułów (H1 i H2), żeby lepiej "siedziały" na ciemnym tle */
body:not(.seo-home):not(.dashboard-page) h1,
body:not(.seo-home):not(.dashboard-page) h2 {
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

/* --- IKONY FONT AWESOME --- */
body:not(.seo-home):not(.dashboard-page) i.fa-solid,
body:not(.seo-home):not(.dashboard-page) i.fa-regular {
    color: #39ff14;
    margin-right: 8px;
}

/* Wyjątek: ikony w przyciskach niech zostaną ciemne (jak tekst na guziku) */
button i.fa-solid {
    color: inherit;
}

/* =========================================
   3. FORMULARZE
   Wspólne style formularzy są teraz w assets/css/forms.css.
========================================= */
/* Przycisk powrotu/anulowania pod formularzami */
/* =========================================
   4. KOMUNIKATY I LINKI
========================================= */
.linki { text-align: center; margin-top: 20px; font-size: 14px; }
.linki a, .back-link, .back-btn, .back { color: var(--primary-color); text-decoration: none; display: block; margin-top: 10px; text-align: center; font-weight: bold; }
.linki a:hover, .back-link:hover, .back-btn:hover { text-decoration: underline; }
.linki a[href="zapomnialem.php"] { color: #00a8ff; }
.linki a[href="zapomnialem.php"]:hover { color: #007bff; }
.link-neon { color: #39ff14 !important; font-size: 15px !important; font-weight: bold !important; text-shadow: 0 0 8px rgba(57,255,20,0.4) !important; text-decoration: none !important; padding-top: 5px; }
.link-neon:hover { color: #fff !important; text-shadow: 0 0 12px rgba(255,255,255,0.6) !important; }

/* =========================================
   5. MAPA GŁÓWNA
   Nawigacja i dropdown są teraz w assets/css/header.css.
========================================= */

/* --- MAPA W INDEXIE --- */
.map-and-filters-container { display: flex; flex-direction: row; gap: 20px; width: 100%; max-width: 1200px; margin: 40px auto 40px auto; padding: 0 20px; box-sizing: border-box; align-items: stretch; }
.filter-sidebar { width: 250px; min-width: 250px; flex-shrink: 0; background: #1e1e1e; border: 1px solid #333; border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.filter-sidebar h3 { color: #fff; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; margin-top: 0; margin-bottom: 5px; border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; }
.filter-sidebar input[type="text"], .filter-sidebar select { background: #2d2d2d; border: 1px solid #444; color: #fff; padding: 12px; border-radius: 8px; width: 100%; box-sizing: border-box; }
.filter-sidebar input:focus, .filter-sidebar select:focus { border-color: #39ff14; outline: none; }
.btn-reset-map { margin-top: auto; padding: 12px; background: #2d2d2d; color: #fff; border: 1px solid #444; border-radius: 8px; cursor: pointer; transition: 0.2s; font-size: 13px; font-weight: bold; width: 100%; }
.btn-reset-map:hover { border-color: #39ff14; color: #39ff14; background: #1a1a1a; }
.map-wrapper { flex: 1 1 0%; min-width: 0; position: relative; margin: 0; padding: 0; }
.leaflet-container { background-color: #121212 !important; outline: 0 !important; }
.leaflet-tile { border: none !important; outline: none !important; box-shadow: none !important; }
#mapa { width: 100%; height: 55vh; min-height: 450px; z-index: 1; border-radius: 16px; border: 2px solid #333; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.leaflet-layer { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }
.leaflet-popup-content-wrapper { background: transparent !important; box-shadow: none !important; }
.leaflet-popup-tip { background: #1e1e1e !important; border: 1px solid #333 !important; border-top:none !important; border-left:none !important; }

/* =========================================
   6. DASHBOARD (BILETY I STATYSTYKI)
========================================= */
.dashboard-bottom-split { display: flex; gap: 40px; max-width: 1200px; margin: 0 auto 50px auto; padding: 0 20px; align-items: flex-start; }
.ostatnie-mecze-container { flex: 1; background: transparent; border: none; padding: 0; }
.ostatnie-mecze-container h2 { color: #fff; font-size: 24px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 30px; text-align: center; }
.lista-meczow { list-style: none; padding: 0; margin: 0; width: 100%; }
.lista-meczow li { background: #1e1e1e; margin-bottom: 15px; padding: 0; border-radius: 10px; display: flex; align-items: center; border: 1px solid #333; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; position: relative; overflow: hidden; }
.lista-meczow li:hover { transform: scale(1.02); box-shadow: 0 5px 15px rgba(57, 255, 20, 0.15); border-color: #28a745; }
.ticket-date { width: 80px; padding: 15px 5px; background: #111; color: #39ff14; font-weight: bold; font-size: 13px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.ticket-content { flex: 1; display: flex; justify-content: center; align-items: center; padding: 15px 20px; gap: 15px; }
.herb-mini { width: 35px; height: 35px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.team-name { font-size: 16px; font-weight: 600; color: #fff; flex: 1; }
.team-home { text-align: right; }
.team-away { text-align: left; }
.match-score { background: #000; color: #39ff14; padding: 5px 12px; border-radius: 6px; font-weight: 900; font-size: 18px; border: 1px solid #333; min-width: 60px; text-align: center; }
.dashboard-stats-wrapper { flex: 1; display: flex; flex-direction: column; }
.dashboard-stats-wrapper h2 { color: #fff; font-size: 24px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 30px; text-align: center; }
.dashboard-stats { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.stat-card { background: #1e1e1e; border: 1px solid #333; border-radius: 12px; padding: 25px 20px; text-align: center; box-shadow: 0 8px 20px rgba(0,0,0,0.5); transition: transform 0.3s ease, border-color 0.3s ease; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, #28a745, #39ff14); }
.stat-card:hover { transform: translateY(-5px); border-color: #39ff14; }
.stat-card h3 { font-size: 14px; color: #888; margin: 0 0 10px 0; text-transform: uppercase; letter-spacing: 1px; }
.stat-card .stat-value { font-size: 36px; font-weight: bold; color: #fff; text-shadow: 0 0 10px rgba(57, 255, 20, 0.3); }

/* =========================================
   7. WIDOKI MODERATORA I EDYCJI
========================================= */
table { width: 100%; border-collapse: collapse; margin-top: 20px; color: var(--text-color); }
th, td { padding: 12px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; } 
th { background-color: var(--bg-color); }
.btn-del { background: #dc3545; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; text-decoration: none; font-size: 12px; font-weight: bold; transition: 0.2s; display: inline-block;}
.btn-del:hover { background: #c82333; }
#map-picker { height: 350px; width: 100%; margin-top: 10px; border: 2px solid var(--border-color); border-radius: 8px; cursor: crosshair; }
.coords-row { display: flex; gap: 10px; }
.coords-row div { flex: 1; }
.photo-section { margin-top: 25px; border-top: 2px solid var(--border-color); padding-top: 20px; }
.img-grid { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.img-container { position: relative; width: 100px; height: 75px; }
.img-container img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); }
.del-check { position: absolute; bottom: 2px; right: 2px; line-height: 0; }
.del-check input[type="checkbox"] { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.lightbox { display: none; position: fixed; z-index: 9999; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); justify-content: center; align-items: center; cursor: pointer; }
.lightbox img { max-width: 90%; max-height: 80%; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.5); object-fit: contain; }

.btn-edycja {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    transition: 0.2s;
    display: inline-block;
    margin-right: 5px;
}

.btn-edycja:hover {
    background: #e0a800;
}

/* =========================================
   8. STRONY LOGOWANIA / REJESTRACJI (TŁO)
========================================= */
body.strona-logowania { background-image: url('boisko.jpg') !important; background-position: center center !important; background-repeat: no-repeat !important; background-attachment: fixed !important; background-size: cover !important; background-color: #222 !important; }
body.strona-logowania .container { background: rgba(30, 30, 30, 0.85); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: 3px solid var(--primary-color); box-shadow: 0 15px 35px rgba(0,0,0,0.5); margin-top: 0; margin-bottom: 50px; }
.logo-container-login { display: flex; justify-content: center; align-items: center; margin-top: 8vh; margin-bottom: 30px; gap: 20px; }
.logo-container-login img { width: 80px; height: auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
.logo-container-login h1 { color: #ffffff; font-size: 52px; margin: 0; font-weight: bold; text-shadow: 3px 3px 12px rgba(0,0,0,0.9); letter-spacing: 1px; }
.logo-container-login h1 .zielone-litery { color: var(--primary-color); text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9); }
.section-title { text-align: center; margin: 60px auto 10px auto; padding: 0 20px; }
.section-title h2 { color: #ffffff; font-size: 30px; letter-spacing: 2px; font-weight: bold; text-shadow: 2px 2px 15px rgba(0,0,0,0.9); margin: 0; position: relative; display: inline-block; }
.section-title h2::before, .section-title h2::after { content: ""; position: absolute; top: 50%; width: 80px; height: 3px; background-color: var(--primary-color); border-radius: 2px; box-shadow: 0 0 10px rgba(0,0,0,0.8); }
.section-title h2::before { left: -110px; }
.section-title h2::after { right: -110px; }
.features-showcase { max-width: 1300px; margin: 40px auto 100px auto; display: flex; flex-direction: column; gap: 100px; padding: 0 20px; }
.feature-row { display: flex; gap: 40px; width: 95%; align-self: flex-start; }
.feature-row.reverse { flex-direction: row-reverse; align-self: flex-end; }
.feature-card { background: rgba(30, 30, 30, 0.85); border: 2px solid var(--primary-color); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; will-change: transform, box-shadow; transform: translateZ(0); }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.5); }
/* --- ZDJĘCIA NA STRONIE LOGOWANIA --- */
.img-card {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
}

.img-card img {
    width: 100%;
    max-height: 450px; /* Blokada, żeby bardzo wysokie pionowe zdjęcie nie zajęło całego ekranu */
    height: auto;
    object-fit: contain; /* Magiczne słowo: pokazuje CAŁE zdjęcie bez ucinania boków! */
    border-radius: 12px; /* Żeby rogi były ładnie zaokrąglone */
}
.text-card { width: calc(35% - 20px); padding: 40px 30px; display: flex; flex-direction: column; justify-content: center; }
.text-card h3 { margin-top: 0; color: var(--text-color); font-size: 22px; border-bottom: 3px solid var(--primary-color); padding-bottom: 10px; margin-bottom: 20px; display: inline-block; align-self: flex-start; }
.text-card p { color: var(--text-color); font-size: 14px; line-height: 1.6; margin-bottom: 0; }
.feature-list { list-style: none; padding: 0; margin-top: 25px; }
.feature-list li { font-size: 14px; color: var(--text-color); margin-bottom: 12px; line-height: 1.5; background: rgba(255, 255, 255, 0.05); padding: 12px 15px; border-radius: 8px; border-left: 4px solid var(--primary-color); }
.feature-card.bottom-wide { align-self: center; width: 100%; display: flex; flex-direction: column; }
.text-card-wide { width: 100%; text-align: center; padding: 60px 40px 40px 40px; display: flex; flex-direction: column; align-items: center; }
.text-card-wide h3 { margin-top: 0; color: var(--text-color); font-size: 26px; border-bottom: 3px solid var(--primary-color); padding-bottom: 10px; margin-bottom: 20px; display: inline-block; }
.text-card-wide p { color: var(--text-color); font-size: 16px; line-height: 1.6; margin-bottom: 0; max-width: 800px; }
.feature-card.bottom-wide .feature-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; width: 100%; }
.feature-card.bottom-wide .feature-list li { margin-bottom: 0; max-width: 300px; text-align: left; font-size: 15px; }
.feature-card.bottom-wide img { width: 100%; height: 350px; object-fit: cover; }

/* =========================================
   9. WYSZUKIWARKA KLUBÓW (SIATKA)
========================================= */
.search-box { width: 100%; padding: 14px; font-size: 16px; border: 2px solid var(--border-color); border-radius: 8px; margin-bottom: 25px; outline: none; background: var(--input-bg); color: var(--text-color);}
.kluby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; }
.klub-item { background: #1e1e1e; border: 1px solid #333; border-radius: 8px; padding: 15px; text-align: center; transition: transform 0.2s, box-shadow 0.2s; }
.klub-item:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(57, 255, 20, 0.1); border-color: #28a745;}
.klub-item img { max-width: 60px; max-height: 60px; margin-bottom: 10px; object-fit: contain; }
.klub-nazwa { font-weight: bold; color: #fff; font-size: 14px; word-wrap: break-word; }

/* =========================================
   10. NIESTANDARDOWA WALIDACJA FORMULARZY
========================================= */
.input-error { border-color: #ff4d4d !important; box-shadow: 0 0 8px rgba(255, 77, 77, 0.4) !important; }
.custom-error-msg { color: #ff4d4d; font-size: 13px; margin-top: 5px; margin-bottom: 10px; font-weight: bold; text-shadow: 0 0 5px rgba(255, 77, 77, 0.3); animation: fadeInError 0.3s ease; }
@keyframes fadeInError { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   11. SYSTEM RANG (ROZCIĄGNIĘTA KARTA I PASEK)
========================================= */
.ranga-full-width-container {
    max-width: 1200px;
    margin: 0 auto 50px auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}
.ranga-card-content {
    border-width: 2px;
    width: 100%;
    text-align: center;
    padding: 35px 20px;
}
.ranga-title {
    font-size: 16px;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.ranga-name {
    font-size: 38px;
    font-weight: 900;
    margin-bottom: 20px;
    color: #fff;
}
.ranga-progress-text {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.progress-container { 
    height: 18px; 
    background: #111; 
    border: 1px solid #333; 
    border-radius: 20px; 
    max-width: 800px; 
    margin: 0 auto;
    overflow: hidden;
}
.progress-bar { 
    height: 100%; 
    border-radius: 20px; 
    transition: width 0.5s ease; 
}

/* =========================================
   12. ZNAJOMI (KARTY I PRZYCISKI)
========================================= */
.znajomi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; margin-top: 15px; }
.karta-kibica { background: #1e1e1e; border: 1px solid #333; border-radius: 8px; padding: 15px; text-align: center; }
.karta-kibica h4 { margin: 0 0 10px 0; color: #fff; font-size: 18px; }
.btn-maly { padding: 8px 12px; font-size: 12px; background: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; transition: background-color 0.2s; }
.btn-maly:hover { background: #218838; }
.btn-maly-czerwony { background: #dc3545; }
.btn-maly-czerwony:hover { background: #c82333; }
.btn-maly-niebieski { background: #17a2b8; width: 100%; display: block; text-decoration: none; text-align: center; box-sizing: border-box; font-size: 13px; padding: 10px; margin-bottom: 10px; border-radius: 4px; color: #fff; font-weight: bold; transition: background-color 0.2s; }
.btn-maly-niebieski:hover { background: #138496; }
.btn-usun-znajomego { background: transparent; color: #dc3545; border: 1px solid #dc3545; width: 100%; padding: 4px; font-size: 11px; border-radius: 4px; cursor: pointer; transition: 0.2s; }
.btn-usun-znajomego:hover { background: #dc3545; color: #fff; }
.badge-rangi {
    font-weight: 900; 
    font-size: 12px; 
    letter-spacing: 1px; 
    background: rgba(0,0,0,0.4); 
    padding: 4px 12px; 
    border-radius: 20px; 
    display: inline-block;
    color: #ffc107; 
}

/* Wyszukiwarka znajomych (żeby pasek i guzik się nie gniotły) */
.wyszukiwarka-znajomych {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.wyszukiwarka-znajomych input {
    flex: 1 1 200px;
    margin-top: 0 !important;
    min-width: 220px;
}

.wyszukiwarka-znajomych button {
    flex: 0 1 auto;
    margin-top: 0 !important;
    padding: 12px 20px !important;
    width: auto !important; /* Nadpisuje wymuszanie 100% z innych reguł */
}

/* Na bardzo małych ekranach pozwalamy im zająć 100% (jeden pod drugim) */
@media (max-width: 600px) {
    .wyszukiwarka-znajomych input,
    .wyszukiwarka-znajomych button {
        width: 100% !important;
        flex: 1 1 100%;
    }
}

/* =========================================
   13. RAMKA NA STATYSTYKI I OSTATNIE WYJAZDY
========================================= */
.dashboard-frame {
    background-color: #1a1a1a !important; 
    border: 2px solid #333 !important; 
    border-radius: 16px !important;
    padding: 35px !important; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.8) !important; 
    position: relative;
    margin-top: 20px;
}
.dashboard-frame::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 5%;
    width: 90%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #39ff14, transparent);
    opacity: 0.8;
}
@media (max-width: 950px) {
    .dashboard-frame {
        padding: 20px 15px !important;
    }
}

/* =========================================
   14. KLASTRY NA MAPIE (SPIDERFY)
========================================= */
.marker-cluster {
    background-color: rgba(57, 255, 20, 0.3) !important; 
    border-radius: 50% !important; /* Upewniamy się, że z zewnątrz też jest okrągłe */
}

.marker-cluster div {
    box-sizing: border-box !important; /* Żeby ramka nie powiększała kółka */
    background-color: #121212 !important; 
    color: #39ff14 !important; 
    border: 2px solid #39ff14 !important; 
    font-weight: 900;
    font-size: 14px;
    border-radius: 50% !important; 
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.6) !important; /* Naprawiony cień */
    
    /* Centrowanie cyferki na sztywno */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 30px !important;
    height: 30px !important;
    margin-top: 5px !important;
    margin-left: 5px !important;
}

.marker-cluster span {
    line-height: normal !important; /* Wyłączamy domyślny line-height Leafleta */
}

/* =========================================
   15. STOPKA
   Style stopki są teraz w assets/css/footer.css.
========================================= */

/* =========================================
   16. PRZYCISK POWROTU (np. w Regulaminie, Polityce)
========================================= */
.container .back-link {
    display: inline-block;
    margin-top: -15px; /* Podnosi napis wyżej, bliżej górnej krawędzi ramki */
    margin-bottom: 25px; /* Odpycha tytuł poniżej */
    text-align: left;
    color: #aaa; /* Delikatny szary kolor domyślnie */
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.container .back-link:hover {
    color: #39ff14; /* Zmienia się na nasz neonowy zielony! */
    text-decoration: none;
    transform: translateX(-5px); /* Bajer: lekko cofa się w lewo przy najechaniu */
}

/* =========================================
   17. NOWE FILTRY W BAZIE KLUBÓW (kluby.php)
========================================= */
.filters-bar {
    display: flex; gap: 15px; margin-bottom: 30px; flex-wrap: wrap; 
    background: rgba(255, 255, 255, 0.03); padding: 15px; 
    border-radius: 12px; border: 1px solid #333;
}

.filter-input, .filter-select {
    background: #121212; color: #fff; border: 1px solid #444; 
    border-radius: 8px; padding: 14px 20px; font-size: 15px; 
    outline: none; transition: all 0.3s ease;
}

.filter-input { flex: 2; min-width: 250px; }
.filter-select { flex: 1; min-width: 200px; cursor: pointer; }

/* Neonowy efekt po kliknięciu */
.filter-input:focus, .filter-select:focus {
    border-color: #39ff14; box-shadow: 0 0 12px rgba(57, 255, 20, 0.2); background: #1a1a1a;
}

.filter-select option { background: #1e1e1e; color: #fff; }

/* Łamanie na telefony */
@media (max-width: 600px) {
    .filter-input, .filter-select { 
        width: 100% !important; 
        flex: 1 1 100% !important; 
        min-width: 100% !important; 
    }
}

/* =========================================
   20. UKŁAD Z REKLAMAMI PO BOKACH (POPRAWIONY)
   ========================================= */
.page-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    max-width: 100%;
    padding: 0 20px; /* Tylko lekki odstęp od ramki monitora */
}

.main-content {
    flex: 1; /* Pozwala środkowi zająć tyle miejsca, ile potrzebuje */
    min-width: 0; /* MAGIA FLEXBOXA - pozwala elementowi chudnąć! */
    width: 100%;
    max-width: 1200px;
    overflow: hidden; /* Pancerz ochronny */
}

.ad-sidebar {
    display: none; /* Domyślnie ukryte na małych ekranach i telefonach */
    position: sticky;
    top: 90px;
    flex-shrink: 0; /* Reklama ma trzymać swój wymiar i nie zgniatać środka */
}

/* Zmusza kontenery wewnątrz głównej sekcji do zajęcia całej wolnej przestrzeni */
.main-content .container {
    max-width: 100%; /* Zdejmujemy limit 800px, pozwalamy mu rosnąć aż do 1200px */
    width: 100%;
}

/* 1. ŚREDNIE EKRANY I LAPTOPY (od 1150px): Pokazujemy standardowe, wąskie reklamy 160px */
@media (min-width: 1150px) {
    .ad-sidebar {
        display: block;
        width: 160px;
    }
}

/* 2. WIELKIE MONITORY (od 1550px): Dopiero tutaj odpalamy potężne reklamy 300px */
@media (min-width: 1550px) {
    .ad-sidebar {
        width: 300px;
    }
}

/* =========================================
   21. PRZYCISKI W PANELU ADMINISTRATORA
========================================= */
.admin-action-bar {
    display: flex;
    flex-wrap: wrap; /* Zezwala na przenoszenie do nowej linii */
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.admin-action-bar a {
    flex: 1 1 calc(50% - 15px); /* Domyślnie 2 w rzędzie z uwzględnieniem odstępu (gap) */
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 15px;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px; /* Minimalnie mniejsza czcionka, żeby wszystko weszło */
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-align: center;
    position: relative;
    white-space: normal; /* Pozwala tekstowi w przycisku złamać się na 2 linie */
    line-height: 1.3;
}

.admin-action-bar a i {
    font-size: 16px;
    flex-shrink: 0; /* Zapobiega zgniataniu ikony */
}

/* Kolory przycisków */
.btn-panel-back { background-color: #2a2a2a !important; color: #e0e0e0 !important; border: 1px solid #444 !important; }
.btn-panel-back:hover { background-color: #3a3a3a !important; color: #fff !important; }

.btn-panel-manager { background-color: #0056b3 !important; color: #ffffff !important; border: 1px solid #004085 !important; box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3) !important; }
.btn-panel-manager:hover { background-color: #0069d9 !important; box-shadow: 0 4px 15px rgba(0, 105, 217, 0.4) !important; transform: translateY(-2px); }

.btn-panel-leagues { background-color: #28a745 !important; color: #ffffff !important; border: 1px solid #218838 !important; box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3) !important; }
.btn-panel-leagues:hover { background-color: #218838 !important; box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important; transform: translateY(-2px); }

.btn-panel-tickets { background-color: #6f42c1 !important; color: #ffffff !important; border: 1px solid #59339d !important; box-shadow: 0 4px 10px rgba(111, 66, 193, 0.3) !important; }
.btn-panel-tickets:hover { background-color: #5a32a3 !important; box-shadow: 0 4px 15px rgba(111, 66, 193, 0.4) !important; transform: translateY(-2px); }

/* Powiadomienie (licznik) na przycisku */
.badge-zgloszenia {
    background: #ff3333;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 10px;
    position: absolute;
    top: -8px;
    right: -8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 51, 51, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 51, 51, 0); }
}

/* Responsywność dla paska przycisków */
@media (max-width: 850px) {
    .admin-action-bar a {
        flex: 1 1 100%; /* Na małych ekranach wymusza 1 przycisk w rzędzie (100% szerokości) */
    }
}

/* =========================================
   22. TABLICA AKTYWNOŚCI (FEED ZNAJOMYCH)
========================================= */
.feed-list { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.feed-item { background: #121212; border: 1px solid #333; border-radius: 12px; padding: 20px; transition: border-color 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.4); }
.feed-item:hover { border-color: #444; }
.feed-header { font-size: 14px; color: #ccc; margin-bottom: 12px; border-bottom: 1px dashed #333; padding-bottom: 10px; }
.feed-header strong { color: #fff; }
.feed-header i { color: #39ff14; margin-right: 5px; }

.feed-match { background: #1a1a1a; padding: 15px; border-radius: 8px; text-align: center; font-size: 16px; font-weight: bold; border: 1px solid #222; }

.feed-actions { display: flex; gap: 10px; margin-top: 15px; }
.feed-actions button { background: transparent; border: 1px solid #444; color: #aaa; padding: 8px 15px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: bold; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.feed-actions button:hover { background: rgba(255,255,255,0.05); color: #fff; border-color: #888; }
.feed-actions button i { margin: 0; color: inherit; }

/* Kiedy lajk jest wciśnięty */
.feed-actions button.btn-like.liked { background: rgba(57, 255, 20, 0.1); border-color: #39ff14; color: #39ff14; text-shadow: 0 0 5px rgba(57,255,20,0.5); }
.feed-actions button.btn-like.liked i { color: #39ff14; }

/* =========================================
   23. OSTATECZNA RESPONSYWNOŚĆ (WSZYSTKIE STRONY)
========================================= */

/* --- UKRYWANIE REKLAM MOBILNYCH NA DESKTOPIE --- */
.ad-mobile {
    display: none;
}

/* --- TABLETY I MAŁE LAPTOPY (do 950px) --- */
@media (max-width: 950px) {
    header { flex-direction: column; gap: 15px; padding: 15px 10px; min-height: auto; }
    .header-left, .header-center, .header-right-flex { width: 100%; display: flex; justify-content: center; }
    .nav-buttons { flex-wrap: wrap; gap: 8px; }
    .przycisk-menu { padding: 10px 12px; font-size: 11px; border: 1px solid #222 !important; border-radius: 6px; flex: 1 1 auto; }
    .przycisk-menu::after { display: none !important; }
    
    .feature-row, .feature-row.reverse { width: 100%; align-self: center; flex-direction: column; }
    .img-card, .text-card { width: 100% !important; }
    .img-card img { min-height: 250px; height: 250px; }
    .text-card, .text-card-wide { padding: 30px 20px; }
    .feature-card.bottom-wide .feature-list { flex-direction: column; }
    .feature-card.bottom-wide .feature-list li { max-width: 100%; }
    .section-title h2 { font-size: 22px; }
    .section-title h2::before, .section-title h2::after { display: none; }
    
    .dashboard-frame { padding: 20px 15px !important; }
}

/* --- DUŻE TELEFONY (do 850px) --- */
@media (max-width: 850px) {
    .map-and-filters-container { flex-direction: column !important; padding: 10px !important; margin-top: 20px; }
    .filter-sidebar { width: 100% !important; border-right: none !important; border-bottom: 1px dashed #444 !important; padding-bottom: 20px !important; box-sizing: border-box !important; }
    .map-wrapper { width: 100% !important; height: 450px !important; }

    .dashboard-bottom-split { flex-direction: column !important; gap: 25px !important; padding: 10px !important; }
    .ostatnie-mecze-container, .dashboard-stats-wrapper { width: 100% !important; box-sizing: border-box !important; }
    .dashboard-stats { flex-direction: column !important; gap: 15px !important; }
    .stat-card { width: 100% !important; box-sizing: border-box !important; }

    /* BILETY NA TELEFON (Pionowe, czyste) */
    .lista-meczow li { display: flex !important; flex-direction: column !important; text-align: center !important; padding: 15px !important; gap: 10px; border-left: 1px solid #333 !important; }
    .ticket-date { width: 100% !important; border-bottom: 1px dashed #333 !important; padding-bottom: 10px !important; margin-bottom: 5px !important; }
    .ticket-content { width: 100% !important; flex-wrap: wrap !important; justify-content: center !important; gap: 10px !important; padding: 0 !important; }

    .ranga-full-width-container { padding: 10px !important; }
    .ranga-name { font-size: 26px !important; }
    .znajomi-grid { grid-template-columns: 1fr !important; }
    
    /* POKAZUJEMY REKLAMĘ MOBILNĄ (Zaślepka) */
    .ad-mobile {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        min-height: 100px;
        margin: 15px 0;
        border: 1px dashed #444;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.2);
        color: #666;
        font-size: 12px;
        text-align: center;
        box-sizing: border-box;
    }
}

/* --- MAŁE SMARTFONY - PANCERZ (do 600px) --- */
@media (max-width: 600px) {
    /* Blokada rozjeżdżania się stron na boki */
    body { overflow-x: hidden !important; width: 100% !important; }
    body.strona-logowania { padding: 0 !important; margin: 0 !important; }
    
    .logo-container-login img { max-width: 100px !important; }
    
    /* Wszystkie ramki typu Ustawienia, Logowanie, Rejestracja */
    .container { width: 95% !important; max-width: 100% !important; padding: 20px 15px !important; margin: 20px auto !important; box-sizing: border-box !important; }
    .container input, .container select, .container button { width: 100% !important; box-sizing: border-box !important; }
    .container img { max-width: 100% !important; height: auto !important; }

    /* Detale biletów na bardzo mały ekran */
    .ticket-content { gap: 5px !important; }
    .team-name { font-size: 11px; }
    .match-score { font-size: 13px; padding: 4px 6px; min-width: 45px; }
    .herb-mini { width: 25px; height: 25px; }

    .user-dropdown-menu { right: -20px; width: 260px; }
    .stat-card .stat-value { font-size: 26px !important; }
    .ranga-name { font-size: 24px !important; }
    
    /* Kafle na stronie głównej logowania */
    .features-showcase, .feature-row, .feature-card, .text-card-wide { width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; padding: 15px !important; box-sizing: border-box !important; }
    .feature-list li { word-wrap: break-word !important; white-space: normal !important; }

    /* Centrowanie nagłówków (np. Przeglądasz profil) na małych ekranach */
    .container h2, 
    .container h3,
    .tytul-neonowy {
        text-align: center !important;
        width: 100% !important;
        display: block !important;
    }
}

/* =========================================
   24. EKRAN POWITALNY (WYBÓR SPORTU)
========================================= */
body.wybor-sportu {
    background-color: #0a0a0a;
    background-image: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

body.wybor-sportu .header-logo-img {
    height: 60px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.5));
    animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

body.wybor-sportu .welcome-text {
    text-align: center;
    margin-bottom: 40px;
}

body.wybor-sportu .welcome-text h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

body.wybor-sportu .welcome-text p {
    color: #aaa;
    font-size: 16px;
    margin: 0;
}

body.wybor-sportu .sports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1000px;
}

body.wybor-sportu .sport-card {
    background: #121212;
    border: 2px solid #222;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.wybor-sportu .sport-card i {
    font-size: 60px;
    margin-bottom: 20px;
    margin-right: 0;
    transition: transform 0.3s ease;
}

body.wybor-sportu .sport-card h2 {
    font-size: 22px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.wybor-sportu .sport-card.active {
    border-color: #39ff14;
    background: linear-gradient(145deg, #121212 0%, #1a2a1a 100%);
    box-shadow: 0 15px 40px rgba(57, 255, 20, 0.15);
}

body.wybor-sportu .sport-card.active i {
    color: #39ff14;
    text-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
}

body.wybor-sportu .sport-card.active:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(57, 255, 20, 0.3);
    border-color: #fff;
}

body.wybor-sportu .sport-card.active:hover i {
    transform: scale(1.1);
}

body.wybor-sportu .sport-card.disabled {
    filter: grayscale(100%);
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #333;
}

body.wybor-sportu .sport-card.disabled i {
    color: #666;
}

body.wybor-sportu .soon-badge {
    position: absolute;
    top: 25px;
    right: -35px;
    background: #ffaa00;
    color: #000;
    font-weight: 900;
    font-size: 14px;
    padding: 5px 40px;
    transform: rotate(45deg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

body.wybor-sportu .btn-wyloguj {
    margin-top: 50px;
    color: #ffffff; /* Czysta biel! */
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.2s, border-color 0.2s;
    border: 1px solid #444; /* Lekko rozjaśniona ramka */
    padding: 10px 20px;
    border-radius: 8px;
}

body.wybor-sportu .btn-wyloguj:hover {
    color: #ff4d4d;
    border-color: #ff4d4d;
}

@media (max-width: 768px) {
    body.wybor-sportu .sports-grid { grid-template-columns: 1fr; }
    body.wybor-sportu .sport-card { padding: 30px 20px; }
}

/* =========================================
   25. POWIADOMIENIA (TOASTY)
========================================= */
.mecz-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-left: 4px solid #39ff14;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.8);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    transform: translateX(150%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efekt sprężynki */
    max-width: 350px;
}

.mecz-toast.pokaz {
    transform: translateX(0);
}

.mecz-toast-ikona {
    color: #39ff14;
    font-size: 24px;
    animation: delikatneBicie 2s infinite;
}

.mecz-toast-tekst {
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.5;
}

.mecz-toast-zamknij {
    background: transparent;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
    transition: color 0.2s;
}

.mecz-toast-zamknij:hover {
    color: #ff4d4d;
}

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

/* Na telefonach dymek będzie na całej szerokości na dole */
@media (max-width: 768px) {
    .mecz-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

header {
    padding-top: env(safe-area-inset-top);
}

footer {
    padding-bottom: env(safe-area-inset-bottom);
}

.tryb-aplikacji body {
    overscroll-behavior-y: none;
}

/* =========================================================
   WARSTWY STRON — ochrona przed wyciekaniem starego CSS
========================================================= */
body.seo-home {
    display: block;
}

body.dashboard-page {
    display: flex;
    flex-direction: column;
}

body.seo-home main,
body.dashboard-page main {
    min-width: 0;
}

body.seo-home button,
body.seo-home input,
body.seo-home select,
body.seo-home textarea,
body.dashboard-page button,
body.dashboard-page input,
body.dashboard-page select,
body.dashboard-page textarea {
    font-family: inherit;
}
