:root {
    /* Modern color palette - Agricultural tech inspired */
    --primary-color: #136b53;      /* Brighter Deep emerald for better dark mode visibility */
    --secondary-color: #1a7f5f;    /* Forest green */
    --accent-color: #00d4aa;       /* Bright cyan-green */
    --warning-color: #ff6b35;      /* Modern orange */
    --info-color: #00bcd4;         /* Tech cyan */
    --success-color: #4caf50;      /* Fresh green */
    --danger-color: #f44336;       /* Alert red */

    /* Neutral colors */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: var(--gray-50);
    --bg-tertiary: #f0fdf9;
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-light: #ffffff;
    --text-muted: var(--gray-500); /* Bootstrap text-muted */
    --border-color: var(--gray-200);
    --shadow-color: rgba(15, 76, 58, 0.08);
    --shadow-strong: rgba(15, 76, 58, 0.15);

    /* Footer specific - Light */
    --footer-bg: var(--gray-900);
    --footer-text: var(--gray-400);
    --footer-link-color: var(--accent-color);
}

[data-theme="dark"] {
    /* Dark theme */
    --bg-primary: #212121;          /* Darker primary background */
    --bg-secondary: #2c2c2c;        /* Slightly lighter secondary background */
    --bg-tertiary: #3a3a3a;         /* For card contrast */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-light: #ffffff;
    --text-muted: var(--gray-400);  /* Brighter muted text */
    --border-color: #444444;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-strong: rgba(0, 0, 0, 0.5);

    /* ----------------------------------------------------------------- */
    /* --- ZÁSADNÍ OPRAVY PRO DARK MODE: PŘEPSÁNÍ BOOTSTRAP TŘÍD ----- */
    /* ----------------------------------------------------------------- */

    /* 1. Barvy pozadí */
    .bg-light,
    .bg-white {
        background-color: var(--bg-secondary) !important;
    }
    .card {
        background-color: var(--bg-primary); /* Card background in dark mode */
        border-color: var(--border-color) !important;
    }
    .bg-tertiary,
    .card-header {
        background-color: var(--bg-tertiary) !important; /* Secondary card color */
    }
    .bg-secondary-subtle {
        background-color: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
    }

    /* 2. Barvy textu */
    .text-muted {
        color: var(--text-muted) !important;
    }
    .text-secondary {
        color: var(--text-secondary) !important;
    }
    /* Zajištění kontrastu textu s novou primární barvou */
    .text-primary {
        color: var(--text-primary) !important;
    }

    /* 3. Seznamy a ohraničení */
    .list-group-item {
        background-color: transparent !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary);
    }

    /* 4. Speciální prvky */
    .border-primary-custom {
        border-color: var(--accent-color) !important; /* Viditelné ohraničení */
    }

    /* Map fix: Invert colors for the embedded map to match dark theme */
    .invert-dark-mode {
        filter: invert(0.9) hue-rotate(180deg);
    }

    /* Footer specific - Dark */
    --footer-bg: var(--gray-800);
    --footer-text: var(--gray-300);
    --footer-link-color: var(--accent-color);
}

/* ----------------------------------------------------------------- */
/* --- CUSTOM SCROLLBAR STYLES (OPRAVA DLE POŽADAVKU) ------------- */
/* ----------------------------------------------------------------- */

/* Global - pro Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 4px; /* Nejužší šířka */
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary); /* Lehčí pozadí */
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary-color); /* Téma zelená */
    border-radius: 20px;
}

/* Global - pro Firefox */
html {
    scrollbar-width: thin; /* Nastaví šířku scrollbaru na 'thin' (užší) */
    scrollbar-color: var(--primary-color) var(--bg-secondary); /* Palec / Pozadí */
    overflow-y: scroll;
}

/* ----------------------------------------------------------------- */
/* --- ZBYTEK GLOBÁLNÍCH STYLŮ ------------------------------------- */
/* ----------------------------------------------------------------- */

/* Prevent flash of unstyled content (FOUC) */
html:not([data-theme]) {
    visibility: hidden;
}

html[data-theme] {
    visibility: visible;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar Styles*/
.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px var(--shadow-color), 0 1px 2px var(--shadow-strong);
    padding: 0.25rem 0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 50px; /* ZMENŠENO */
}

.navbar-custom .container {
    max-width: 1400px;
    padding: 0 1.5rem;
}

.navbar-brand {
    font-weight: 800;
    color: var(--text-light) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Figtree', sans-serif;
}

.navbar-brand:hover {
    color: var(--accent-color) !important;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-main {
    font-size: 1.4rem; /* ZVĚTŠENO */
    font-weight: 900;
    letter-spacing: -0.025em;
    text-transform: uppercase;
}

.brand-sub {
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.05em;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* Navigation spacing - smaller gaps, larger links */
.navbar-nav {
    gap: 0.1rem;
}

.navbar-nav .nav-link {
    color: var(--text-light) !important;
    font-weight: 600;
    padding: 0.4rem 0.8rem !important;
    border-radius: 0.4rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    position: relative;
    white-space: nowrap;
    font-family: 'Figtree', sans-serif;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color) !important; /* Vylepšený kontrast */
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #00b894 100%);
    color: var(--primary-color) !important;
    font-weight: 700;
}

.nav-link.restaurant-link {
    background: linear-gradient(135deg, var(--warning-color) 0%, #fd79a8 100%) !important;
    color: var(--text-light) !important;
    margin-left: 0.1rem !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    font-family: 'Figtree', sans-serif;
}

.nav-link.restaurant-link:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4) !important;
}

/* Controls Section - reduced gap to 0.5rem (OPRAVA DLE POŽADAVKU) */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* ZMENŠENO */
}

/* Theme Toggle - Larger icon */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(10deg);
}

/* --- Language Dropdown (ODSTRANĚNO Z HTML, CSS PONECHÁNO PRO JISTOTU) --- */
.language-dropdown {
    position: relative;
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow-strong);
    padding: 0.5rem 0;
    z-index: 1000;
    min-width: 120px;
    display: none;
    margin-top: 0.5rem;
}

.language-menu.show {
    display: block;
}

.language-menu a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.language-menu a:hover {
    background-color: var(--bg-secondary);
}

.language-menu img {
    margin-right: 0.75rem;
}
/* ----------------------------------------------------------------- */

/* ----------------------------------------------------------------- */
/* --- FOOTER STYLES (OPRAVENO A ZÚŽENO DLE POŽADAVKU) ------------- */
/* ----------------------------------------------------------------- */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 1rem 0; /* ZÚŽENO - sníženo na 1rem */
    margin-top: auto;
    font-size: 0.85rem; /* ZMENŠENÍ FONTU */
    transition: background-color 0.3s, color 0.3s;
}

footer a {
    color: var(--footer-link-color);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--text-light);
}

footer .footer-title {
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.95rem; /* ZMENŠENÍ NADPISU */
    margin-bottom: 0.4rem; /* ZMENŠENÍ MEZERY */
}

footer .list-unstyled {
    padding: 0;
    list-style: none;
}

footer .list-unstyled li {
    margin-bottom: 0.1rem; /* VÝRAZNÉ ZMENŠENÍ MEZERY MEZI POLOŽKAMI */
    line-height: 1.4;
}

footer .list-unstyled a {
    color: var(--footer-text);
    font-size: 0.85rem; /* ZMENŠENÍ FONTU */
}

footer .list-unstyled a:hover {
    color: var(--footer-link-color);
}

/* Úprava sociálních ikon - zmenšení mezery */
.social-links-modern .social-icon {
    font-size: 1.1rem; /* Mírné zmenšení ikony */
    color: var(--footer-text);
    transition: color 0.2s;
    margin-right: 0; /* Odstranění pravé mezery, používá se 'gap' ve flexu */
}

.social-links-modern .social-icon:hover {
    color: var(--footer-link-color);
}

footer .copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.15); /* Mírně viditelnější border */
    padding-top: 0.75rem;
    margin-top: 0.5rem; /* Větší mezera od sekcí, aby se oddělily */
    text-align: center;
    font-size: 0.7rem; /* ZMENŠENÍ COPYRIGHT TEXTU */
    color: var(--footer-text);
    line-height: 1.3;
}

/* Styly pro zarovnání textu copyrightu a odkazů */
.copyright-links {
    margin-top: 0.2rem !important; /* Mírný odstup pro oddělení řádků */
}

@media (max-width: 575.98px) {
    /* Na extra malých obrazovkách se sociální ikonky zarovnají na střed */
    .social-links-modern {
        justify-content: center;
    }
}
/* ----------------------------------------------------------------- */


/* Utility Classes */

/* --- VYLEPŠENÝ TEXTOVÝ GRADIENT --- */
.text-gradient {
    /* Používá sytější, kontrastnější varianty primární a akcentní barvy. */
    /* Zajišťuje dobrou viditelnost na světlém i tmavém pozadí. */
    background: linear-gradient(90deg, #0a3a2d, #00d4aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}
/* ---------------------------------- */

.text-primary-custom {
    color: var(--primary-color) !important;
}

.border-primary-custom {
    border-color: var(--primary-color) !important;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: var(--text-light);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Figtree', sans-serif;
}

.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-strong);
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* Třída přidaná pro 404.html */
.btn-outline-primary-custom {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    background-color: transparent;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Figtree', sans-serif;
}

.btn-outline-primary-custom:hover {
    color: var(--text-light);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-strong);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, #00b894 100%);
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-strong);
}

/* --- 404 Page Styles (přesunuto z inline CSS) --- */
.error-code.display-1 {
    font-size: 8rem;
    line-height: 1;
    text-shadow: 2px 2px 4px var(--shadow-color);
}

@media (max-width: 768px) {
    .error-code.display-1 {
        font-size: 4rem;
    }
}
/* -------------------------------------------------- */


/* --- Jidelna.html & General Card Styles --- */

/* Ensures card backgrounds and text colors respect dark mode variables */
.card {
    color: var(--text-primary);
}

/* --- PDF Embed Styles --- */

/* Responsive PDF box with aspect-ratio fallback and max height */
.ratio-box {
    position: relative;
    width: 100%;
    padding-top: 130%; /* Aspect ratio placeholder for vertical PDF */
    border: 1px solid var(--border-color); /* Dark mode compatible border */
    border-radius: .75rem;
    overflow: hidden;
    background: var(--bg-secondary); /* Dark mode compatible background */
    height: auto; /* Ensures it respects padding-top and max-height */
}

/* Class to enforce max height (1220px) on the PDF container */
.ratio-box-1220 {
    max-height: 1220px;
}

/* Fallback for older browsers without aspect-ratio support */
.ratio-box embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Allergens Number Badge Styles --- */

.allergen-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}

@media (min-width: 640px) {
    .allergen-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) {
    .allergen-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.allergen-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.a-num {
    background-color: var(--primary-color);
    color: var(--text-light);
    font-weight: 700;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-right: 0.75rem;
}