/* ============================================
   CROSS-BROWSER COMPATIBILITY ENHANCEMENTS
   Safari, Chrome, Firefox, Edge, Mobile Safari
   ============================================ */

/* ============================================
   SAFARI SPECIFIC FIXES
   ============================================ */

/* Safari flexbox fix */
@supports (-webkit-appearance: none) {
    .header-content,
    .nav-list,
    .tiles-grid,
    .hero-content {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
    }
}

/* Safari sticky position fix */
.header {
    position: -webkit-sticky;
    position: sticky;
    will-change: transform;
}

/* Safari transform fix */
* {
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ============================================
   TOUCH OPTIMALIZACE PRO MOBIL
   ============================================ */

/* Touch-friendly tap targets (min 48x48px) */
button,
a,
input[type="submit"],
input[type="button"],
.btn,
.tile,
.nav-list a {
    min-height: 44px; /* Apple guidelines */
    min-width: 44px;
    touch-action: manipulation; /* Prevence zoom při double-tap */
    -ms-touch-action: manipulation;
}

/* Lepší scrollování na iOS */
body,
.main-nav,
.submenu {
    -webkit-overflow-scrolling: touch;
}

/* Odstranění tap highlight na iOS/Android */
a,
button,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Prevence zoom při focus na iOS */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea,
select {
    font-size: 16px; /* iOS nezoomuje pokud je font-size >= 16px */
}

/* ============================================
   FLEXBOX FALLBACKS PRO STARŠÍ PROHLÍŽEČE
   ============================================ */

/* IE 10-11 flexbox fixes */
.header-content,
.nav-list,
.tiles-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
}

.nav-list {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

@media (min-width: 768px) {
    .nav-list {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -webkit-flex-direction: row;
        -moz-box-orient: horizontal;
        -moz-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
    }
}

/* ============================================
   GRID FALLBACKS PRO STARŠÍ PROHLÍŽEČE
   ============================================ */

/* IE 10-11 Grid fallback pomocí flexbox */
@supports not (display: grid) {
    .tiles-grid,
    #categoriesGrid {
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .tile,
    .category-tile {
        -webkit-box-flex: 0;
        -webkit-flex: 0 0 calc(50% - 1rem);
        -ms-flex: 0 0 calc(50% - 1rem);
        flex: 0 0 calc(50% - 1rem);
        margin: 0.5rem;
    }
    
    @media (min-width: 768px) {
        .tile,
        .category-tile {
            -webkit-flex: 0 0 calc(33.333% - 1rem);
            -ms-flex: 0 0 calc(33.333% - 1rem);
            flex: 0 0 calc(33.333% - 1rem);
        }
    }
    
    @media (min-width: 1024px) {
        .tile,
        .category-tile {
            -webkit-flex: 0 0 calc(25% - 1rem);
            -ms-flex: 0 0 calc(25% - 1rem);
            flex: 0 0 calc(25% - 1rem);
        }
    }
}

/* ============================================
   TRANSFORM A TRANSITION PREFIXES
   ============================================ */

.tile,
.btn,
.logo-img,
.mobile-menu-toggle span {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.tile:hover,
.btn:hover {
    -webkit-transform: translateY(-4px);
    -moz-transform: translateY(-4px);
    -ms-transform: translateY(-4px);
    -o-transform: translateY(-4px);
    transform: translateY(-4px);
}

/* ============================================
   BOX-SHADOW PREFIXES
   ============================================ */

.header,
.tile,
.btn,
.form-card {
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   BORDER-RADIUS PREFIXES (pro Safari 3-4)
   ============================================ */

.btn,
.tile,
.form-card,
input,
textarea,
select {
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}

/* ============================================
   PLACEHOLDER STYLING PRO VŠECHNY PROHLÍŽEČE
   ============================================ */

::-webkit-input-placeholder {
    color: #a0aec0;
    opacity: 1;
}

::-moz-placeholder {
    color: #a0aec0;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #a0aec0;
    opacity: 1;
}

:-moz-placeholder {
    color: #a0aec0;
    opacity: 1;
}

::placeholder {
    color: #a0aec0;
    opacity: 1;
}

/* ============================================
   RESPONSIVE BREAKPOINTS (Mobile-First)
   ============================================ */

/* Extra Small Devices (< 320px) */
@media (max-width: 319px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .logo-img {
        height: 60px;
        max-width: 200px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* Small Devices (320px - 480px) */
@media (min-width: 320px) and (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .logo-img {
        height: 70px;
        max-width: 250px;
    }
}

/* Medium Devices - Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .logo-img {
        height: 80px;
        max-width: 300px;
    }
}

/* Large Devices - Tablets/Small Desktops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

/* Extra Large Devices - Desktops (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .container {
        max-width: 1200px;
    }
}

/* Ultra Wide Screens (> 1440px) */
@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }
}

/* ============================================
   LANDSCAPE MODE (mobilní zařízení na šířku)
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .header {
        position: relative; /* Sticky může zabírat moc místa */
    }
    
    .logo-img {
        height: 50px;
    }
    
    .nav-list > li > a {
        padding: 0.35rem 0;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .header,
    .footer,
    .mobile-menu-toggle,
    .btn {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   DARK MODE SUPPORT (pro Safari/iOS)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Zatím necháme světlé téma, ale připraveno pro budoucnost */
    body {
        /* dark mode styly */
    }
}

/* ============================================
   REDUCED MOTION (přístupnost)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        -webkit-animation-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        -webkit-animation-iteration-count: 1 !important;
        animation-iteration-count: 1 !important;
        -webkit-transition-duration: 0.01ms !important;
        -o-transition-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   FORCED COLORS MODE (Windows High Contrast)
   ============================================ */

@media (forced-colors: active) {
    .btn {
        border: 2px solid currentColor;
    }
}

/* ============================================
   FOCUS VISIBLE (moderní prohlížeče)
   ============================================ */

:focus-visible {
    outline: 2px solid #406bae;
    outline-offset: 2px;
}

/* Fallback pro starší prohlížeče */
:focus {
    outline: 2px solid #406bae;
    outline-offset: 2px;
}

/* Ale skrýt outline při mouse click */
:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   SMOOTH SCROLLING S FALLBACK
   ============================================ */

@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* ============================================
   ASPECT RATIO FALLBACK (pro starší Safari)
   ============================================ */

@supports not (aspect-ratio: 16 / 9) {
    .video-container {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 */
        height: 0;
    }
    
    .video-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* ============================================
   VIEWPORT UNITS FIX PRO iOS
   ============================================ */

/* iOS Safari fix pro vh units (adresní lišta) */
.full-height {
    height: 100vh;
    height: -webkit-fill-available;
}

/* ============================================
   CURSOR STYLES PRO LEPŠÍ UX
   ============================================ */

a,
button,
.btn,
.tile,
[role="button"],
input[type="submit"],
input[type="button"] {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea {
    cursor: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ============================================
   SAFE AREA INSETS (iPhone X notch)
   ============================================ */

@supports (padding: max(0px)) {
    .header,
    .footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* ============================================
   FORM ELEMENTS RESET (cross-browser)
   ============================================ */

input,
textarea,
select,
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Safari/iOS select arrow fix */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

/* ============================================
   IMAGE RENDERING OPTIMIZATION
   ============================================ */

img {
    max-width: 100%;
    height: auto;
    display: block;
    -ms-interpolation-mode: bicubic; /* IE */
    image-rendering: -webkit-optimize-contrast;
}

/* ============================================
   TEXT RENDERING OPTIMIZATION
   ============================================ */

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

/* ============================================
   HARDWARE ACCELERATION (GPU)
   ============================================ */

.tile,
.btn,
.mobile-menu-toggle,
.submenu {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}



