/**
 * BTFC Stats Independent Menu System - Base Styles
 * 
 * Core styles and CSS custom properties for the menu system
 * 
 * @package BTFC_Stats
 * @since 1.0.0
 */

/* ============================================
   CSS Custom Properties (Variables)
   ============================================ */

:root {
    --btfc-menu-bg: #2d398c;
    --btfc-menu-bg-gradient: linear-gradient(135deg, #2d398c 0%, #1e2a5a 100%);
    --btfc-menu-text: white;
    --btfc-menu-accent: #FFC10C;
    --btfc-menu-hover: rgba(255, 255, 255, 0.15);
    --btfc-menu-border: rgba(255, 193, 12, 0.3);
    --btfc-menu-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --btfc-menu-transition: all 0.3s ease;
    --btfc-menu-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --btfc-menu-border-radius: 8px;
    --btfc-menu-padding: 15px 20px;
    --btfc-menu-gap: 10px 20px;
    --btfc-menu-max-width: 1200px;
    --btfc-menu-min-height: 100px;
    --btfc-menu-z-index: 1000;
}

/* ============================================
   Main Menu Container
   ============================================ */

.btfc-independent-menu {
    background: var(--btfc-menu-bg-primary) !important;
    box-shadow: var(--btfc-menu-shadow-medium);
    position: relative;
    z-index: var(--btfc-menu-z-index);
    font-family: var(--btfc-menu-font-family);
    width: 100%;
    display: block;
}

/* Hide WordPress skip links that might appear within or near the menu */
.btfc-independent-menu .screen-reader-text,
.btfc-independent-menu .skip-link,
.btfc-independent-menu a[href="#main"],
.btfc-independent-menu a[href="#content"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

/* Hide skip links that appear immediately before the menu */
.btfc-independent-menu:before,
.btfc-independent-menu + .screen-reader-text,
.btfc-independent-menu + .skip-link {
    display: none !important;
}

/* Hide skip links that appear in the header area when menu is present */
header .screen-reader-text,
header .skip-link,
.site-header .screen-reader-text,
.site-header .skip-link,
.page-header .screen-reader-text,
.page-header .skip-link {
    display: none !important;
}

/* Hide specific skip link targeting btfc-main-content */
a[href*="#btfc-main-content"],
a[href*="/#btfc-main-content"],
.screen-reader-text a[href*="btfc-main-content"] {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

/* Hide duplicate menus - only show the first one */
.btfc-independent-menu + .btfc-independent-menu,
.btfc-header-template + .btfc-independent-menu,
.btfc-independent-menu + .btfc-header-template {
    display: none !important;
}

/* Hide any menu that appears after the first one */
.btfc-independent-menu:not(:first-of-type),
.btfc-header-template:not(:first-of-type) {
    display: none !important;
}

/* Hide sticky menu elements to prevent conflicts */
.btfc-sticky-menu,
.btfc-sticky-menu-list,
.btfc-sticky-menu-item,
.btfc-sticky-menu-link {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.btfc-menu-container {
    max-width: var(--btfc-menu-max-width);
    margin: 0 auto;
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-rows: auto !important;
    gap: var(--btfc-menu-gap);
    padding: var(--btfc-menu-padding);
    min-height: var(--btfc-menu-min-height);
}

/* ============================================
   Bottom Menu Container (Separate)
   ============================================ */

.btfc-bottom-menu-container {
    background: var(--btfc-menu-bg);
    background: var(--btfc-menu-bg-gradient);
    box-shadow: var(--btfc-menu-shadow);
    padding: 0;
    border-top: 1px solid rgba(255, 193, 12, 0.2);
}

/* ============================================
   Common Menu Item Styles
   ============================================ */

.btfc-menu-item {
    position: relative;
    list-style: none;
}

.btfc-menu-link,
.btfc-top-menu-link,
.btfc-bottom-menu-link,
.btfc-dropdown-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--btfc-menu-text-primary);
    border-radius: var(--btfc-menu-radius-base);
    transition: var(--btfc-menu-transition-base);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

.btfc-menu-link:hover,
.btfc-top-menu-link:hover,
.btfc-bottom-menu-link:hover,
.btfc-dropdown-link:hover {
    background: var(--btfc-menu-bg-hover);
    color: var(--btfc-menu-text-primary);
    text-decoration: none;
}

.btfc-menu-icon {
    font-size: 16px;
    line-height: 1;
}

.btfc-menu-text {
    white-space: nowrap;
}

/* ============================================
   Dropdown Menu Styles
   ============================================ */

.btfc-has-dropdown {
    position: relative;
}

.btfc-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--btfc-menu-bg-secondary);
    border-radius: var(--btfc-menu-radius-base);
    box-shadow: var(--btfc-menu-shadow-light);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--btfc-menu-transition-base);
    z-index: 1001;
}

.btfc-has-dropdown:hover .btfc-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btfc-dropdown-item {
    list-style: none;
}

.btfc-dropdown-link {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 0;
}

/* ============================================
   No Menu Message
   ============================================ */

.btfc-no-menu-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.btfc-no-menu-text {
    font-size: 14px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .btfc-menu-container {
        grid-template-columns: 1fr auto !important;
        grid-template-rows: auto auto auto !important;
        gap: 15px;
        padding: 15px;
    }
    
    .btfc-menu-branding {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
    }
    
    .btfc-mobile-menu-toggle {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
    }
    
    .btfc-top-menu,
    .btfc-bottom-menu {
        grid-row: 2;
        grid-column: 1 / -1;
    }
    
    .btfc-menu-actions {
        grid-row: 3;
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.btfc-independent-menu [aria-hidden="true"] {
    display: none;
}

.btfc-independent-menu [aria-expanded="true"] {
    display: block;
}

/* Focus styles for keyboard navigation */
.btfc-menu-link:focus,
.btfc-top-menu-link:focus,
.btfc-bottom-menu-link:focus,
.btfc-dropdown-link:focus {
    outline: var(--btfc-menu-focus-outline);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btfc-independent-menu * {
        transition: none !important;
        animation: none !important;
    }
}
