/* ================================================================================= */
/* === Global Header Styles (Consolidated & Corrected) === */
/* ================================================================================= */

header {
    width: 100%;
    background: #222;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.5);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 102;
    box-sizing: border-box;
    height: 70px;
    border-bottom: 3px solid #00a8ff;
}
.header-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
.header-left a {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.header-left h1 {
    font-size: 1.6rem;
    color: #00a8ff;
    margin: 0;
    user-select: none;
    white-space: nowrap;
}
.header-left .tagline {
    font-size: 0.8rem;
    color: #aaa;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    white-space: nowrap;
}
.header-center {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 20px; /* Add some margin to separate from other elements */
}
#headerMainLogo {
    max-height: 70px;
    width: auto;
    display: block;
    filter: drop-shadow(0px 0px 8px rgba(0, 122, 204, 0.7));
}
.header-right-controls {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}
.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Base Button Style for header buttons */
.header-right-controls .btn {
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    line-height: 1.4;
    padding: 0 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
    user-select: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: none;
    box-sizing: border-box;
    outline: none;
    overflow: hidden;
    position: relative;
    z-index: 0;
    text-align: center;
    text-transform: none;
    vertical-align: middle;
    min-width: min-content;
    background-color: #131314;
    border: 1px solid #00a8ff;
    color: #e3e3e3;
    height: 40px;
    margin: 0; /* Override the default margin */
}
.header-text-link {
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 8px 12px;
    color: #00a8ff;
    background: none;
    border: none;
    box-shadow: none;
}
.header-text-link:hover {
    text-decoration: underline;
    color: #00e0ff;
    transform: translateY(-1px);
}
.btn:not(:disabled):hover, .btn:not(:disabled):focus {
    border-color: #4dc4ff;
    box-shadow: 0 1px 2px 0 rgba(0, 168, 255, .30), 0 1px 3px 1px rgba(0, 168, 255, .15);
    transform: translateY(-1px);
}
.btn .btn-text {
    order: 1;
}
.btn .btn-icon {
    order: 2;
    display: inline-flex;
    align-items: center;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #1e1e1e;
    min-width: 240px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
    z-index: 1001;
    border-radius: 8px;
    border: 1px solid #00a8ff;
    left: auto;
    right: 0;
    top: calc(100% + 5px);
    overflow-y: auto;
    max-height: 300px;
    padding: 0;
}
.dropdown-content a {
    color: #d0d0d0;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    text-align: left;
}
.dropdown-content a:hover {
    background-color: #333333;
    color: #00c0ff;
}
.dropdown-divider {
    height: 1px;
    margin: 8px 0;
    background-color: #444;
}
#usefulLinksDropdown a::after {
    content: "\00a0\00a0🔗";
}

/* --- Mobile Info Icon Visibility & Position --- */
#info-icon-mobile {
    display: none;
}

@media (max-width: 780px) {
    #info-icon-mobile {
        display: block;
        font-size: 28px;
        margin-left: auto;
        margin-right: -10px;
        align-self: center;
    }
}
//* ================================================================================= */
/* === Media Queries for Responsiveness === */
/* ================================================================================= */

/* Desktop layout has already been set, so we only need to handle tablet and mobile. */

/* MODIFIED: Tablet AND Desktop Header Customization (769px and wider) */
@media (min-width: 769px) {
    header .header-center,
    header .tagline {
        display: none !important;
    }
    header {
        justify-content: space-between;
        padding: 0 15px;
    }
    header .btn {
        min-width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(0, 168, 255, 0.1);
        border: 1px solid #00a8ff;
    }
    header .btn:hover {
        background-color: rgba(0, 168, 255, 0.25);
    }
    header .btn .btn-text {
        display: none !important;
    }
    header .btn .btn-icon {
        margin: 0;
        font-size: 1.3em;
    }
    header .header-buttons {
        gap: 12px;
    }
    
    .btn#signUpButtonHeader:hover {
        background-color: #2e6b8c; /* Dark blue, a color that would fit the theme */
        color: #ffffff; /* Keep the text white for contrast */
        cursor: pointer;
    }

    #usefulLinksBtn, #contactUsBtn, .header-text-link {
        width: auto;
        padding: 0 12px;
        border-radius: 22px;
        height: 40px;
        border: 1px solid #00a8ff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile Header Customization (up to 768px) */
@media (max-width: 768px) {
    /* ... your mobile styles remain unchanged ... */
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        padding: 8px 10px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    #headerEditProfileBtn {
        display: none;
    }
    
    .header-left, .header-center, .header-right-controls {
        flex-basis: 100%;
        width: 100%;
        justify-content: center;
        margin: 0;
    }
    .header-left {
        margin-bottom: 10px;
    }
    .header-center {
        display: none;
    }
    .header-left h1 {
        font-size: 1.4rem;
    }
    .tagline {
        font-size: 0.7rem;
    }
    .header-buttons, .header-right-controls {
        gap: 5px;
        flex-wrap: wrap;
    }
    .header-right-controls .btn,
    .header-right-controls .header-text-link {
        padding: 5px 8px;
        font-size: 0.85rem;
        height: 30px;
        margin: 2px;
        flex-shrink: 1;
        flex-basis: auto;
    }
    
    .btn .btn-icon {
        margin: 0;
        font-size: 1.6em;
    }
}

@media (max-width: 768px) {
    /* --- Mobile Dropdown Fixes --- */

    /* This more specific selector ensures the positioning anchor is set correctly for all dropdowns in the header. */
    .header-buttons .dropdown {
        position: relative;
    }

    /* This ensures both dropdown menus are centered identically. */
    .header-buttons .dropdown-content {
        position: absolute;
        top: 110%;
        left: 50%;
        transform: translateX(-50%);
        min-width: 220px;
        width: max-content;
    }
}