/* Mobile Header Animations */
@keyframes slideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Mobile Header Styles */
.mobile-header {
    display: none; /* Hidden by default on desktop */
}

.mobile-logo {
    height: 30px;
    width: auto;
    filter: brightness(0) invert(1); /* Makes the SVG logo white */
    display: block;
}

/* Container for the top-right mobile region/language selector button */
.fixed-modal-trigger-container {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 10px;
    position: relative;
}

/* Mobile Region Selector Styles */
.mobile-region-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent; /* Make background transparent */
    padding: 8px;
    border-radius: 50%; /* Make it circular */
    cursor: pointer;
    border: 1px solid #555;
    width: 40px;  /* Set a fixed width */
    height: 40px; /* Set a fixed height */
}

.mobile-globe-icon {
    width: 24px;  /* Size the icon */
    height: 24px; /* Size the icon */
    filter: brightness(0) invert(1); /* Make SVG icon white */
}

.mobile-region-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}



.mobile-region-dropdown {
    position: fixed;
    background-color: #222;
    border: 1px solid var(--color-primary, #00ff9d);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 255, 157, 0.3);
    z-index: 10001; /* Increased z-index */
    overflow: hidden;
    width: 140px; /* Reduced width */
    max-height: 300px;
    overflow-y: auto;
    /* Positioning now handled dynamically in JS */
    animation: fadeIn 0.2s ease-out forwards;
}

.mobile-region-item {
    padding: 10px 15px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 255, 157, 0.2);
    position: relative;
    text-align: right;
}

.mobile-region-item:last-child {
    border-bottom: none;
}

.mobile-region-item:hover {
    background-color: rgba(0, 255, 157, 0.2);
    color: var(--color-primary, #00ff9d);
    text-shadow: 0 0 5px var(--color-primary, #00ff9d);
    padding-right: 20px;
}

.mobile-region-item:active {
    background-color: var(--color-primary, #00ff9d);
    color: #000;
}

@media (max-width: 768px) {
    /* Mobile header styling */
    .mobile-header {
        display: flex !important;
        position: fixed;
        align-items: center;
        justify-content: space-between; /* Changed to space-between for logo and region selector */
        background-color: #333;
        padding: 0.5rem 1rem;
        width: 100%;
        top: 0;
        left: 0;
        z-index: 9999;
        clip-path: polygon(
            0% 0%,                  /* Top left corner */
            0% 75%,                 /* Bottom left corner */
            62% 75%,                /* Bottom point */
            65% 100%,              /* Bottom right point */
            100% 100%,             /* Right line */
            100% 0%                /* Top right corner */
        );
        height: 50px;
        animation: slideDown 0.5s ease-out forwards;
    }
    
    /* Ensure dropdown is visible on mobile */
    .mobile-region-dropdown {
        display: block !important;
        background-color: #222 !important;
        border: 2px solid var(--color-primary, #00ff9d) !important;
        position: fixed !important; /* Ensure position is fixed */
        max-height: 80vh !important; /* Limit height on mobile */
        max-width:50%;
    }
    
    /* Special handling for location page */
    body.location-page .mobile-region-dropdown {
        top: 50px !important; /* Force position below header on location page */
    }
    
    /* Add space for the mobile header in content */
    main {
        margin-top: 10px !important;
    }
}
