/*
###############################################################################################################################################################
HEADER
###############################################################################################################################################################
*/

.header {
    height: var(--HEADER_HEIGHT);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 12;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    transition: height 0.3s ease;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    -webkit-backdrop-filter: none; /* Will be added by JS when scrolling */
    backdrop-filter: none; /* Will be added by JS when scrolling */
}

.header-top {
    height: var(--HEADER_HEIGHT);
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Specific rule for the planner page */
body[data-route="planner"] .header {
    background-color: transparent;
}

/*
###############################################################################################################################################################
LOGO
###############################################################################################################################################################
*/

.logo {
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body[data-route="planner"] .logo {
    margin-left: 7%;
}

.logo:hover {
    transform: scale(1.1);
    animation: elastic-bounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes elastic-bounce {
    0% { transform: scale(1); }
    20% { transform: scale(1.15); }
    40% { transform: scale(1.05); }
    60% { transform: scale(1.12); }
    80% { transform: scale(1.08); }
    100% { transform: scale(1.1); }
}

.logo svg {
    height: 40px;
    margin-top: 10px;
    width: auto;
}

.logo svg path,
.logo svg text {
    fill: var(--COLOR_FONT) !important;
}

/* Elastic/spring animation for different browser supports. https://matthewlein.com/tools/ceaser, https://easings.net/fr */
.elastic {
    -webkit-transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    -moz-transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    -o-transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-duration: 0.5s;
    transition-property: transform;
}

/*
###############################################################################################################################################################
VERSION BADGE (ADMIN ONLY)
###############################################################################################################################################################
*/

.version-badge {
    cursor: pointer;
    margin-left: 12px;
    padding: 2px 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Red-orange pulse animation for new version */
/* @keyframes pulseNewVersion {
    0%, 100% { 
        background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
        box-shadow: 0 3px 8px rgba(255, 107, 53, 0.5);
        transform: scale(1);
    }
    50% { 
        background: linear-gradient(135deg, #ff8c5a 0%, #ffb347 100%);
        box-shadow: 0 6px 16px rgba(255, 107, 53, 0.8);
        transform: scale(1.05);
    }
} */

/* Badge with new version - animation active */
/* .version-badge.new-version.pulsing {
    animation: pulseNewVersion 1.5s ease-in-out infinite;
    border-color: rgba(255,255,255,0.6);
} */

/* Badge with new version - remains orange even without animation */
.version-badge.new-version {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%) !important;
}

/* Badge inner elements */
/* .version-badge > span:first-child {
    font-size: 16px;
} */

#version-number {
    font-size: 0.7rem;
}

#version-time {
    font-size: 0.7rem;
}

/*
###############################################################################################################################################################
HEADER ICONS
###############################################################################################################################################################
*/

.header-icon {
    width: 1.4rem;
    height: 1.4rem;
}

/*
###############################################################################################################################################################
HEADER BUTTONS
###############################################################################################################################################################
*/

.header-top-right {
    order: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.burger-menu {
    display: flex;
}

.scroll-to-top-button, #save_trip_button, #share_trip_button, #settings_button {
    display: none;
}

.burger-menu,
.scroll-to-top-button,
#user-menu-button, 
#save_trip_button, 
#share_trip_button, 
#view_trips_button, 
#settings_button {
    background: linear-gradient(to right, var(--COLOR_ACTION_40), var(--COLOR_ACTION_60));
    padding: 0.4rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
    inset 4px 4px 8px rgba(255, 255, 255, 0.2),
    inset -4px -4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.burger-menu:hover, 
.scroll-to-top-button:hover,
#user-menu-button:hover, 
#save_trip_button:hover, 
#share_trip_button:hover, 
#view_trips_button:hover, 
#settings_button:hover {
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.2),
        inset -4px -4px 8px rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

/*
###############################################################################################################################################################
HEADER SEARCH BAR (on scroll and on the planner page)
###############################################################################################################################################################
*/

.header-top .header-searchbar {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    z-index: 5;
}

/*
###############################################################################################################################################################
AUTH LINKS & LANGUAGE DROPDOWN
###############################################################################################################################################################
*/

.auth-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-dropdown {
    position: relative;
    display: inline-block;
}

.header-dropdown a {
    color: var(--COLOR_SURFACE_90);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--BUTTON_BORDER_RADIUS);
    transition: all 0.3s ease;
}

.header-dropdown a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.header-dropdown .arrow-down {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.header-dropdown div {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1002;
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    background-color: rgba(255, 255, 255, 0.1);
}

.header-dropdown:hover div {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.header-dropdown:hover .arrow-down {
    transform: rotate(180deg);
}

.header-dropdown div a {
    display: block;
    padding: 10px 15px;
    color: var(--COLOR_SURFACE_80);
    border-radius: 0;
}

.header-dropdown div a:hover {
    background-color: var(--ORANGE_10);
    color: var(--COLOR_ACTION_60);
    font-weight: 600;
}

.header-dropdown .dropbtn {
    cursor: pointer;
}

.header-dropdown .dropbtn[href*="login"] {
    background: linear-gradient(to right, var(--COLOR_ACTION_40), var(--COLOR_ACTION_60));
    color: white;
    padding: 8px 16px;
    border-radius: var(--BUTTON_BORDER_RADIUS);
    transition: all 0.3s ease;
}

.header-dropdown .dropbtn[href*="login"]:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/*
###############################################################################################################################################################
RESPONSIVE
###############################################################################################################################################################
*/

@media screen and (max-width: 1046px) {
    .scroll-to-top-button, #scroll-to-top-icon {
        display: flex;
    }
}

@media screen and (max-width: 896px) {
    .logo svg {
        height: 40px;
    }

	.editorial .logo {
		position: relative;
		display: inline-block;	
	}

    .header-icon {
        width: 1.1rem;
        height: 1.1rem;
    }

    .auth-links {
        gap: 0px;
    }

    /* Version badge responsive */
    /* .version-badge {
        font-size: 13px !important;
        padding: 6px 10px !important;
        margin-left: 8px !important;
    } */

    /* Position mobile buttons to the right of the custom geocoder in #map (only on planner page) */
    body[data-route="planner"] #save_trip_button_mobile,
    body[data-route="planner"] #view_trips_button_mobile {
        position: absolute;
        top: 12px;
        z-index: 6;
        padding: 4px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 
            inset 4px 4px 8px rgba(255, 255, 255, 0.2),
            inset -4px -4px 8px rgba(0, 0, 0, 0.2);
        background: linear-gradient(to right, var(--COLOR_ACTION_40), var(--COLOR_ACTION_60));
        transition: all 0.3s ease;
        align-items: center;
        justify-content: center;
    }

    /* Specific position for the "save trip" button (to the left of the "view trips" button) */
    body[data-route="planner"] #save_trip_button_mobile {
        left: 75%;
    }

    /* Specific position for the "view trips" button (rightmost) */
    body[data-route="planner"] #view_trips_button_mobile {
        left: 65%;   
    }

    /* Hover effect for mobile buttons: invert shadow and scale up */
    body[data-route="planner"] #save_trip_button_mobile:hover,
    body[data-route="planner"] #view_trips_button_mobile:hover {
        box-shadow: 
            inset 4px 4px 8px rgba(0, 0, 0, 0.2),
            inset -4px -4px 8px rgba(255, 255, 255, 0.1);
        transform: scale(1.1);
    }

    /* Set icon size inside mobile buttons */
    body[data-route="planner"] #save_trip_button_mobile .header-icon,
    body[data-route="planner"] #view_trips_button_mobile .header-icon {
        width: 20px;
        height: 20px;
    }
}

/*
###############################################################################################################################################################
SCROLL BAR
###############################################################################################################################################################
*/

::-webkit-scrollbar {
	width: 6px;
    height: 6px;
}
/* Track */
::-webkit-scrollbar-track {
    background: var(--COLOR_SURFACE_30);
	/* background-image: linear-gradient(to top, var(--COLOR_SURFACE_30), var(--COLOR_SURFACE_50)); */
	border-radius: 6px;
}
/* Handle */
::-webkit-scrollbar-thumb {
    background: var(--COLOR_ACTION_50);
    /* background: linear-gradient(to bottom, var(--COLOR_ACTION_40), var(--COLOR_ACTION_60)); */
    border-radius: 6px;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: var(--COLOR_ACTION_70);
	/* background-image: linear-gradient(to top, var(--COLOR_SURFACE_80), white); */
}