:root {
    --header-height: 82px;
    --header-height-tablet: 72px;
    --header-height-mobile: 62px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: var(--spacing-md);
    box-shadow: 0 1px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 10px;
    height: var(--header-height);
    overflow: visible;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* Desktop csak: átlátszó header fejléc háttér esetén */
@media (min-width: 769px) {
    .has-header-background .site-header {
        background: var(--header-bg-desktop, rgba(255, 255, 255, 0.1)) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Mobil: szilárd háttér fejléc háttér esetén */
@media (max-width: 768px) {
    .has-header-background .site-header {
        background: var(--mobile-header-bg, var(--white)) !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

.has-header-background .site-title-diffcolor {
    background: transparent;
}

.logo-container {
    width: auto;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.site-title-container {
    flex-grow: 1;
    min-width: 0;
    text-align: left;
}

.site-title {
    font-size: var(--l-font-size);
    color: var(--text-color);
    font-weight: bold;
    line-height:26px;
    transition: color 0.3s ease;
}

.site-title-link {
    text-decoration: none;
    display: block;
}

.site-title-link:hover .site-title {
    color: var(--header-title-accent-color, var(--primary-color)) !important;
}

.site-title-link:hover .site-title-diffcolor {
    color: var(--header-title-accent-color, var(--primary-hover)) !important;
    background: transparent !important;
}

.site-title-link:hover .site-slogan {
    color: var(--header-title-accent-color, var(--primary-hover)) !important;
}

.site-title-diffcolor {
    color: var(--text-light);
    display: inline;
    background-color:var(--white);;
    transition: color 0.3s ease;
}

.site-slogan {
    font-size: var(--basic-font-size);
    color: var(--text-light);
    transition: color 0.3s ease;
}

.auth-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-shrink: 0;
    min-width: 56px;
}

.site-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.user-circle {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    cursor: pointer;
}

.user-menu-container {
    position: relative;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 8px;
    min-width: 280px;
    padding: var(--spacing-md);
    margin-top: 8px;
    display: none;
}

.user-menu.active {
    display: block;
}

.user-info {
    padding: var(--spacing-md) 0;
}

.full-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.email {
    color: var(--text-light);
    font-size: 0.9em;
}

.user-menu hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-sm) 0;
}

.usermenu-item {
    display: block;
    padding: var(--spacing-sm) var(--spacing-sm);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-tablet);
    }
    .site-title-container {
        text-align: left;
    }
    .site-title {
        font-size: var(--basic-font-size);
        line-height: 1.2;
    }
    .site-slogan {
        font-size: var(--xs-font-size);
    }
    .site-header {
        padding: 6px;
        column-gap: 6px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: var(--header-height-mobile);
    }

    .site-slogan {
        font-size: var(--xs-font-size);
        line-height: 1.2;
    }
    
    .auth-buttons {
        gap: var(--spacing-sm);
        min-width:0px
    }
    
    .site-header .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-title {
    animation: slideInFromTop 0.5s ease forwards;
}

.animate-slogan {
    animation: slideInFromBottom 0.5s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

/* Desktop menü stílusok */
.desktop-menu {
    display: none;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: auto;
    margin-right: var(--spacing-md);
    flex-wrap: nowrap;
    overflow: hidden;
}

.desktop-menu a {
    color: var(--text-color);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1px;
    max-width: 300px;
    min-width: 0;
    background: rgba(var(--primary-color-rgb), 0.05);
}

.desktop-menu a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    transform: rotate(45deg) translateY(6px);
    color: var(--primary-color);
}

/* Szöveg rész ellipsis-szel */
.desktop-menu a .menu-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.desktop-menu a:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.15);
}

.desktop-menu a:hover svg {
    transform: rotate(45deg) translateY(3px);
}

/* Scroll esetén megjelenő háttér */
.site-header.scrolled {
    background-color: var(--scroll-header-bg) !important;
    backdrop-filter: blur(10px);
}

/* Desktop: menü megjelenítése (hamburger marad) */
@media (min-width: 769px) {
    .desktop-menu {
        display: flex;
    }
    
    /* Fejléc háttér esetén a menü színezése - title color használata */
    .has-header-background .desktop-menu a {
        color: var(--header-title-color, var(--text-color));
        text-shadow: 2px 2px 4px var(--header-shadow-color, rgba(0, 0, 0, 0.3));
        background: var(--header-bg-menu, rgba(255, 255, 255, 0.1));
    }
    
    /* Világos fejléc háttér esetén világos menü háttér */
    .has-header-background[style*="--header-lumi: bright"] .desktop-menu a {
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Sötét fejléc háttér esetén sötét menü háttér */
    .has-header-background[style*="--header-lumi: dark"] .desktop-menu a {
        background: rgba(0, 0, 0, 0.1);
    }
    
    .has-header-background .desktop-menu a svg {
        color: var(--header-title-accent-color, var(--primary-color));
    }
    
    .has-header-background .desktop-menu a:hover {
        color: var(--header-title-accent-color, var(--primary-color));
        background: var(--header-hover-bg, rgba(255, 255, 255, 0.2));
    }
    
    /* Világos fejléc háttér esetén világos hover háttér */
    .has-header-background[style*="--header-lumi: bright"] .desktop-menu a:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Sötét fejléc háttér esetén sötét hover háttér */
    .has-header-background[style*="--header-lumi: dark"] .desktop-menu a:hover {
        background: rgba(0, 0, 0, 0.2);
    }
    
    .has-header-background .desktop-menu a:hover svg {
        transform: rotate(45deg) translateY(3px);
    }
}



/* Fejléc telefonszám stílusok */
.header-phone {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: var(--spacing-md);
}

.header-phone .phone-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-color);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    background: rgba(var(--primary-color-rgb), 0.1);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.header-phone .phone-link:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.15);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.header-phone .phone-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--primary-color);
}

/* Telefonszám közelebb a logóhoz, ha nincs menüpont */
.header-phone.no-menu-spacing {
    margin-right: 0;
}

/* Fejléc háttér esetén telefonszám színezése */
.has-header-background .header-phone .phone-link {
    color: var(--header-title-color, var(--text-color));
    text-shadow: 2px 2px 4px var(--header-shadow-color, rgba(0, 0, 0, 0.3));
    background: var(--header-bg-phone, rgba(255, 255, 255, 0.15));
    border-color: var(--header-border-phone, rgba(255, 255, 255, 0.2));
}

.has-header-background .header-phone .phone-link:hover {
    color: var(--header-title-accent-color, var(--primary-color));
    background: var(--header-hover-bg-phone, rgba(255, 255, 255, 0.2));
    border-color: var(--header-title-accent-color, var(--primary-color));
}

.has-header-background .header-phone .phone-link svg {
    color: var(--header-title-accent-color, var(--primary-color));
}

/* Sarok telefonszám ikonok */
.phone-corner-icon {
    position: fixed;
    bottom: 20px;
    height: 60px;
    background: var(--secondary-color);
    border-radius: 30px; /* Magasság fele */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(var(--secondary-color-rgb), 0.3);
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Kicsit rugalmasabb animáció */
    text-decoration: none;
    color: var(--white);
    overflow: hidden; /* Tartalom levágása a gömbölyítés miatt */
    border:1px solid var(--white) !important;
    /* Alapértelmezett állapot: csak ikon */
    width: 60px;
}

.phone-corner-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
    flex-shrink: 0; /* Ne zsugorodjon */
    transition: opacity 0.3s ease;
}

.phone-number-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--white);
    white-space: nowrap; /* Ne törjön sorba */
    opacity: 0; /* Alapból rejtett */
    max-width: 0; /* Alapból nincs szélessége */
    transition: opacity 0.3s ease, max-width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    margin-left: 0;
}

.phone-corner-icon:hover {
    width: auto; /* Szélesség a tartalomhoz igazodik */
    background: var(--secondary-hover);
    box-shadow: 0 6px 20px rgba(var(--secondary-color-rgb), 0.4);
    transform: translateY(-2px);
    padding: 0 20px;
}

.phone-corner-icon:hover .phone-number-text {
    opacity: 1;
    max-width: 200px; /* Elég nagy, hogy a szám kiférjen */
    margin-left: 12px;
}

.phone-corner-icon.left {
    left: 20px;
    justify-content: center;
}

.phone-corner-icon.right {
    right: 20px;
    justify-content: center;
}

/* Desktop: telefonszám prefix és szám közötti szóköz */
.header-phone .phone-prefix::after {
    content: " ";
}

/* Mobil: telefonszám ikonok kisebb méret */
@media (max-width: 768px) {
    .header-phone {
        margin-right: var(--spacing-sm);
    }
    
    .header-phone .phone-link {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.85rem;
        flex-direction: row;
        align-items: center;
        line-height: 1.3;
        min-height: 40px;
        justify-content: center;
    }
    
    .header-phone .phone-link svg {
        flex-shrink: 0;
    }
    
    .header-phone .phone-number-display {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-phone .phone-prefix {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .header-phone .phone-number {
        font-size: 0.75rem;
        margin-top: 1px;
    }
    
    /* Mobil verzióban ne legyen szóköz a prefix után */
    .header-phone .phone-prefix::after {
        content: "";
    }
    
    .phone-corner-icon {
        width: 50px;
        height: 50px;
        bottom: 15px;
    }
    
    .phone-corner-icon.left {
        left: 15px;
    }
    
    .phone-corner-icon.right {
        right: 15px;
    }
    
    .phone-corner-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* 500px alatt: logo/monogram méretének csökkentése */
@media (max-width: 500px) {
    .logo-container {
        height: 40px;
    }
    
    .user-circle {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }
    
    .header-phone {
        margin-right: 0px;
    }
}

/* 450px alatt: telefonszám szövegének elrejtése, csak ikon marad */
@media (max-width: 450px) {
    .header-phone .phone-number-display {
        display: none;
    }
    
    .header-phone .phone-link {
        min-height: 36px;
        padding: var(--spacing-xs);
        border-radius: 50%;
        width: 36px;
        height: 36px;
    }
    
    .header-phone .phone-link svg {
        margin-right: 0;
        width: 18px;
        height: 18px;
    }
}

/* Mobil: desktop menü elrejtése */
@media (max-width: 768px) {
    .desktop-menu {
        display: none;
    }
}