/* ================================================
   global.css – Trybbe.cz
   Sdílené styly pro header, navigaci a dark mode
   ================================================ */

/* Google Fonts jsou načítány přes <link> v HTML */

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body */
body {
    font-family: Arial, Helvetica, sans-serif;
    color: #111;
    background: linear-gradient(-45deg, #f8fafc, #e0f2fe, #c7d2fe, #e0e7ff);
    background-size: 400% 400%;
    animation: lightGradient 12s ease infinite;
    transition: background 0.8s ease, color 0.8s ease;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

@keyframes lightGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Fade overlay (dark mode transition) */
#fadeOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 999;
}

/* ── HEADER ── */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background 0.8s ease, border-color 0.8s ease,
        box-shadow 0.8s ease, color 0.8s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
    transition: color 0.8s ease;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #111;
    font-weight: 700;
    font-size: 24px;
    transition: color 0.8s ease;
}

.logo-box {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    font-family: 'Bodoni Moda', serif;
    transition: transform 0.3s;
    overflow: hidden;
}

.logo-box:hover {
    transform: scale(1.05);
}

.logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Nav */
nav {
    display: flex;
    gap: 30px;
    font-size: 18px;
}

nav a {
    text-decoration: none;
    color: #111;
    position: relative;
    font-weight: 500;
    transition: color 0.8s ease;
}

nav a:hover {
    color: #2563eb;
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2563eb;
    border-radius: 4px;
}

/* Buttons – menu toggle & dark toggle */
.menu-toggle,
.dark-toggle {
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.8s ease, transform 0.3s ease;
}

.menu-toggle svg,
.dark-toggle svg {
    width: 30px;
    height: 30px;
    transition: stroke 0.8s ease;
}

.menu-toggle:hover,
.dark-toggle:hover {
    transform: scale(1.1);
}

.menu-toggle {
    display: none;
    color: #111;
}

/* Mobile menu */
#mobileMenu {
    display: none;
    flex-direction: column;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.8s ease;
}

#mobileMenu a {
    text-decoration: none;
    color: #111;
    padding: 10px 0;
    transition: color 0.8s ease;
}

#mobileMenu a:hover {
    color: #2563eb;
}

@media (max-width: 768px) {
    nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    #mobileMenu.open {
        display: flex;
    }
}

/* ── DARK MODE ── */
body.dark {
    color: #f8fafc;
    background: linear-gradient(to bottom right, #1e293b, #334155, #475569);
}

body.dark header {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

body.dark .logo {
    color: #f8fafc;
}

body.dark nav a {
    color: #f8fafc;
}

body.dark nav a:hover {
    color: #93c5fd;
}

body.dark nav a.active::after {
    background: #93c5fd;
}

body.dark .dark-toggle,
body.dark .menu-toggle {
    color: #f8fafc;
}

body.dark #mobileMenu {
    background: rgba(30, 41, 59, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark #mobileMenu a {
    color: #f8fafc;
}

body.dark #mobileMenu a:hover {
    color: #93c5fd;
}

/* ── PRELOADER ── */
#global-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.dark #global-preloader {
    background: #0f172a;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(59, 130, 246, 0.2);
    border-top: 5px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}