/* =============================================
   EASYWAY - LAYOUT.CSS (RESPONZÍVNA VERZIA)
   VERZIA: 65.0.0 (Odstup 20px medzi user-info-box a dashboard-container)
   ============================================= */

:root {
    --header-height: 80px;
    --header-height-mobile: 60px;
    --dashboard-container-margin-top: 0px;
    --container-header-margin-top: 0px;

    --container-header-content-spacing: 45px;

    --logo-height-desktop: 160px;
    --logo-height-tablet: 130px;
    --logo-height-mobile: 90px;
    --logo-margin-top: 15px;
    --logo-padding-vertical: 10px;
    --logo-margin-bottom: 30px;

    --header-nav-height: 70px;
    --header-nav-height-mobile: 60px;
    --header-margin-top: 10px;

    --userinfo-height: 60px;
    --userinfo-height-mobile: 60px;

    --spacing-bottom: 45px;

    --fixed-elements-height: calc(
        var(--logo-height-desktop) + var(--logo-margin-top) + var(--logo-padding-vertical) +
            var(--logo-margin-bottom) + var(--header-nav-height) + var(--header-margin-top) +
            var(--userinfo-height) + var(--userinfo-margin-top) + var(--spacing-bottom)
    );
    --fixed-elements-height-tablet: calc(
        var(--logo-height-tablet) + var(--logo-margin-top) + var(--logo-padding-vertical) +
            var(--logo-margin-bottom) + var(--header-nav-height) + var(--header-margin-top) +
            var(--userinfo-height) + var(--userinfo-margin-top) + var(--spacing-bottom)
    );
    --fixed-elements-height-mobile: calc(
        var(--logo-height-mobile) + var(--logo-margin-top) + var(--logo-padding-vertical) +
            var(--logo-margin-bottom) + var(--header-nav-height-mobile) + var(--header-margin-top) +
            var(--userinfo-height-mobile) + var(--userinfo-margin-top) + var(--spacing-bottom)
    );

    --content-max-width: 1300px;
    --content-padding-x: 30px;
}

/* =============================================
   HLAVNÝ OBSAH - STICKY FOOTER
   ============================================= */
.main-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding-x);
    flex: 1 0 auto;
    width: 100%;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Šírka hlavného obsahu pre väčšie obrazovky */
@media (min-width: 1400px) and (max-width: 1599px) {
    :root {
        --content-max-width: 1300px;
        --content-padding-x: 30px;
    }
}
@media (min-width: 1600px) and (max-width: 1919px) {
    :root {
        --content-max-width: 1500px;
        --content-padding-x: 40px;
    }
}
@media (min-width: 1920px) and (max-width: 2559px) {
    :root {
        --content-max-width: 1800px;
        --content-padding-x: 50px;
    }
}
@media (min-width: 2560px) {
    :root {
        --content-max-width: 2400px;
        --content-padding-x: 60px;
    }
}

/* =============================================
   DASHBOARD CONTAINER - ODSTUP 20px OD USER-INFO-BOX
   ============================================= */
.dashboard-container {
    background: transparent !important;
    backdrop-filter: none !important;
    border-radius: 0;
    overflow: visible;
    width: 100%;
    /* 🔥 ODSTUP 20px (žiadne !important aby neblokovalo) */
    margin-top: 180px;
    padding-top: 0 !important;
    position: relative;
    top: 0;
}

@media (max-width: 1199px) and (min-width: 768px) {
    .dashboard-container {
        top: 0;
    }
}

@media (max-width: 767px) {
    .dashboard-container {
        top: 0;
    }
}

/* =============================================
   CONTAINER HEADER
   ============================================= */
.container-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: clamp(30px, 5vw, 50px) clamp(20px, 4vw, 40px);
    border-bottom: 3px solid var(--primary-light);
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: clamp(140px, 25vh, 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 110px !important;
    margin-bottom: clamp(25px, 5vw, 40px);
    border-radius: var(--radius);
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.container-header .container-title,
.container-header h1,
.container-header h2,
.container-header h3 {
    color: white !important;
}

.container-header .welcome-message {
    color: rgba(255, 255, 255, 0.95);
}

.container-header .welcome-highlight {
    color: white;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
}

/* =============================================
   USER INFO BOX
   ============================================= */
.user-info-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    padding: 10px 20px;
    width: fit-content;
    min-width: 280px;
    max-width: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 999;
    backdrop-filter: blur(0px);
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0 !important;
    margin-top: -3px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none;
}

/* Responzívne úpravy pre mobile */
@media (max-width: 900px) {
    .user-info-box {
        top: 60px;
        padding: 10px 20px;
        margin-top: -3px !important;
    }
}

@media (max-width: 768px) {
    .user-info-box {
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .user-info-box {
        padding: 10px 20px;
        top: 50px;
    }
}

/* =============================================
   USER INFO CONTAINER
   ============================================= */
.user-info-container {
    display: flex;
    justify-content: center !important;
    align-items: center;
    gap: 20px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    flex-direction: row !important;
    flex-wrap: wrap;
}

/* Štýly pre prihláseného používateľa */
@media (min-width: 901px) {
    .user-info-container .login-status {
        text-align: left !important;
        white-space: nowrap !important;
    }
    .user-info-container .login-status .user-name {
        display: inline-block !important;
        margin-right: 8px !important;
        margin-bottom: 0 !important;
    }
    .user-info-container .login-status .user-details {
        display: inline-flex !important;
        justify-content: flex-start !important;
    }
    .user-info-container .moja-zona-btn,
    .user-info-container .logout-btn {
        display: inline-block !important;
        margin: 0 !important;
    }
}

/* Štýly pre mobilnú verziu */
@media (max-width: 900px) {
    .user-info-container {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .user-info-container .login-status {
        text-align: center !important;
        margin: 0 auto !important;
    }
    .user-info-container .login-status .user-name {
        display: block !important;
        text-align: center !important;
        margin-bottom: 5px !important;
    }
    .user-info-container .login-status .user-details {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    .user-info-container .moja-zona-btn,
    .user-info-container .logout-btn {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: auto !important;
        min-width: 120px !important;
    }
}

/* Štýly pre neprihláseného používateľa */
.user-info-container.user-info-container-center {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

/* =============================================
   RESPONZÍVNE ÚPRAVY PRE MAIN CONTENT
   ============================================= */
@media (max-width: 1400px) {
    .main-content {
        max-width: 1200px;
    }
}
@media (max-width: 1200px) {
    .main-content {
        max-width: 1100px;
    }
}
@media (max-width: 1024px) {
    .main-content {
        max-width: 100%;
    }
}
@media (max-width: 900px) {
    .main-content {
        margin: 0 auto 30px;
        padding: 0 20px;
    }
}
@media (max-width: 768px) {
    .main-content {
        margin: 0 auto 25px;
        padding: 0 20px;
    }
}
@media (max-width: 600px) {
    .main-content {
        margin: 0 auto 20px;
        padding: 0 15px;
    }
}
@media (max-width: 480px) {
    .main-content {
        margin: 0 auto 15px;
        padding: 0 15px;
    }
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
    background: var(--footer-gradient);
    color: white;
    margin-top: auto;
    padding: 20px 0;
    position: relative;
    border-top: 3px solid var(--primary-light);
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.footer-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding-x);
    width: 100%;
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .footer-container {
        max-width: 1300px;
        padding: 0 30px;
    }
}
@media (min-width: 1600px) and (max-width: 1919px) {
    .footer-container {
        max-width: 1500px;
        padding: 0 40px;
    }
}
@media (min-width: 1920px) and (max-width: 2559px) {
    .footer-container {
        max-width: 1800px;
        padding: 0 50px;
    }
}
@media (min-width: 2560px) {
    .footer-container {
        max-width: 2400px;
        padding: 0 60px;
    }
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    min-height: 40px;
    width: 100%;
}

.copyright-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(0.75rem, 2.5vw, 0.95rem);
    line-height: 1.5;
    text-align: center;
    flex: 1;
}

.copyright-text strong {
    color: white;
    font-weight: 700;
}

.copyright-subtext {
    display: block;
    font-size: clamp(0.688rem, 2vw, 0.85rem);
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3px;
    font-style: italic;
}

/* =============================================
   BACK TO TOP BUTTON
   ============================================= */
.back-to-top-global {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(26, 43, 110, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.back-to-top-global.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-global:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(26, 43, 110, 0.5);
}

/* =============================================
   KOMPENZÁCIA PRE FIXED HEADER
   ============================================= */
body .main-content {
    padding-top: 380px !important;
}

@media (max-width: 1199px) and (min-width: 768px) {
    body .main-content {
        padding-top: 320px !important;
    }
}

@media (max-width: 767px) {
    body .main-content {
        padding-top: 260px !important;
    }
}

/* =============================================
   ZNÍŽENÁ POHYBLIVOSŤ
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .main-content,
    .container-header,
    .dashboard-container,
    .header-wrapper,
    .site-header,
    .user-info-box,
    .back-to-top-global,
    .logo-container {
        transition: none !important;
    }
    .logo-container.logo-hidden {
        transition: none !important;
    }
}

/* =============================================
   TLAČ
   ============================================= */
@media print {
    .site-header,
    #header-container,
    .site-footer,
    #footer-container,
    .user-info-box,
    .back-to-top-global,
    .moja-zona-btn,
    .logout-btn,
    .logout-indicator,
    .security-badge {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .main-content {
        margin: 20px auto !important;
        padding: 20px !important;
    }
    .container-header {
        background: white !important;
        color: black;
        padding: 20px;
        margin-top: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .dashboard-container {
        margin-top: 0 !important;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    .container-title {
        color: black;
    }
}
/* =============================================
   🔥 TMAVÝ REŽIM - ROVNAKÁ FARBA FOOTERU AKO VO SVETLOM REŽIME
   ============================================= */
@media (prefers-color-scheme: dark) {
    .site-footer {
        background: #0d1a4d !important;
    }
}

/* Rovnaké pravidlo pre data-theme="dark" */
html[data-theme='dark'] .site-footer {
    background: #0d1a4d !important;
}
