* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Zakázání výchozí ikony prohlížeče pro zobrazení hesla */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-contacts-auto-fill-button,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
}

/* Touch-friendly styly pro mobilní zařízení */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Text shadow pro lepší čitelnost na gradientech */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Aspect ratio pro video kontejnery */
.aspect-w-16 {
    position: relative;
    width: 100%;
}

.aspect-w-16::before {
    content: '';
    display: block;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-h-9 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cookies banner a modal styly */
.cookie-banner {
    transition: transform 0.5s ease;
    z-index: 9999;
}

/* Cookies modal scrollbar styly */
#cookie-settings-modal .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#cookie-settings-modal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#cookie-settings-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

#cookie-settings-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

#cookie-settings-modal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

.dark #cookie-settings-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: #4b5563;
}

.dark #cookie-settings-modal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* Toggle switche pro cookies */
/* Toggle Switch - Moderní iOS/Material Design inspirovaný */
.toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.toggle-slider {
    display: inline-flex;
    align-items: center;
    width: 50px;
    height: 30px;
    background-color: #ccc;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked state */
.toggle-checkbox:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Focus state pro accessibility */
.toggle-checkbox:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.toggle-checkbox:focus:not(:checked) + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

/* Disabled state */
.toggle-checkbox:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-checkbox:disabled + .toggle-slider::before {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Skrytí statistik na mobilních zařízeních (šířka menší než 768px) */
@media (max-width: 767px) {
    .hide-on-mobile {
        display: none !important;
    }
    
    /* Lepší scrolling na mobilech */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Optimalizace pro touch zařízení */
    /* button, a, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    } */
    
    /* Cookies banner optimalizace pro mobily */
    .cookie-banner .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .cookie-banner h2 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .cookie-banner p {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .cookie-banner .flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cookie-banner button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Cookies modal optimalizace pro mobily */
    #cookie-settings-modal {
        padding: 1rem;
    }
    
    #cookie-settings-modal .bg-white {
        margin: 0;
        max-width: 100%;
        max-height: calc(100vh - 2rem);
        border-radius: 0.75rem;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
    
    #cookie-settings-modal .overflow-y-auto {
        max-height: calc(100vh - 12rem);
        padding-right: 0.5rem;
        margin-right: -0.5rem;
    }
    
    #cookie-settings-modal .p-4 {
        padding: 1rem;
    }
    
    #cookie-settings-modal h2 {
        font-size: 1.125rem;
        line-height: 1.4;
    }
    
    #cookie-settings-modal h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    #cookie-settings-modal p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    #cookie-settings-modal button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    #cookie-settings-modal .toggle-slider {
        width: 46px;
        height: 26px;
        border-radius: 13px;
        flex-shrink: 0;
    }
    
    #cookie-settings-modal .toggle-slider::before {
        width: 22px;
        height: 22px;
        top: 2px;
        left: 2px;
    }
    
    #cookie-settings-modal .toggle-checkbox:checked + .toggle-slider::before {
        transform: translateX(20px);
    }
    
    /* Křížek zarovnání na mobilech */
    #cookie-settings-modal .border-b {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    #cookie-settings-modal #close-settings {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        flex-shrink: 0;
    }
}

/* Specifické mobilní optimalizace */
@media (max-width: 640px) {
    /* FAQ otázky - lepší spacing */
    details summary {
        padding-right: 2rem;
    }
    
    /* Cenové karty - lepší rozložení */
    .pricing-card {
        margin: 0 0.5rem;
    }
    
    /* Kontaktní formulář - full width */
    #contact-form input,
    #contact-form textarea {
        font-size: 16px; /* Prevence zoom na iOS */
    }
    
    /* Cookies modal na malých mobilech */
    #cookie-settings-modal {
        padding: 0.75rem;
    }
    
    #cookie-settings-modal .bg-white {
        margin: 0;
        max-width: 100%;
        border-radius: 0.5rem;
        max-height: calc(100vh - 1.5rem);
    }
    
    #cookie-settings-modal .overflow-y-auto {
        max-height: calc(100vh - 10rem);
        padding-right: 0.25rem;
        margin-right: -0.25rem;
    }
    
    #cookie-settings-modal .p-4 {
        padding: 0.75rem !important;
    }
    
    #cookie-settings-modal h2 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    #cookie-settings-modal h3 {
        font-size: 0.925rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    #cookie-settings-modal p {
        font-size: 0.825rem !important;
        line-height: 1.4 !important;
    }
    
    #cookie-settings-modal .flex-col {
        gap: 0.5rem;
    }
    
    #cookie-settings-modal .sm\\:flex-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #cookie-settings-modal .bg-gray-100 {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    #cookie-settings-modal button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.825rem !important;
        width: 100%;
    }
    
    /* Křížek na malých mobilech */
    #cookie-settings-modal #close-settings {
        padding: 0.5rem !important;
        min-width: 40px !important;
        min-height: 40px !important;
        width: auto !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }
    
    #cookie-settings-modal #close-settings i {
        font-size: 1rem !important;
    }
    
    /* Cookies banner na malých mobilech */
    .cookie-banner .md\\:flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-banner .md\\:mt-0 {
        margin-top: 1rem;
    }
    
    .cookie-banner .sm\\:flex-row {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-banner button {
        width: 100%;
    }
}

:root {
    --scrollbar-thumb: #818cf8;
    --scrollbar-track: #f3f4f6;
}
html.dark {
    --scrollbar-thumb: #6366f1;
    --scrollbar-track: #1f2937;
}

/* Moderní tenký scrollbar pro celou aplikaci */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 6px;
}

/* Pro Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Globální loading modal styly */
#global-loading-modal {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

#global-loading-modal .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Loading progress bar animace */
#global-loading-modal .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Smooth transitions pro loading modal */
#global-loading-modal {
    transition: opacity 0.3s ease-in-out;
}

#global-loading-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#global-loading-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive design pro loading modal */
@media (max-width: 640px) {
    #global-loading-modal .bg-white {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    #global-loading-modal h-12 {
        height: 2.5rem;
        width: 2.5rem;
    }
    
    #global-loading-modal .text-lg {
        font-size: 1rem;
    }
}

/* FAQ optimalizace pro mobil */
details summary {
    list-style: none;
    position: relative;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::-moz-list-bullet {
    list-style-type: none;
}

details[open] summary .fa-chevron-down {
    transform: rotate(180deg);
}

/* Vylepšená FAQ animace */
details summary .fa-chevron-down {
    transition: transform 0.3s ease;
}

@media (max-width: 767px) {
    details summary {
        padding: 0.75rem 0;
    }
    
    details summary span {
        padding-right: 0.5rem;
        line-height: 1.4;
    }
    
    details summary .fa-chevron-down {
        margin-left: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Optimalizace textarea pro mobilní zařízení - řešení problému se scrollováním na Androidu */
@media (max-width: 767px) {
    /* Základní textarea styly pro mobily */
    textarea {
        /* Vylepšené touch chování */
        touch-action: manipulation;
        -webkit-overflow-scrolling: touch;
        
        /* Prevence zoom na iOS při focusu */
        font-size: 16px;
        
        /* Lepší scrolling na Androidu */
        overflow-y: auto;
        -webkit-appearance: none;
        
        /* Zajištění správného zobrazení */
        resize: none;
        
        /* Minimální výška pro lepší UX */
        min-height: 120px;
    }
    
    /* Speciální handling pro editovatelné textarea */
    textarea:not([readonly]):not([disabled]) {
        /* Vylepšené touch chování pro editaci */
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
        
        /* Prevence problémů s touch eventy */
        -webkit-touch-callout: default;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Speciální styly pro textarea v focus stavu */
    textarea:focus {
        /* Zajištění správného scrollování při focusu */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        
        /* Prevence problémů s viewport */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        
        /* Vylepšené outline pro lepší UX */
        outline: none;
    }
    
    /* Kontejnery s textarea - prevence konfliktů se scrollováním */
    .modal-body textarea,
    .bg-white textarea,
    .bg-gray-800 textarea {
        /* Zajištění nezávislého scrollování */
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
}

/* Speciální styly pro velmi malé mobily */
@media (max-width: 480px) {
    textarea {
        /* Menší padding pro více místa na text */
        padding: 0.75rem;
        
        /* Optimalizovaná výška */
        min-height: 100px;
    }
    
    /* Textarea ve formech */
    .form-control textarea,
    textarea.form-control {
        font-size: 16px !important; /* Prevence zoom na iOS */
    }
}

/* Hack pro Android WebView problémy */
@supports (-webkit-appearance: none) {
    @media (max-width: 767px) {
        textarea {
            /* Vynutit hardware acceleration */
            -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
            
            /* Optimalizace pro WebKit */
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
    }
}

/* Fallback řešení pro případy, kdy JavaScript nefunguje */
@media (max-width: 767px) {
    /* Kontejnery s textarea - zajištění správného scrollování */
    .bg-white, .bg-gray-800, .modal-body, .form-group {
        /* Prevence overflow problémů */
        position: relative;
    }
    
    /* Speciální třídy pro textarea kontejnery */
    .textarea-container {
        position: relative;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Vylepšené textarea pro dlouhý obsah */
    textarea[rows="6"], 
    textarea[rows="10"], 
    textarea.h-64 {
        /* Optimalizace pro dlouhé texty */
        height: auto;
        min-height: 150px;
        max-height: 300px;
        
        /* Lepší scrollování */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        
        /* Prevence problémů s focus */
        will-change: scroll-position;
    }
    
    /* Speciální handling pro textarea v modálech */
    .modal textarea {
        /* Zajištění správného chování v modálech */
        position: relative;
        z-index: 1;
        
        /* Optimalizace pro modal scrollování */
        max-height: 40vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* CSS-only řešení pro nejproblematičtější případy */
@supports not (touch-action: manipulation) {
    /* Starší prohlížeče - základní fallback */
    @media (max-width: 767px) {
        textarea {
            -webkit-appearance: textarea;
            resize: vertical;
            overflow: auto;
        }
    }
}

/* Utility třídy pro manuální aplikaci fixů */
.textarea-mobile-optimized {
    touch-action: manipulation !important;
    -webkit-overflow-scrolling: touch !important;
    overflow-y: auto !important;
    font-size: 16px !important; /* Prevence zoom na iOS */
}

.textarea-android-fix {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: scroll-position;
}

/* Debug styly pro testování (lze odstranit v produkci) */
.debug-textarea-mobile {
    border: 2px dashed red !important;
}

.debug-textarea-mobile::before {
    content: "Mobile Fix Applied";
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 10px;
    color: red;
    background: yellow;
    padding: 2px 4px;
    z-index: 1000;
}