/*
Theme Name: GTX Gaming Child
Theme URI: https://gtxgaming.co.uk
Description: Custom child theme for GTX Gaming with branded header and WordPress menu integration
Author: GTX Gaming
Author URI: https://gtxgaming.co.uk
Template: bb-theme
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gtx-child
*/

/* ==========================================================================
   GTX Gaming Header Styles
   ========================================================================== */

/* CSS Custom Properties - Brand Colors */
:root {
    --gtx-bg-dark: #0f0f23;
    --gtx-bg-header: #141432;
    --gtx-bg-topbar: #0a0a1a;
    --gtx-orange: #f5a623;
    --gtx-gold: #d4a012;
    --gtx-cyan: #00d4ff;
    --gtx-red: #ff4444;
    --gtx-gradient-start: #ff6b35;
    --gtx-gradient-end: #f5a623;
    --gtx-text-white: #ffffff;
    --gtx-text-gray: #a0a0b0;
    --gtx-text-muted: #6a6a7a;
    --gtx-border-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Top Bar Styles
   ========================================================================== */

.gtx-top-bar {
    background: var(--gtx-bg-topbar);
    border-bottom: 1px solid var(--gtx-border-color);
    padding: 8px 0;
    font-size: 13px;
}

.gtx-top-bar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

/* Top Bar Menu */
.gtx-top-bar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gtx-top-bar-menu li {
    margin: 0;
    padding: 0;
}

.gtx-top-bar-menu li a {
    color: var(--gtx-text-gray);
    text-decoration: none;
    padding: 12px 14px;
    min-height: 48px;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: color 0.2s ease;
    font-weight: 400;
}

.gtx-top-bar-menu li a:hover {
    color: var(--gtx-text-white);
}

/* Social Icons in Top Bar */
.gtx-social-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid var(--gtx-border-color);
}

.gtx-social-icons a {
    color: var(--gtx-text-gray);
    text-decoration: none;
    padding: 12px 12px;
    min-height: 48px;
    min-width: 48px;
    box-sizing: border-box;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
}

.gtx-social-icons a:hover {
    color: var(--gtx-text-white);
}

/* Discord - brighter brand color for accessibility */
.gtx-social-icons a.discord {
    color: #7289da;
}

.gtx-social-icons a.discord:hover {
    color: #99aee5;
}

/* Instagram - brand color by default */
.gtx-social-icons a.instagram {
    color: #E4405F;
}

.gtx-social-icons a.instagram:hover {
    color: #f77737;
}

.gtx-social-icons a.twitter:hover {
    color: var(--gtx-text-white);
}

.gtx-social-icons a.tiktok:hover {
    color: #00f2ea;
}

.gtx-social-icons svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ==========================================================================
   Main Header Styles
   ========================================================================== */

.gtx-main-header {
    background: var(--gtx-bg-header);
    padding: 15px 0;
}

.gtx-main-header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.gtx-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 120px;
}

.gtx-logo-img {
    height: 50px;
    width: auto;
    display: block;
}

/* ==========================================================================
   Primary Navigation Menu
   ========================================================================== */

.gtx-primary-nav {
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.gtx-primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.gtx-primary-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

.gtx-primary-menu > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--gtx-text-white);
    text-decoration: none;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.gtx-primary-menu > li > a:hover {
    color: var(--gtx-orange);
}

/* Active/Current Menu Item */
.gtx-primary-menu > li.current-menu-item > a,
.gtx-primary-menu > li.current-menu-parent > a,
.gtx-primary-menu > li.current-menu-ancestor > a {
    color: var(--gtx-orange);
}

/* Special colored menu items */
.gtx-primary-menu > li.menu-item-home > a {
    color: var(--gtx-orange);
}

.gtx-primary-menu > li.menu-item-game-servers > a {
    background: linear-gradient(90deg, var(--gtx-gradient-start), var(--gtx-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dropdown Arrow */
.gtx-primary-menu > li.menu-item-has-children > a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 5px;
    transition: transform 0.2s ease;
}

.gtx-primary-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* ==========================================================================
   Dropdown/Submenu Styles
   ========================================================================== */

.gtx-primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--gtx-bg-dark);
    border: 1px solid var(--gtx-border-color);
    border-radius: 8px;
    min-width: 220px;
    padding: 10px 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.gtx-primary-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gtx-primary-menu .sub-menu li {
    margin: 0;
    padding: 0;
}

.gtx-primary-menu .sub-menu li a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    min-height: 48px;
    box-sizing: border-box;
    color: var(--gtx-text-gray);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gtx-primary-menu .sub-menu li a:hover {
    color: var(--gtx-text-white);
    background: rgba(255, 255, 255, 0.05);
}

.gtx-primary-menu .sub-menu li.current-menu-item a {
    color: var(--gtx-orange);
}

/* Nested Submenus (Level 3 flyouts) */
.gtx-primary-menu .sub-menu .sub-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.2s ease;
    min-width: 180px;
    padding: 6px 0;
}

.gtx-primary-menu .sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Third level menu item styling */
.gtx-primary-menu .sub-menu .sub-menu li a {
    padding: 12px 14px;
    min-height: 44px;
    font-size: 11px;
    text-transform: none;
    letter-spacing: normal;
}

/* Arrow indicator for items with children in submenus */
.gtx-primary-menu .sub-menu > li.menu-item-has-children > a::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 4px solid currentColor;
    margin-left: auto;
    display: inline-block;
}

/* Make submenu links flex for arrow alignment */
.gtx-primary-menu .sub-menu > li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   WPML Language Selector (appears as menu item)
   ========================================================================== */

/* Style WPML language switcher when it appears in the menu */
.gtx-primary-menu > li.menu-item-wpml-ls-4-en > a,
.gtx-primary-menu > li[class*="wpml-ls"] > a,
.gtx-wpml-language-switcher > a {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--gtx-border-color);
    border-radius: 6px;
    padding: 8px 20px 8px 14px !important;
    margin-left: 10px;
}

.gtx-primary-menu > li.menu-item-wpml-ls-4-en > a:hover,
.gtx-primary-menu > li[class*="wpml-ls"] > a:hover,
.gtx-wpml-language-switcher > a:hover {
    border-color: var(--gtx-orange);
}

/* Fix dropdown arrow alignment for language selector */
.gtx-primary-menu > li[class*="wpml-ls"].menu-item-has-children > a::after,
.gtx-primary-menu > li.menu-item-wpml-ls-4-en.menu-item-has-children > a::after {
    margin-left: 6px;
    flex-shrink: 0;
    align-self: center;
}

/* WPML flag styling - scoped to header */
.gtx-header-wrapper .wpml-ls-flag,
.gtx-primary-menu img.wpml-ls-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
}

/* WPML language name - scoped to header */
.gtx-header-wrapper .wpml-ls-native {
    font-weight: 600;
}

/* WPML dropdown styling */
.gtx-wpml-language-switcher {
    position: relative;
}

.gtx-wpml-language-switcher .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    background: var(--gtx-bg-dark);
    border: 1px solid var(--gtx-border-color);
    border-radius: 8px;
    min-width: 150px;
    padding: 10px 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.gtx-wpml-language-switcher:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gtx-wpml-language-switcher .sub-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    min-height: 48px;
    box-sizing: border-box;
    color: var(--gtx-text-gray);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.gtx-wpml-language-switcher .sub-menu li a:hover {
    color: var(--gtx-text-white);
    background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Mobile Menu Toggle
   ========================================================================== */

.gtx-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--gtx-border-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    gap: 5px;
}

.gtx-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gtx-text-white);
    transition: all 0.3s ease;
}

.gtx-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.gtx-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.gtx-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1200px) {
    .gtx-primary-menu > li > a {
        padding: 10px 8px;
        font-size: 9px;
    }
}

@media (max-width: 1100px) {
    .gtx-primary-menu > li > a {
        padding: 8px 6px;
        font-size: 8px;
        letter-spacing: 0.3px;
    }
}

@media (max-width: 992px) {
    /* Show mobile toggle */
    .gtx-mobile-toggle {
        display: flex;
    }

    /* Hide desktop nav */
    .gtx-primary-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--gtx-bg-dark);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }

    .gtx-primary-nav.active {
        right: 0;
    }

    .gtx-primary-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .gtx-primary-menu > li > a {
        padding: 15px 20px;
        border-bottom: 1px solid var(--gtx-border-color);
    }

    /* Mobile submenus */
    .gtx-primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, 0.2);
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        display: none;
    }

    .gtx-primary-menu .menu-item-has-children.submenu-open > .sub-menu {
        display: block;
    }

    .gtx-primary-menu .sub-menu li a {
        padding: 14px 20px 14px 40px;
        min-height: 48px;
    }

    /* Nested mobile submenus (level 3) */
    .gtx-primary-menu .sub-menu .sub-menu {
        background: rgba(0, 0, 0, 0.3);
    }

    .gtx-primary-menu .sub-menu .sub-menu li a {
        padding: 14px 20px 14px 60px;
        min-height: 48px;
    }

    /* Mobile arrow for nested items */
    .gtx-primary-menu .sub-menu > li.menu-item-has-children > a::after {
        border-left: none;
        border-top: 4px solid currentColor;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        transition: transform 0.2s ease;
    }

    .gtx-primary-menu .sub-menu > li.menu-item-has-children.submenu-open > a::after {
        transform: rotate(180deg);
    }

    /* Mobile menu overlay */
    .gtx-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 998;
    }

    .gtx-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Hide top bar on mobile or stack it */
    .gtx-top-bar .container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .gtx-top-bar-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .gtx-social-icons {
        border-left: none;
        margin-left: 0;
        padding-left: 0;
        margin-top: 5px;
        width: 100%;
        justify-content: center;
    }

    .gtx-wpml-language-switcher {
        margin-left: 0;
        margin-top: 20px;
        width: 100%;
    }

    .gtx-wpml-language-switcher > a {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .gtx-top-bar {
        padding: 6px 0;
    }

    .gtx-top-bar-menu li a {
        padding: 10px 10px;
        min-height: 44px;
        min-width: 44px;
        font-size: 11px;
    }

    .gtx-social-icons a {
        padding: 10px 10px;
        min-height: 44px;
        min-width: 44px;
    }

    .gtx-logo-img {
        height: 40px;
    }

    .gtx-main-header {
        padding: 10px 0;
    }
}

/* ==========================================================================
   Close Button for Mobile Menu
   ========================================================================== */

.gtx-mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--gtx-border-color);
    border-radius: 6px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--gtx-text-white);
    font-size: 24px;
}

@media (max-width: 992px) {
    .gtx-mobile-close {
        display: flex;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Header wrapper - isolated from page content */
.gtx-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Ensure page content is not affected by header styles */
.site-content,
#content {
    /* Reset any potential inherited styles from header */
}

/* Screen reader text - scoped to header only */
.gtx-header-wrapper .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Skip Link - Accessibility
   ========================================================================== */

/* Skip to content link - hidden until focused */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    background: var(--gtx-orange);
    color: var(--gtx-bg-dark);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--gtx-text-white);
    outline-offset: 2px;
}

/* General screen reader text utility */
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.screen-reader-text:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: inherit !important;
    margin: inherit !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* ==========================================================================
   Search Box Fix
   ========================================================================== */

/* Fix search input visibility */
input[type="search"],
input[type="text"].search-field,
.search-form input[type="search"],
.search-form input[type="text"],
.fl-search-input,
input.search-field {
    background-color: var(--gtx-bg-dark) !important;
    color: var(--gtx-text-white) !important;
    border: 1px solid var(--gtx-border-color) !important;
    padding: 10px 15px !important;
}

input[type="search"]::placeholder,
input[type="text"].search-field::placeholder,
.search-form input::placeholder,
.fl-search-input::placeholder,
input.search-field::placeholder {
    color: var(--gtx-text-gray) !important;
}

