/* Header specific styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-primary);
    color: white;
    padding: 1rem;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

header nav a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.2s ease;
}

header nav a:hover {
    color: white;
    text-decoration: underline;
}

header .register-btn {
    background-color: var(--color-accent);
    color: var(--color-text-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: bold;
}

header .register-btn:hover {
    background-color: var(--color-accent-light);
    color: black;
    text-decoration: none;
}

/* Header animation class */
.header-hidden {
    transform: translateY(-100%);
}

/* Language selector styling */
.language-selector {
    display: flex;
    align-items: center;
    position: relative;
    margin-right: 0.5rem;
}

.language-dropdown {
    position: relative;
    z-index: 1001; /* Higher than header's z-index */
}

.language-current {
    background: none;
    border: 2px solid transparent;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-current:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.language-current.open {
    border-color: white;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.language-current img {
    display: block;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.language-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1002;
    overflow: hidden; /* Add this to contain child elements' backgrounds */
}

.language-dropdown-content.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: black;
    text-decoration: none;
    width: 100%; /* Ensure full width */
    box-sizing: border-box; /* Include padding in width calculation */
}

.language-option:hover {
    background-color: var(--color-accent); /* Use accent color variable for consistency */
    color: var(--color-text-dark); /* Ensure good contrast with background */
}

.language-option img {
    margin-right: 0.75rem;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.language-option.active {
    background-color: var(--color-accent-light);
    font-weight: bold;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 3D City link styling - Rediseño más llamativo */
.city3d-link {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--color-accent), #2ecc71);
    color: #fff !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin-right: 5px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
    overflow: hidden; /* Para contener el banner */
}

.city3d-link::before {
    content: "🏙️";
    font-size: 1.2rem;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.city3d-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none !important;
}

.city3d-link:hover::before {
    transform: rotate(15deg);
}

/* Estilo de banner para el badge NEW */
.new-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #e74c3c; /* Rojo */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 5px 25px;
    transform: rotate(45deg) translateX(20px) translateY(-14px);
    box-shadow: 0 3px 5px rgba(0,0,0,0.4);
    text-align: center;
    z-index: 2;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: pulse-banner 2s infinite;
}

@keyframes pulse-banner {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.city3d-link:hover .new-badge {
    background-color: #c0392b;
}

/* Profile selector styling */
.profile-selector {
    display: flex;
    align-items: center;
    position: relative;
    margin-right: 0.5rem;
}

.profile-dropdown {
    position: relative;
    z-index: 1001; /* Higher than header's z-index */
}

.profile-current {
    background: none;
    border: 2px solid transparent;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-current:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.profile-current.open {
    border-color: white;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.profile-image {
    display: block;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.profile-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background-color: white;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 0.5rem 0;
    z-index: 1002;
    overflow: hidden;
}

.profile-dropdown-content.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.profile-option {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--color-text-dark);
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.profile-option:hover {
    background-color: var(--color-accent);
    color: var(--color-text-dark);
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
    }
    
    header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    header h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    header nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--color-primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.5rem; /* Increased horizontal padding */
        box-sizing: border-box; /* Ensure padding is included in width */
        gap: 0.8rem;
        display: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    header nav.mobile-menu-open {
        display: flex;
    }
    
    header nav a {
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .language-selector {
        order: 0;
        margin: 0;
    }
    
    .register-btn {
        width: 95%; /* Slightly reduced from 100% to prevent overflow */
        text-align: center;
        box-sizing: border-box; /* Ensure padding is included in width */
        margin: 0.5rem 0;
        display: block; /* Ensure it's a block element */
    }
    
    /* Hamburger menu button */
    .hamburger-menu {
        display: block;
        cursor: pointer;
        width: 30px;
        height: 24px;
        position: relative;
        margin-left: 0; /* Remove left margin */
        margin-right: 1rem; /* Add right margin to move it away from edge */
    }
    
    .hamburger-line {
        display: block;
        width: 100%;
        height: 3px;
        background-color: white;
        position: absolute;
        transition: all 0.3s;
        border-radius: 3px;
    }
    
    .hamburger-line:nth-child(1) {
        top: 0;
    }
    
    .hamburger-line:nth-child(2) {
        top: 50%;
        transform: translateY(-50%);
    }
    
    .hamburger-line:nth-child(3) {
        bottom: 0;
    }
    
    /* Active state for hamburger menu */
    .hamburger-menu.active .hamburger-line:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }
    
    .hamburger-menu.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active .hamburger-line:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }
    .city3d-link {
        margin: 0.3rem 0;
        justify-content: flex-start;
        width: auto;
        align-self: flex-start;
    }
    
    .new-badge {
        transform: rotate(45deg) translateX(22px) translateY(-14px);
        padding: 4px 20px;
        font-size: 0.65rem;
    }

    /* Add these new styles for language dropdown on mobile */
    .language-dropdown {
        position: relative;
        width: 100%;
    }
    
    .language-dropdown-content {
        right: auto;
        left: 0;
        width: 100%;
        max-width: 200px;
    }

    /* Responsive adjustments for profile */
    .profile-selector {
        order: 1;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .profile-dropdown {
        width: 100%;
    }
    
    .profile-current {
        margin: 0.5rem 0;
    }
    
    .profile-dropdown-content {
        left: 0;
        right: auto;
        width: 100%;
    }
}

@media (max-width: 360px) {
    /* Additional styles for very small screens */
    header h1 {
        font-size: 1rem; /* Smaller title on very small screens */
    }
    
    .hamburger-menu {
        margin-right: 0.5rem; /* Less margin on very small screens */
    }
}

@media (min-width: 769px) {
    .hamburger-menu {
        display: none;
    }
}
