/* style.css - NexusFC Main Stylesheet */

/* ZMIENNE KOLORYSTYCZNE */
:root {
    --primary-blue: #0056b3;
    --primary-hover: #004494;
    --accent-light: #e7f1ff;
    --text-black: #1a1a1a;
    --text-grey: #666;
    --white: #ffffff;
    --bg-light: #f8f9fa;
    --danger: #dc3545;
    --success: #28a745;
}

/* RESET I BAZA */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: var(--bg-light); color: var(--text-black); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { text-decoration: none; color: inherit; }

/* NAWIGACJA */
nav {
    background: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 100;
}
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-black); }
.logo span { color: var(--primary-blue); }
.nav-links button, .btn-nav {
    background: transparent; border: 1px solid var(--text-black);
    padding: 0.5rem 1.5rem; border-radius: 4px; cursor: pointer; transition: 0.3s;
    font-size: 0.9rem;
}
.nav-links button.primary, .btn-nav.primary {
    background: var(--primary-blue); color: var(--white); border-color: var(--primary-blue); margin-left: 10px;
}

/* ELEMENTY CENTRALNE */
.hero { text-align: center; padding: 4rem 1rem; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; line-height: 1.2; }
.hero p { color: var(--text-grey); font-size: 1.2rem; margin-bottom: 2rem; }

/* KARTY WYBORU ROLI */
.role-selection {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem; padding: 2rem 5%; max-width: 1200px; margin: 0 auto; width: 100%;
}
.role-card {
    background: var(--white); padding: 2rem; border-radius: 12px; border: 1px solid #eee;
    text-align: center; cursor: pointer; transition: 0.3s;
}
.role-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: var(--primary-blue); }
.role-icon { font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary-blue); }
.role-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.btn-select {
    display: inline-block; padding: 0.8rem 2rem; background-color: var(--accent-light);
    color: var(--primary-blue); font-weight: 600; border-radius: 6px; margin-top: 1rem;
}
.role-card:hover .btn-select { background-color: var(--primary-blue); color: var(--white); }

/* FORMULARZE */
.auth-wrapper { display: flex; justify-content: center; align-items: center; flex-grow: 1; padding: 2rem; }
.auth-container, .login-card, .success-card {
    background: var(--white); padding: 2.5rem; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); width: 100%; max-width: 500px;
}
.success-card { text-align: center; border-top: 5px solid var(--success); }
.auth-container h2, .login-card h2 { color: var(--primary-blue); margin-bottom: 1.5rem; text-align: center; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.form-group input, .form-group select {
    width: 100%; padding: 0.8rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem;
}
.form-group input:focus { outline: none; border-color: var(--primary-blue); }

.btn-submit {
    width: 100%; padding: 1rem; background: var(--primary-blue); color: var(--white);
    border: none; border-radius: 4px; font-weight: 600; cursor: pointer; font-size: 1rem; transition: 0.2s;
}
.btn-submit:hover { background: var(--primary-hover); }

.error-msg { color: var(--danger); background: #ffe6e6; padding: 10px; border-radius: 4px; margin-bottom: 15px; text-align: center; font-size: 0.9rem; }
.back-link { display: block; text-align: center; margin-top: 1rem; color: var(--text-grey); font-size: 0.9rem; cursor: pointer; }
.back-link:hover { color: var(--primary-blue); }

/* DASHBOARD I OGÓLNY KONTENER */
.container {
    max-width: 1200px;
    margin: 0 auto;        
    padding: 2rem 1rem;   
}

.profile-header { background: var(--white); padding: 2rem; border-radius: 12px; display: flex; align-items: center; gap: 2rem; box-shadow: 0 2px 10px rgba(0,0,0,0.03); margin-top: 2rem; }
.avatar { width: 80px; height: 80px; background: var(--accent-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--primary-blue); font-weight: bold; }
.badge { background: var(--primary-blue); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }

.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.card { background: var(--white); padding: 1.5rem; border-radius: 8px; border: 1px solid #eee; }
.card h3 { border-bottom: 2px solid #f0f0f0; padding-bottom: 0.5rem; margin-bottom: 1rem; color: #555; }

.logout {
    color: var(--danger); font-weight: 600; font-size: 0.9rem; transition: 0.3s;
}
.logout:hover { color: #a71d2a; }

/* SPAM HONEYPOT */
.hp-field { display: none; visibility: hidden; opacity: 0; }

/* UI ZAWODNIKA */
.alert { padding: 1rem; margin-bottom: 1rem; border-radius: 4px; text-align: center; }
.alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 2rem;
}

/* WIZUALNE BOISKO */
.pitch-container {
    background-color: #2e8b57;
    border: 2px solid white;
    border-radius: 8px;
    height: 450px; 
    position: relative;
    margin-bottom: 1rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
    user-select: none;
}
.pitch-line { position: absolute; background: rgba(255,255,255,0.4); }
.pitch-center-line { width: 100%; height: 2px; top: 50%; }
.pitch-circle { width: 80px; height: 80px; border: 2px solid rgba(255,255,255,0.4); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); position: absolute; }
.pitch-box-top { width: 40%; height: 60px; border: 2px solid rgba(255,255,255,0.4); border-top: none; top: 0; left: 30%; position: absolute; }
.pitch-box-bottom { width: 40%; height: 60px; border: 2px solid rgba(255,255,255,0.4); border-bottom: none; bottom: 0; left: 30%; position: absolute; }

.position-dot { 
    position: absolute; transform: translate(-50%, -50%); cursor: pointer; z-index: 10; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dot-visual {
    width: 24px; height: 24px; background: white; border-radius: 50%; display: block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    border: 3px solid #1e5c39;
}
.dot-label {
    position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
    color: white; font-size: 0.75rem; font-weight: 800; text-shadow: 0 1px 3px black;
    white-space: nowrap; text-transform: uppercase; pointer-events: none;
}

/* STANY KROPEK */
.position-dot.state-sec .dot-visual {
    background: #0056b3; 
    border-color: white;
    transform: scale(1.1);
}
.position-dot.state-main .dot-visual {
    background: #ffc107; 
    border-color: #0056b3; 
    transform: scale(1.4);
    z-index: 20;
}
.read-only .position-dot { cursor: default; }
.read-only .position-dot:not(.state-main):not(.state-sec) { opacity: 0.3; }

/* RESPONSYWNOŚĆ */
@media (max-width: 900px) {
    .dashboard-columns { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .profile-header { flex-direction: column; text-align: center; }
}

/* MODAL UDOSTĘPNIANIA */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); 
    display: none; 
    justify-content: center; align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white; padding: 2rem; border-radius: 8px;
    width: 90%; max-width: 500px; text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.modal-input {
    width: 100%; padding: 10px; margin: 15px 0;
    border: 2px solid #e7f1ff; border-radius: 4px;
    font-size: 1rem; color: #333; text-align: center;
}
.btn-close {
    background: #6c757d; margin-top: 10px;
}
.btn-close:hover { background: #5a6268; }

/* --- UI LEPSZEJ NOGI --- */
.foot-selector {
    display: flex; justify-content: center; gap: 30px;
    margin-top: 10px; margin-bottom: 20px;
    background: #fdfdfd; padding: 15px; border: 1px solid #eee; border-radius: 8px;
}

.foot-icon {
    width: 60px; height: 80px;
    fill: #e0e0e0; /* Domyślny szary */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    stroke: #ccc; stroke-width: 1;
}

.foot-icon:hover {
    fill: #d0d0d0; transform: scale(1.05);
}

/* Stan aktywny (wybrana noga) */
.foot-icon.active {
    fill: var(--primary-blue);
    stroke: var(--primary-blue);
    filter: drop-shadow(0 4px 6px rgba(0,86,179, 0.3));
    transform: scale(1.1);
}

/* Podpis pod stopami */
.foot-label {
    text-align: center; font-size: 0.8rem; font-weight: bold; color: #666; margin-top: 5px; text-transform: uppercase;
}

/* --- ATRYBUTY (GRID) - POPRAWIONY WYGLĄD --- */
.attributes-grid {
    display: grid; 
    grid-template-columns: repeat(2, 1fr); /* Dwie kolumny */
    gap: 12px; 
    max-height: 250px; 
    overflow-y: auto;
    background: #fdfdfd; 
    padding: 15px; 
    border: 1px solid #eee; 
    border-radius: 4px;
}

.attr-item {
    display: flex; 
    align-items: center;
}

.attr-item label { 
    display: flex; 
    align-items: center; /* Pionowe centrowanie */
    justify-content: flex-start; /* Do lewej */
    gap: 10px; /* Odstęp między kratką a tekstem */
    cursor: pointer; 
    font-size: 0.95rem;
    width: 100%;
    margin: 0;
    color: #333;
    line-height: 1.2; 
}

.attr-item input[type="checkbox"] {
    margin: 0; 
    width: 18px; 
    height: 18px; 
    flex-shrink: 0; /* Zapobiega zgniataniu */
    cursor: pointer;
    accent-color: var(--primary-blue); /* Niebieski kolor zaznaczenia */
}

/* --- HISTORIA KARIERY (PEŁNA SZEROKOŚĆ) --- */
.career-section {
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.wide-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #f0f0f0; padding-bottom: 1rem; margin-bottom: 1rem;
}

.btn-add {
    background: var(--success); color: white; border: none; 
    width: 32px; height: 32px; border-radius: 50%; 
    font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.btn-add:hover { transform: scale(1.1); background: #218838; }

/* Tabela Historii */
.full-width-table {
    width: 100%; border-collapse: collapse; font-size: 0.95rem;
}
.full-width-table th {
    text-align: left; padding: 12px; background: #f8f9fa; color: #555; font-weight: 600;
}
.full-width-table td {
    padding: 12px; border-bottom: 1px solid #eee; vertical-align: middle;
}
.full-width-table tr:hover { background: #fafafa; }

/* Ikonki pogody */
.weather-icon { font-size: 1.2rem; margin-right: 5px; }
.round-autumn { color: #00bcd4; } /* Niebieski śnieg */
.round-spring { color: #ff9800; } /* Pomarańczowe słońce */
.round-full span { margin: 0 2px; }

/* Przyciski akcji (Edycja/Usuń) */
.action-btn {
    border: none; background: none; cursor: pointer; font-size: 1rem; padding: 5px; opacity: 0.6; transition: 0.2s;
}
.action-btn:hover { opacity: 1; transform: scale(1.1); }
.edit-btn { color: var(--primary-blue); }
.delete-btn { color: var(--danger); }

/* MODAL KARIERY */
.career-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; 
    justify-content: center; align-items: center; z-index: 2000;
}
.career-modal-content {
    background: white; padding: 2rem; border-radius: 8px; width: 90%; max-width: 600px;
}
/* Poprawka dla układu 3 kolumn w formularzu kariery */
.career-form-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 15px;
}
/* --- ZDJĘCIE PROFILOWE --- */
.avatar-container {
    position: relative;
    width: 100px; height: 100px;
    margin-right: 15px;
}

/* Wygląd zdjęcia */
.avatar-img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover; /* Kluczowe: wycina środek zdjęcia */
    border: 3px solid #e7f1ff;
}

/* Domyślne kółko z inicjałami (jeśli brak zdjęcia) */
.avatar-placeholder {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--primary-blue);
    font-size: 2.5rem; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid #fff;
}

/* Przycisk edycji (Aparat) */
.btn-upload-photo {
    position: absolute; bottom: 0; right: 0;
    background: var(--primary-blue); color: white;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid white;
    font-size: 1rem; transition: 0.2s;
}
.btn-upload-photo:hover { background: var(--primary-hover); }

/* Przycisk usuwania (Kosz) */
.btn-delete-photo {
    position: absolute; top: 0; right: -5px;
    background: var(--danger); color: white;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 1px solid white;
    font-size: 0.8rem;
}
/* --- CUSTOMOWY DROPDOWN MIAST (Z NAGŁÓWKAMI) --- */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none; /* Domyślnie ukryte */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dropdown-header {
    background: #f1f3f5;
    color: #666;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 5px 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background-color: #e7f1ff; /* Jasnoniebieskie podświetlenie */
    color: var(--primary-blue);
}

/* Ukrywamy nagłówek, jeśli jest pierwszym elementem listy (opcjonalne, dla estetyki) */
.dropdown-header:first-child {
    border-top: none;
}
/* --- MULTI-LOKALIZACJA (DODATKOWE STYLE) --- */
.loc-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.loc-input-wrapper {
    position: relative;
    flex-grow: 1;
    width: 100%;
}

/* Styl dla inputa wewnątrz wrappera */
.loc-input-wrapper input {
    width: 100%;
    box-sizing: border-box; /* Ważne, żeby padding nie rozpychał */
}

/* Czerwony przycisk usuwania */
.btn-remove-loc {
    background: var(--danger);
    color: white;
    border: none;
    width: 42px; /* Trochę szerszy dla wygody */
    height: 42px; /* Wysokość dopasowana do standardowego inputa */
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    transition: 0.2s;
    flex-shrink: 0;
    margin-top: 1px; /* Mikrokorekta wyrównania */
}
.btn-remove-loc:hover { background: #c82333; }

/* Zielony przycisk dodawania */
.btn-add-loc {
    background: var(--success);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 5px;
    display: inline-block;
    transition: 0.2s;
}
.btn-add-loc:hover { background: #218838; }

/* Poprawka dla listy rozwijanej, żeby była NA WIERZCHU */
.custom-dropdown {
    border-color: var(--primary-blue);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    background: white;
}
/* --- MULTI-LOKALIZACJA (POPRAWIONE STYLE) --- */

/* Kontener pojedynczego wiersza (input + przycisk) */
.loc-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: stretch; /* Ważne: Rozciąga przycisk usuwania do wysokości inputa */
}

.loc-input-wrapper {
    position: relative;
    flex-grow: 1;
    width: 100%;
}

/* Stylizacja inputa - KOPIUJEMY STYL Z .form-group input */
.loc-input-wrapper input {
    width: 100%;
    padding: 0.8rem;       /* Taki sam padding jak w reszcie formularza */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
    background: #fff;
}

.loc-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Czerwony przycisk usuwania (Krzyżyk) */
.btn-remove-loc {
    background: var(--danger);
    color: white;
    border: none;
    width: 48px; /* Szerokość przycisku */
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0; /* Zapobiega zgniataniu przycisku */
}

.btn-remove-loc:hover {
    background: #bd2130;
}

/* Zielony przycisk dodawania (+ Dodaj miasto) */
.btn-add-loc {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    display: inline-block;
    transition: 0.2s;
    width: 100%; /* Opcjonalnie: na całą szerokość jak inne przyciski */
}

.btn-add-loc:hover {
    background: #218838;
}

/* Poprawka dla listy rozwijanej (Autocomplete) */
.custom-dropdown {
    border: 1px solid var(--primary-blue);
    border-top: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: white;
    border-radius: 0 0 4px 4px;
}
#authForm {
    display: none;        /* Domyślnie ukryty */
    margin: 2rem auto;    /* 2rem odstępu góra/dół, AUTO po bokach (to centruje) */
}
/* --- STYLE DLA PANELU KLUBU --- */

/* Nawigacja zakładek (Tabs) */
.tabs-nav {
    display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #eee;
    overflow-x: auto; /* Na telefony */
}
.tab-btn {
    padding: 12px 20px; border: none; background: none; font-size: 1rem;
    font-weight: 600; color: var(--text-grey); cursor: pointer;
    border-bottom: 3px solid transparent; transition: 0.3s;
}
.tab-btn:hover { color: var(--primary-blue); background: #f8f9fa; }
.tab-btn.active { color: var(--primary-blue); border-bottom-color: var(--primary-blue); }

/* Zawartość zakładek */
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Formularz wyszukiwania */
.search-box {
    background: #fdfdfd; padding: 20px; border: 1px solid #e0e0e0;
    border-radius: 8px; margin-bottom: 30px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px; align-items: end;
}

/* Wyniki wyszukiwania - GRID KART */
.results-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;
}
.player-card {
    background: white; border: 1px solid #eee; border-radius: 8px; padding: 20px;
    text-align: center; transition: 0.3s; position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.player-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-color: var(--primary-blue); }

.card-avatar {
    width: 80px; height: 80px; background: #eee; border-radius: 50%;
    margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: bold; color: #888; object-fit: cover;
    border: 3px solid #f8f9fa;
}
.pc-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 5px; color: #333; }
.pc-info { font-size: 0.9rem; color: #666; margin-bottom: 15px; line-height: 1.6; }
.pc-tag { display: inline-block; background: #e7f1ff; color: var(--primary-blue); padding: 3px 8px; border-radius: 4px; font-size: 0.8rem; margin: 2px; }

/* Przycisk Serduszka na karcie */
.btn-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    color: #ccc; /* Domyślny szary (pusty) */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding-top: 2px; /* Optyczna korekta */
    z-index: 10;
}

.btn-heart:hover {
    transform: scale(1.1);
    color: #ff6b6b;
}

/* Stan aktywny (Polubione) */
.btn-heart.active {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}