/* --- HEADER BUTTONS & CONTROLS --- */
.header-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.header-left, .header-right { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
}

/* Wrapper for the language selector to position the icon */
.language-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.language-select-wrapper .fa-globe { 
    position: absolute;
    left: 0.75rem;
    color: var(--ucp-button-text); 
    font-size: 1.2rem; 
    pointer-events: none; /* Allows clicks to go through to the select */
}

.ucp-button-small {
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--ucp-button-text);
    border: 1px solid var(--ucp-gold);
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-family: 'RiverAvenue', cursive;
}

.ucp-button-small:hover { 
    background-color: rgba(25, 25, 25, 0.8); 
    border-color: #eac888; 
}

#downloadBtn {
    border: 10px solid transparent;
    border-image: url('../assets/ucp3/button_ucp.png') 8 fill;
    background-color: transparent;
    color: var(--ucp-button-text);
    font-size: 1.4rem; 
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-family: 'RiverAvenue', cursive;

    position: relative; 
    
    padding: 0.5rem 2.1rem 0.5rem 5rem; 
}

#downloadBtn:hover { 
    border-image-source: url('../assets/ucp3/button_ucp_hover.png'); 
}

.download-logo-overlay {
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    
    height: 80px; 
    width: auto;
}

.ucp-select {
    appearance: none;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--ucp-button-text);
    border: 1px solid var(--ucp-gold);
    border-radius: 4px;
    padding: 0.4rem 1rem 0.4rem 2.5rem;
    font-size: 0.9rem;
    font-family: 'RiverAvenue', cursive;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: 50%;
}

/* --- HEADER RESPONSIVE BREAKPOINTS --- */

/* Initially hide the mobile navigation container on desktop */
.mobile-nav-container {
    display: none;
}

/* In header.css */

@media (max-width: 1024px) {
    
    /* --- 1. Grid layout for the TOP controls --- */
    .header-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 0.5rem 1rem;
        margin-bottom: 0;
    }

    /* Place items on the grid */
    .header-left {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
    }
    .header-right {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
    }
    #downloadBtn {
        grid-row: 2;
        grid-column: 1 / -1;
        justify-self: center;
        margin-top: 0;
    }

    /* --- 2. Position the SEPARATE Mobile Navigation Menu --- */
    .mobile-nav-container {
        display: flex;
        margin-top: 10px;
    }

    /* --- Other Mobile Menu Styles --- */
    #mobile-menu-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-menu-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--ucp-top-bg);
        border: 1px solid var(--ucp-gold);
        padding: 10px;
        border-radius: 4px;
        z-index: 30;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        min-width: 200px;
    }

    .mobile-menu-dropdown a {
        display: block;
        color: var(--ucp-parchment);
        padding: 8px 12px;
        text-decoration: none;
        font-family: 'RiverAvenue', cursive;
    }
    
    .mobile-menu-dropdown a:hover {
        background-color: rgba(0,0,0,0.2);
    }
}