/*
* Gamezeel Header & Footer Stylesheet
*
* This file contains all styles for the site's main header and footer,
* including the responsive mobile menu and dynamic category dropdown.
*/

/* =============================================== */
/* Header & Navigation                           */
/* =============================================== */
.site-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky; /* Keeps the header at the top */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height, 70px);
}

.logo {
    font-family: 'Teko', sans-serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dark-mode-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px 10px;
    border-radius: 50%;
    transition: background-color 0.3s, color 0.3s;
}

.dark-mode-toggle:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* =============================================== */
/* Navigation Dropdown Menu                      */
/* =============================================== */
.nav-item-dropdown {
    position: relative;
}

.nav-link-dropdown-toggle::after {
    content: ' \25BC'; /* Downward-pointing triangle */
    font-size: 0.7em;
    display: inline-block;
    margin-left: 5px;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1001;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 0;
    list-style: none;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.nav-dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
}

/* Desktop hover functionality */
.nav-item-dropdown:hover .nav-dropdown-menu {
    display: block;
}

/* Mobile tap functionality (class added by JavaScript) */
.nav-item-dropdown.active .nav-dropdown-menu {
    display: block;
}

/* =============================================== */
/* Responsive Mobile Navigation                  */
/* =============================================== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .nav-wrapper {
        display: none;
        position: absolute;
        top: var(--header-height, 70px);
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    
    .nav-wrapper.active {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    .nav-links li a {
        padding: 15px 20px;
        width: 100%;
        display: block;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
        min-width: 100%;
        padding-left: 20px;
        background-color: rgba(0,0,0,0.1);
    }
    
    .nav-item-dropdown:hover .nav-dropdown-menu {
        display: none; /* Disable hover on mobile */
    }

    .mobile-menu-toggle {
        display: block;
    }
}

/* =============================================== */
/* Footer Styles                                 */
/* =============================================== */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 50px;
    color: var(--text-muted);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

/* =============================================== */
/* Custom Color Variable Usage                   */
/* =============================================== */
/* This ensures the custom colors from your admin panel are used */

.logo:hover,
.nav-links a:hover,
.footer-nav a:hover,
.nav-dropdown-menu li a:hover {
    color: var(--text-hover-color, var(--primary-color));
}

/* ================================================================= */
/* NEW & IMPROVED Search Bar Styles (REPLACE OLD STYLES WITH THIS) */
/* ================================================================= */

.search-form {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1); /* Slightly transparent background */
    border: 1px solid var(--border-color);
    border-radius: 50px; /* Pill shape */
    padding: 4px; /* A little space inside the form */
    transition: background-color 0.3s;
}

.search-form:focus-within {
    /* When the user clicks inside the form, make the border glow */
    background-color: var(--surface-color);
    border-color: var(--primary-color);
}

.search-input {
    border: none;
    background: none;
    outline: none;
    color: var(--text-color);
    padding: 8px 15px;
    font-size: 0.9rem;
    width: 180px; /* Default width */
    transition: width 0.4s ease-in-out; /* Smooth transition for the expansion */
}

/* When the user clicks the input, it expands */
.search-input:focus {
    width: 250px;
}

.search-btn {
    background-color: var(--primary-color);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%; /* Perfect circle */
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
    flex-shrink: 0; /* Prevents the button from shrinking */
}

.search-btn:hover {
    background-color: var(--secondary-color);
}

/* On mobile, we hide the search form for a cleaner look */
@media (max-width: 992px) {
    .search-form {
        display: none;
    }
}

