/* Základné nastavenia */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

body { background-color: #f8fafc; color: #1e293b; }

/* Navigácia */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 50px; background: white; border-bottom: 1px solid #e2e8f0;
}
.logo { font-size: 1.6rem; font-weight: 800; color: #0b2b5e; }
.logo span { color: #f97316; }
.nav-links { list-style: none; display: flex; gap: 25px; }
.nav-links a { text-decoration: none; color: #1e293b; font-weight: 600; padding: 5px 0;}
.nav-links a.active { color: #f97316; border-bottom: 3px solid #f97316; }
.btn-login { background: #0b2b5e; color: white; border: none; font-weight: 700; cursor: pointer; padding: 10px 20px; border-radius: 5px; }

/* Hero Sekcia */
.hero-section {
    position: relative;
    background-image: url('cover.jpg');
    background-size: cover; background-position: center;
    height: 450px; display: flex; align-items: center; justify-content: center;
    text-align: center; color: white;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 43, 94, 0.6);
}
.hero-content { position: relative; z-index: 1; max-width: 800px; padding: 20px; }
.hero-content h1 { font-size: 3rem; font-weight: 800; margin-bottom: 20px; }

.hero-subtitle { margin-bottom: 35px; font-size: 1.1rem; line-height: 1.5; }

.btn-primary { background: #f97316; color: white; padding: 12px 25px; border: none; border-radius: 5px; font-weight: 700; cursor: pointer; margin-right: 10px; }
.btn-secondary { background: white; color: #0b2b5e; padding: 12px 25px; border: none; border-radius: 5px; font-weight: 700; cursor: pointer; }

/* Layout - POD SEBA */
.main-content {
    display: flex; flex-direction: column; gap: 40px;
    max-width: 1250px; margin: 40px auto; padding: 0 20px;
}
.tournaments-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 20px; 
}

/* FILTRE A ZOZNAM */
.filters-section { 
    display: flex; justify-content: space-between; align-items: center; 
    background: white; padding: 20px; border-radius: 10px; border: 1px solid #e2e8f0; 
    flex-wrap: wrap; gap: 15px; 
}
.filters { display: flex; gap: 15px; flex-wrap: wrap;}
.filters select { padding: 10px; border-radius: 5px; border: 1px solid #ccc; font-weight: bold; color: #1e293b; outline: none; cursor: pointer;}
.tournaments-list { display: grid; grid-template-columns: 1fr; gap: 20px; } 

/* Karta Turnaja */
.card {
    background: white; border: 1px solid #e2e8f0; border-radius: 10px;
    overflow: hidden; display: flex; flex-direction: column;
}
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; }

/* SKUPINA ODZNAKOV (PROFI/AMATER + STEEL/SOFT) */
.card-badges { display: flex; gap: 5px; }
.badge { padding: 3px 10px; border-radius: 5px; color: white; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; }

/* --- FARBY PODĽA TYPU TURNAJA --- */
/* 1. Oficiálna súťaž (Zlatá/Oranžová) */
.card.oficialny .badge, .badge.oficialny { background: #f59e0b; }
.card.oficialny .card-date-bar { background: #f59e0b; }
.card.oficialny .btn-detail { background: #f59e0b; }
.calendar-day.has-oficialny { background: #f59e0b; color: white; cursor: pointer; box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2); }
.day-item-btn.oficialny { background-color: #f59e0b; }

/* 2. Klubová / Mestská liga (Tmavomodrá) */
.card.liga .badge, .badge.liga { background: #0b2b5e; }
.card.liga .card-date-bar { background: #0b2b5e; }
.card.liga .btn-detail { background: #0b2b5e; }
.calendar-day.has-liga { background: #0b2b5e; color: white; cursor: pointer; box-shadow: 0 4px 6px rgba(11, 43, 94, 0.2); }
.day-item-btn.liga { background-color: #0b2b5e; }

/* 3. Amatérsky / Open (Smaragdová zelená) */
.card.open .badge, .badge.open { background: #10b981; }
.card.open .card-date-bar { background: #10b981; }
.card.open .btn-detail { background: #10b981; }
.calendar-day.has-open { background: #10b981; color: white; cursor: pointer; box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2); }
.day-item-btn.open { background-color: #10b981; }

/* Ak sú v jeden deň rôzne typy turnajov (Fialový gradient) */
.calendar-day.has-multiple { 
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); 
    color: white; 
    cursor: pointer; 
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.3);
}

.calendar-day.has-oficialny:hover, .calendar-day.has-liga:hover, .calendar-day.has-open:hover, .calendar-day.has-multiple:hover {
    filter: brightness(1.1); transform: scale(1.05);
}

/* NOVÉ FARBY PRE STEEL A SOFT */
.badge.steel { background: #475569; } /* Tmavosivá */
.badge.soft { background: #0ea5e9; } /* Tyrkysová/Modrá */

.card-date-bar { padding: 8px 15px; color: white; font-size: 0.85rem; font-weight: 600; }
.card.profi .card-date-bar { background: #f97316; }
.card.amater .card-date-bar { background: #0b2b5e; }

.card-body { padding: 15px; display: flex; justify-content: space-between; gap: 10px; }
.card-info { font-size: 0.9rem; line-height: 1.5; }
.card-thumb { width: 90px; height: 70px; border-radius: 5px; object-fit: contain; background-color: #f1f5f9; }

.btn-detail { margin: 10px 15px 15px; padding: 10px; border: none; border-radius: 5px; color: white; font-weight: 700; cursor: pointer; }
.card.profi .btn-detail { background: #f97316; }
.card.amater .btn-detail { background: #0b2b5e; }

/* Kalendár */
.calendar-section { 
    background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 30px; 
    width: 100%; max-width: 700px; margin: 0 auto;
}
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: #0b2b5e;}
.calendar-header button { background: #f1f5f9; border: none; font-size: 1.2rem; cursor: pointer; padding: 5px 15px; border-radius: 5px; font-weight: bold; }
.calendar-header button:hover { background: #e2e8f0; }

.calendar-days-names { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: bold; margin-bottom: 10px; color: #64748b;}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 8px; }
.calendar-day { padding: 12px 0; font-size: 1rem; border-radius: 5px; cursor: default; }

.calendar-day.has-amater { background: #0b2b5e; color: white; cursor: pointer; box-shadow: 0 4px 6px rgba(11, 43, 94, 0.2); }
.calendar-day.has-profi { background: #f97316; color: white; cursor: pointer; box-shadow: 0 4px 6px rgba(249, 115, 22, 0.2); }
.calendar-day.has-both { 
    background: linear-gradient(135deg, #0b2b5e 50%, #f97316 50%); 
    color: white; 
    cursor: pointer; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.calendar-day.has-amater:hover, .calendar-day.has-profi:hover, .calendar-day.has-both:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* ŠEDÝ KALENDÁR PRE MINULÉ TURNAJE (Doplnené) */
.calendar-day.is-past {
    background: #cbd5e1 !important; 
    color: #64748b !important;
    box-shadow: none !important;
}

.calendar-day.is-past:hover {
    filter: brightness(0.95);
    transform: scale(1.02);
}

.day-list-items { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.day-item-btn { padding: 15px; border: none; border-radius: 8px; color: white; font-weight: 700; cursor: pointer; text-align: left; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
.day-item-btn.amater { background-color: #0b2b5e; }
.day-item-btn.profi { background-color: #f97316; }
.day-item-btn:hover { opacity: 0.9; transform: translateX(5px); }

/* Modaly a Formulár */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.hidden { display: none !important; }
.modal-content { background: white; padding: 30px; border-radius: 15px; width: 90%; max-width: 650px; position: relative; max-height: 90vh; overflow-y: auto; }

.close-btn { 
    position: absolute; top: -15px; right: -15px; font-size: 2.2rem; font-weight: bold; 
    color: #1e293b; cursor: pointer; z-index: 10; line-height: 1; 
    background: white; border-radius: 50%; width: 45px; height: 45px; 
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: 0.2s;
}
.close-btn:hover { color: #f97316; transform: scale(1.1); }

.tournament-form .form-group { margin-bottom: 15px; text-align: left; }
.tournament-form label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 5px; }
.tournament-form input, .tournament-form select, .tournament-form textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; }

.split-textarea { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-submit { background: #f97316; color: white; padding: 15px; border: none; border-radius: 5px; width: 100%; font-weight: 700; cursor: pointer; }

.detail-poster { 
    width: 100%; max-height: 350px; object-fit: contain; 
    border-radius: 10px; margin: 0 0 15px 0; display: none; background-color: #f8fafc;
}

.detail-info { text-align: left; }
.detail-info h4 { margin-top: 15px; color: #f97316; border-bottom: 1px solid #eee; padding-bottom: 5px; }

/* OPRAVA PRE MOBILNÉ ZARIADENIA (Media Queries) */
@media screen and (max-width: 768px) {
    /* Navigácia */
    .navbar {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap; /* Zalamovanie odkazov, ak ich bude viac */
    }

    .btn-login {
        width: 100%; /* Tlačidlo zaberie celú šírku */
        text-align: center;
    }

    /* Hero sekcia */
    .hero-content h1 {
        font-size: 2rem;
    }

    .buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        margin-right: 0;
    }

    /* Filtre */
    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        flex-direction: column;
    }

    /* Formulár rozdelené polia */
    .split-textarea {
        grid-template-columns: 1fr; /* Na mobile pod sebou */
    }

    /* NOVÉ: Location Grid pre mobil zbalíme do stĺpca */
    .location-grid {
        grid-template-columns: 1fr !important;
    }
}
/* Vizuál čistej "plávajúcej" mapy */
#slovakia-map {
    background-color: transparent !important; /* Priehľadné pozadie */
    border: none !important;
}

/* Skrytie tlačidiel + a - pre čistejší dizajn */
.leaflet-control-zoom {
    display: none !important; 
}

/* Bublina (Tooltip) pri prejdení myšou */
.custom-tooltip {
    background-color: #1e293b;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 700;
    padding: 6px 12px;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Farba šípky pod bublinou */
.custom-tooltip::before {
    border-top-color: #1e293b !important; 
}

/* --- AUTENTIFIKÁCIA A KLUBY --- */
.nav-auth { display: flex; align-items: center; gap: 15px; }
#user-profile { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #0b2b5e; }
.btn-logout { background: #ef4444; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: bold; }
.btn-logout:hover { background: #dc2626; }

.auth-modal { max-width: 400px; text-align: center; }
.auth-switch { margin-top: 20px; font-size: 0.9rem; color: #64748b; }
.auth-switch a { color: #f97316; font-weight: 700; text-decoration: none; }

.card-actions { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0 15px 15px; }
.btn-edit { background: #64748b; color: white; border: none; padding: 10px; border-radius: 5px; font-weight: 700; cursor: pointer; text-transform: uppercase; }
.btn-edit:hover { background: #475569; }

@media screen and (max-width: 768px) {
    .nav-auth { flex-direction: column; width: 100%; gap: 10px; }
    #user-profile { justify-content: center; width: 100%; padding-top: 10px; border-top: 1px solid #e2e8f0; }
}
.btn-delete {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 5px;
}
.btn-delete:hover {
    background: #991b1b;
}

/* Úprava kontajnera akcií, aby boli pod sebou */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
}