/* --- ZÁKLAD --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, sans-serif; }
body { background: #f5f7fa; color: #333; }

/* --- NAVBAR --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px; background: #0f172a; color: white;
    position: sticky; top: 0; z-index: 1000;
}
.navbar ul { display: flex; list-style: none; gap: 25px; }
.navbar a { color: white; text-decoration: none; font-weight: bold; }
.navbar a:hover { color: #38bdf8; }
.logo { font-size: 1.3rem; font-weight: bold; }

/* --- HERO --- */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(15,23,42,0.7), rgba(15,23,42,0.7)), 
                url("https://images.unsplash.com/photo-1605540436563-5bca919ae766") center/cover;
    color: white; display: flex; flex-direction: column; 
    justify-content: center; align-items: center; text-align: center;
}
.hero h1 { font-size: 3rem; margin-bottom: 10px; }
.hero p { font-size: 1.2rem; }

/* --- SEKCE A OVLÁDÁNÍ --- */
.section { padding: 60px 10%; }
.section h2 { margin-bottom: 30px; font-size: 2rem; }

.controls {
    display: flex; gap: 10px; align-items: center; background: #fff;
    padding: 10px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative; z-index: 100; margin-bottom: 20px; flex-wrap: wrap;
}
.controls input[type="text"] { padding: 10px; border-radius: 8px; border: 1px solid #cbd5e1; outline: none; font-size: 16px; }
#search-input { width: 180px; flex-shrink: 0; }
.location-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
}
#user-city-input {
    width: 100%;
    padding-right: 40px !important; /* Důležité: vytvoří místo pro emoji vpravo */
}

#gps-button {
    position: absolute;
    right: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
    user-select: none;
    z-index: 5;
}

#gps-button:hover {
    transform: scale(1.2);
}

#gps-button:active {
    transform: scale(0.9);
}

/* --- NAŠEPTÁVAČ --- */
#autocomplete-results {
    position: absolute; top: 100%; left: 0; right: 0; background: white;
    border: 1px solid #cbd5e1; border-radius: 0 0 8px 8px; z-index: 9999;
    display: none; box-shadow: 0 10px 15px rgba(0,0,0,0.2); max-height: 300px; overflow-y: auto;
}
#autocomplete-results div { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; color: #1e293b; cursor: pointer; }
#autocomplete-results div:hover { background: #f0f9ff; color: #0ea5e9; }

/* --- TLAČÍTKA --- */
.filter-buttons-wrapper { display: flex; gap: 5px; flex-shrink: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-buttons-wrapper::-webkit-scrollbar { display: none; }
.filter-buttons-wrapper button {
    padding: 10px 15px; cursor: pointer; background: #0f172a; color: white;
    border: none; border-radius: 8px; white-space: nowrap; transition: 0.2s; font-size: 0.9rem;
}

/* --- KARTY (AREÁLY) --- */
.areal-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
.areal { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); transition: box-shadow 0.3s ease; }
.areal:hover { box-shadow: 0 15px 30px rgba(0,0,0,0.2); }
.areal h3 { margin-bottom: 10px; }
.areal ul { list-style: none; }
.areal li { margin-bottom: 6px; }

/* --- DOPLŇKY --- */
.statistika { margin-top: 10px; padding: 8px; background: #f8fafc; border-radius: 6px; border-left: 4px solid #38bdf8; font-size: 0.95rem; }
.vzdalenost-tag { background: #e2e8f0; color: #475569; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; font-weight: bold; margin-left: 10px; display: inline-block; }
.web-link { display: inline-block; color: #0ea5e9; text-decoration: none; font-size: 0.9rem; font-weight: bold; border: 1px solid #e2e8f0; padding: 5px 12px; border-radius: 20px; transition: 0.2s; margin-top: 12px; }
.web-link:hover { background: #0ea5e9; color: white; }

.fronta-form { margin-top: 15px; display: flex; gap: 10px; }
.fronta-form input { flex: 1; padding: 6px; border: 1px solid #cbd5e1; border-radius: 4px; }
.fronta-form button { padding: 6px 12px; background: #0f172a; color: white; border: none; border-radius: 6px; cursor: pointer; }

/* --- MAPA & FOOTER --- */
#map-canvas { height: 500px; border-radius: 12px; z-index: 1; }
footer { background: #0f172a; color: white; text-align: center; padding: 20px; }

/* ====================================================== */
/* MOBILNÍ VERZE (POUZE PRO MOBILY)           */
/* ====================================================== */
@media (max-width: 768px) {
    /* Navbar - skrytí menu nebo srovnání pod sebe */
    .navbar { padding: 15px 20px; flex-direction: column; gap: 10px; }
    .navbar ul { gap: 15px; font-size: 0.9rem; }

    /* Hero sekce - zmenšení textu */
    .hero { height: 50vh; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; padding: 0 10px; }

    /* Sekce - menší paddingy */
    .section { padding: 30px 5%; }
    .section h2 { font-size: 1.5rem; text-align: center; }

    /* Controls - nejdůležitější změna */
    .controls { flex-direction: column; align-items: stretch; padding: 15px; }
    #search-input { width: 100% !important; }
    .location-wrapper { width: 100%; }

    /* Mapa - snížení výšky, aby nepřekážela */
    #map-canvas { height: 300px; margin-bottom: 20px; }

    /* Karty - srovnání na střed */
    .areal-list { grid-template-columns: 1fr; gap: 15px; }
    .areal { width: 100%; max-width: none; }
    
    /* Tlačítka filtrů - scrollování do boku */
    .filter-buttons-wrapper {
        justify-content: flex-start;
        width: 100%;
        padding-bottom: 10px;
    }
}