@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600;700;800&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-color: #1f2937;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #cbebff 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html,
body {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    font-family: 'Raleway', sans-serif;
    background: var(--bg-gradient);
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #b3e4f0 !important; /* Světle modré pozadí pro celou mapu */
}

/* Světle modré pozadí pro celý Leaflet container */
.leaflet-container {
    background-color: #b3e4f0 !important;
    background: #b3e4f0 !important;
}

/* Světle modré pozadí pro všechny tile vrstvy */
.leaflet-tile-container img {
    background-color: #b3e4f0;
}

/* Skrytí prázdných tile placeholderů */
.leaflet-tile-container .leaflet-tile {
    background-color: #b3e4f0;
}

/* DŮLEŽITÉ: Vyloučení markerPane z bílého fill - markery musí mít své vlastní barvy */
/* Všechny circle elementy v markerPane zachovávají svou původní barvu */
.leaflet-marker-pane circle,
.leaflet-marker-pane path {
    /* NEPOUŽÍVAT bílé fill pro markery */
}

/* Zajištění správných barev pro markery v markerPane - VYSOKÁ PRIORITA */
.leaflet-marker-pane circle[fill="#ef4444"],
.leaflet-marker-pane path[fill="#ef4444"] {
    fill: #ef4444 !important;
    fill-opacity: 1 !important;
}

.leaflet-marker-pane circle[fill="#3b82f6"],
.leaflet-marker-pane path[fill="#3b82f6"] {
    fill: #3b82f6 !important;
    fill-opacity: 1 !important;
}

.leaflet-marker-pane circle[fill="#10b981"],
.leaflet-marker-pane path[fill="#10b981"] {
    fill: #10b981 !important;
    fill-opacity: 1 !important;
}

/* Zajištění bílého fill pro polygon ČR - pouze pro polygon vrstvy, NE pro markery */
/* Vyloučení markerPane - markery musí mít své vlastní barvy */
.leaflet-pane:not(.leaflet-marker-pane) .leaflet-zoom-animated path[stroke="transparent"],
.leaflet-pane:not(.leaflet-marker-pane) .leaflet-zoom-animated path[stroke-width="0"],
.leaflet-pane:not(.leaflet-marker-pane) .leaflet-zoom-animated path:not([stroke]):not([r]):not([fill="#ef4444"]):not([fill="#3b82f6"]):not([fill="#10b981"]),
.leaflet-pane:not(.leaflet-marker-pane) svg path[stroke="transparent"],
.leaflet-pane:not(.leaflet-marker-pane) svg path[stroke-width="0"],
.leaflet-pane:not(.leaflet-marker-pane) svg path:not([stroke]):not([r]):not([fill="#ef4444"]):not([fill="#3b82f6"]):not([fill="#10b981"]) {
    fill: #ffffff !important;
    fill-opacity: 1 !important;
}

.game-ui {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px 30px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    text-align: center;
    transition: all 0.3s ease;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.round-info {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 600;
}

.game-ui h2 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}

#currentCityName {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 10px 0;
    min-height: 40px;
    text-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#feedbackMessage {
    font-size: 1rem;
    margin-bottom: 20px;
    min-height: 24px;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out;
}

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

.feedback-correct {
    color: var(--success-color) !important;
    font-weight: 700;
    animation: pulseSuccess 0.5s ease-out;
}

.feedback-incorrect {
    color: var(--error-color) !important;
    font-weight: 700;
    animation: shake 0.5s ease-out;
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* --- Controls Row --- */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

.game-ui button {
    padding: 10px 24px;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 12px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.game-ui button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.game-ui button:hover::before {
    width: 300px;
    height: 300px;
}

.game-ui button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.game-ui button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.game-ui button:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.game-ui button:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.score-container {
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.game-ui .score {
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.high-score {
    font-size: 0.85rem;
    color: #64748b;
    margin-left: 8px;
    font-weight: 500;
}

/* --- Toggle Switch --- */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

/* --- Animations --- */
@keyframes scorePop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        color: var(--success-color);
    }

    100% {
        transform: scale(1);
    }
}

.scorePop {
    animation: scorePop 0.4s ease-out;
}

/* Animace pro toggle switch */
.switch input:checked + .slider {
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

/* Animace pro round info */
.round-info {
    animation: fadeIn 0.3s ease-out;
}

/* Hover efekt pro toggle */
.toggle-container:hover {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .game-ui {
        width: 95%;
        padding: 15px;
        top: 10px;
    }

    .game-ui h2 {
        font-size: 1.1rem;
    }

    #currentCityName {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .controls-row {
        flex-direction: column;
        gap: 15px;
    }

    .toggle-container {
        order: -1;
        margin-bottom: 5px;
    }
}