/* ==========================================
   ZÁKLADNÉ PREMENNÉ A NASTAVENIA
   ========================================== */
:root {
    --primary: #2563eb;
    --accent: #f59e0b;
    --success: #10b981;
    --bg: #f8fafc;
    --text: #1e293b;
    --box-bg: #ffffff;
    --card-shadow: rgba(0,0,0,0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* MODERNEJŠÍ TMAVÝ REŽIM */
body.dark-mode { 
    --bg: #0f172a;           
    --text: #f1f5f9;         
    --box-bg: #1e293b;       
    --primary: #1e40af;
    --card-shadow: rgba(0,0,0,0.4);
}

body.dark-mode header {
    background: #0f172a !important; 
}

/* ZÁKLADNÝ RESET */
* {
    box-sizing: border-box;
}

body { 
    font-family: 'Poppins', 'Segoe UI', sans-serif; 
    background-color: var(--bg); 
    margin: 0; 
    color: var(--text); 
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* ==========================================
   HLAVIČKA A NAVIGÁCIA
   ========================================== */
header { 
    background: linear-gradient(135deg, var(--primary), #1d4ed8); 
    color: white; 
    padding: 15px 0; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-bottom {
    text-align: center;
    width: 100%;
}

.header-bottom p {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.9;
    font-weight: 300;
}

#logo {
    margin: 0;
    font-size: 1.3em;
    letter-spacing: 1px;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==========================================
   TLAČIDLÁ
   ========================================== */
button { 
    padding: 12px 24px; 
    background: linear-gradient(135deg, var(--accent), #d97706); 
    color: white; 
    border: none; 
    border-radius: var(--border-radius); 
    cursor: pointer; 
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

button:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.btn-secondary { 
    background: rgba(255,255,255,0.15); 
    border: 1px solid rgba(255,255,255,0.3); 
    padding: 8px 12px;
    font-size: 0.85em;
}

.btn-primary { 
    background: #27ae60; 
    padding: 8px 15px;
    font-size: 0.85em;
}

.btn-accent { 
    background: #e67e22; 
    padding: 8px 15px;
    font-size: 0.85em;
}
/* Oprava vzhľadu tlačidla Kontakt */
.nav-menu a.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4b5563; /* rovnaká farba ako ostatné secondary */
    color: white !important;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9em;
}

/* Hover efekt ako ostatné tlačidlá */
.nav-menu a.btn-secondary:hover {
    background: #374151;
}

/* ==========================================
   HLAVNÝ VYHĽADÁVACÍ BOX
   ========================================== */
.box { 
    max-width: 900px; 
    margin: -25px auto 20px; 
    background: var(--box-bg); 
    padding: 25px; 
    border-radius: var(--border-radius); 
    box-shadow: 0 10px 30px var(--card-shadow);
    text-align: center;
    position: relative;
    z-index: 10;
    width: 92%;
}

/* FORMULÁROVÉ PRVKY */
input, select, textarea { 
    padding: 14px; 
    margin: 8px 0; 
    border: 2px solid #e2e8f0; 
    border-radius: var(--border-radius); 
    width: 100%; 
    box-sizing: border-box;
    font-size: 16px; 
    background-color: var(--box-bg);
    color: var(--text);
    transition: var(--transition);
}

/* Desktop layout IBA pre hlavné vyhľadávacie polia */
@media (min-width: 601px) {
    #hladajCo, #hladajKde {
        width: calc(48% - 10px) !important;
        display: inline-block !important;
        margin: 8px 5px !important;
    }
}

input:focus {
    border-color: var(--primary);
    outline: none;
}

/* CENA A FILTRE - CENTROVANIE */
.filter-extra {
    display: flex;
    justify-content: center; /* Toto vráti cenu do stredu */
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    width: 100%;
}

#maxCena {
    width: 100px !important;
    min-width: 100px !important;
    border: 2px solid var(--accent) !important;
    color: var(--accent);
    font-weight: bold;
    text-align: center;
    margin: 0 !important; /* Odstráni bočné okraje, aby to neuhýbalo */
}

/* ==========================================
   MAPA A KATEGÓRIE
   ========================================== */
.kategorie-wrapper { width: 100%; max-width: 900px; margin: 0 auto; }
.kategorie-scroll { 
    display: flex; 
    overflow-x: auto; 
    gap: 10px; 
    padding: 15px; 
    scrollbar-width: none; 
}
.kategorie-scroll::-webkit-scrollbar { display: none; }

.kat-item { 
    flex: 0 0 auto; 
    background: var(--box-bg); 
    padding: 10px 18px; 
    border-radius: 25px; 
    cursor: pointer; 
    border: 1px solid #e2e8f0; 
    font-size: 0.9em;
    font-weight: 500;
}

#map { 
    height: 350px;
    width: 92%;
    max-width: 900px;
    margin: 10px auto; 
    border-radius: var(--border-radius); 
    border: 2px solid var(--accent);
    box-shadow: 0 8px 25px var(--card-shadow); 
    z-index: 1;
    display: block;
}

.cluster-obal {
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    border: 3px solid white;
    width: 40px;
    height: 40px;
    font-size: 14px;
}

/* ==========================================
   MODÁLNE OKNÁ (VŽDY SVETLÉ FORMULÁRE)
   ========================================== */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 10000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.7); 
    backdrop-filter: blur(5px);
    overflow-y: auto; 
    padding: 20px 10px;
}

/* Biely podklad pre modál bez ohľadu na režim */
.modal-obsah { 
    background-color: #ffffff !important; /* Vynútená biela */
    margin: 30px auto; 
    padding: 25px; 
    border-radius: 15px; 
    width: 95%; 
    max-width: 500px; 
    color: #1e293b !important; /* Vynútená tmavomodrá (text) */
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Zabezpečíme, aby všetky texty v modáli boli tmavé */
.modal-obsah h2, 
.modal-obsah h3, 
.modal-obsah label, 
.modal-obsah p,
.modal-obsah span {
    color: #1e293b !important;
}

/* Oprava vstupov v modáli - svetlé pozadie pre políčka */
.modal-obsah input, 
.modal-obsah select, 
.modal-obsah textarea {
    width: 100% !important;
    margin: 10px 0 !important;
    background-color: #f8fafc !important; /* Svetlošedé pozadie políčka */
    color: #1e293b !important;            /* Tmavý text v políčku */
    border: 2px solid #e2e8f0 !important;
}

/* Tlačidlo zavrieť (X) musí byť tiež tmavé */
.close {
    color: #64748b;
}
.close:hover {
    color: #1e293b;
}

/* ==========================================
   VÝSLEDKY A RESPONZIVITA
   ========================================== */
#vysledky { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 20px; 
    max-width: 900px; 
    margin: 20px auto; 
    padding: 0 15px;
}

.karta { 
    background: var(--box-bg); 
    border-radius: var(--border-radius); 
    padding: 20px; 
    box-shadow: 0 5px 15px var(--card-shadow); 
    border-top: 4px solid var(--accent);
    transition: var(--transition);
}

@media (max-width: 600px) {
    .header-top { flex-direction: column; text-align: center; gap: 15px; }
    .nav-menu { width: 100%; justify-content: center; }
    .box { padding: 15px; margin-top: 10px; width: 95%; }
    #mapa { height: 280px; width: 95%; }
}

.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 30px 0;
}

.pagination button {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.pagination button:hover {
    background: var(--border);
}

.pagination .active {
    background: var(--active);
    color: white;
    border-color: var(--active);
}

/* Mobilná verzia stránkovania */
@media (max-width: 480px) {
    .pagination {
        gap: 4px;
        margin: 20px 0;
    }

    .pagination button {
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 6px;
    }

    .pagination .dots {
        font-size: 13px;
        padding: 6px 2px;
    }
}

/* Fade animácia pre výsledky */
.fade-out {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.25s ease;
}

/* ============================================
   STATUS TLAČIDLÁ – VOĽNÝ / OBSADENÝ
   ============================================ */

.statusBtn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.6;          /* neaktívne tlačidlo je bledé */
    transition: 0.2s;
}

/* 🔵 VOĽNÝ – aktívny */
.volnyBtn.active {
    background: #27ae60;   /* zelená */
    color: white;
    opacity: 1;
}

/* 🔴 OBSADENÝ – aktívny */
.obsadenyBtn.active {
    background: #e74c3c;   /* červená */
    color: white;
    opacity: 1;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }