/* ============================================= */
/* SCORE.CO.ID - FOOTBALL NEWS HEADER STYLES */
/* ============================================= */

/* BASE HEADER STYLES */
.site-header {
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 3px solid #00A676;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.site-header.scrolled {
    background: rgba(0, 0, 0, 0.98);
    box-shadow: 0 2px 20px rgba(0, 166, 118, 0.2);
}

.site-header.hidden {
    transform: translateY(-100%);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.site-branding {
    flex-shrink: 0;
}

.logo img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

/* DESKTOP MENU - UPDATED TO HANDLE BOTH HTML STRUCTURES */
.desktop-menu {
    flex-grow: 1;
}

.primary-menu > li > a,
.primary-menu ul > li > a,
.primary-menu > ul > li > a {
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    display: block;
}

.primary-menu > li > a:hover,
.primary-menu ul > li > a:hover,
.primary-menu > ul > li > a:hover {
    background: #00A676;
    color: white;
}

.primary-menu,
.primary-menu > ul {
    display: flex;
    list-style: none;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.menu-item-has-children {
    position: relative;
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(20, 20, 20, 0.98);
    min-width: 250px;
    border-radius: 8px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    list-style: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    margin: 0;
}

.primary-menu > li:hover > .sub-menu,
.primary-menu ul > li:hover > .sub-menu,
.primary-menu > ul > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu li {
    width: 100%;
}

.sub-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: #ddd;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sub-menu a:hover {
    background: #00A676;
    color: white;
}

/* HAMBURGER BUTTON */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
    display: none;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.is-active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* MOBILE MENU - UPDATED FOR BOTH STRUCTURES */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    background: rgba(10, 10, 10, 0.98);
    padding: 6rem 2rem 2rem;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: none;
}

.mobile-menu.is-open {
    right: 0;
    display: block;
}

/* Handle both .mobile-menu-list AND .mobile-menu-list > ul */
.mobile-menu-list,
.mobile-menu-list > ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list li,
.mobile-menu-list > ul li {
    margin-bottom: 0.5rem;
}

.mobile-menu-list a,
.mobile-menu-list > ul a {
    display: block;
    padding: 1rem;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.mobile-menu-list a:hover,
.mobile-menu-list > ul a:hover {
    background: #00A676;
}

.mobile-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    box-shadow: none;
    padding-left: 1rem;
    margin: 0.5rem 0;
}

/* ============================================= */
/* RESPONSIVE STYLES */
/* ============================================= */

/* DESKTOP (1024px and above) */
@media (min-width: 1024px) {
    .hamburger {
        display: none;
    }
    
    .mobile-menu {
        display: none !important;
    }
    
    .desktop-menu {
        display: block;
    }
}

/* TABLET (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .desktop-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .header-inner {
        padding: 0.8rem 0;
    }
    
    .logo img {
        height: 55px;
    }
}

/* MOBILE (767px and below) */
@media (max-width: 767px) {
    .site-header {
        background: rgba(0, 0, 0, 0.75) !important;
        backdrop-filter: blur(12px) !important;
        border-bottom: 2px solid rgba(0, 166, 118, 0.6);
        height: auto;
        min-height: 60px;
    }
    
    .header-inner {
        padding: 0.5rem 0 !important;
        min-height: 60px;
    }
    
    .logo img {
        height: 45px !important;
        max-height: 45px;
    }

    .desktop-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
        width: 44px;
        height: 44px;
        padding: 0.5rem;
        background: rgba(0, 166, 118, 0.15);
        border: 1px solid rgba(0, 166, 118, 0.3);
        border-radius: 8px;
        margin: 0;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
        background: white;
        margin: 0 auto;
    }
    
    .mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.85);
        backdrop-filter: blur(15px);
        max-height: 75vh; 
        overflow-y: auto;
        overflow-x: hidden;
        border-bottom: 3px solid #00A676;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 999;
        transform: translateY(-10px);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 100%;
        right: -100%;
    }
    
    .mobile-menu.is-open {
        display: block;
        transform: translateY(0);
        opacity: 1;
        right: 0;
    }

    /* Handle both mobile menu structures */
    .mobile-menu-list,
    .mobile-menu-list > ul {
        list-style: none;
        padding: 0.5rem 0;
        margin: 0;
    }
    
    .mobile-menu-list > li,
    .mobile-menu-list > ul > li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .mobile-menu-list > li:last-child,
    .mobile-menu-list > ul > li:last-child {
        border-bottom: none;
    }

    .mobile-menu-list > li > a,
    .mobile-menu-list > ul > li > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.9rem 1.2rem;
        color: white;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.95rem;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-list > li > a:hover,
    .mobile-menu-list > ul > li > a:hover {
        background: rgba(0, 166, 118, 0.15);
        padding-left: 1.5rem;
    }
    
    .mobile-menu-list .menu-item-has-children > a::after,
    .mobile-menu-list > ul .menu-item-has-children > a::after {
        content: '▼';
        font-size: 0.7rem;
        margin-left: 0.5rem;
        opacity: 0.6;
        transition: transform 0.3s ease;
    }
    
    .mobile-menu-list .menu-item-has-children > a.submenu-open::after,
    .mobile-menu-list > ul .menu-item-has-children > a.submenu-open::after {
        transform: rotate(180deg);
    }
    
    .mobile-menu .sub-menu {
        background: rgba(20, 20, 20, 0.85);
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-left: 2px solid rgba(0, 166, 118, 0.3);
    }
    
    .mobile-menu .sub-menu.submenu-open {
        max-height: 500px; 
    }
    
    .mobile-menu .sub-menu li {
        margin: 0;
    }
    
    .mobile-menu .sub-menu a {
        display: block;
        padding: 0.8rem 1.2rem 0.8rem 2rem;
        color: #ccc;
        font-size: 0.9rem;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .mobile-menu .sub-menu a:hover {
        background: rgba(0, 166, 118, 0.2);
        color: white;
        padding-left: 2.2rem;
    }
    
    body.menu-open {
        overflow: hidden;
    }
}

/* SMALL MOBILE (480px and below) */
@media (max-width: 480px) {
    .logo img {
        height: 40px !important;
    }
    
    .hamburger {
        width: 40px;
        height: 40px;
    }
}

/* ANIMATIONS */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu.is-open .mobile-menu-list > li,
.mobile-menu.is-open .mobile-menu-list > ul > li {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

.mobile-menu.is-open .mobile-menu-list > li:nth-child(1),
.mobile-menu.is-open .mobile-menu-list > ul > li:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu.is-open .mobile-menu-list > li:nth-child(2),
.mobile-menu.is-open .mobile-menu-list > ul > li:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu-list > li:nth-child(3),
.mobile-menu.is-open .mobile-menu-list > ul > li:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu-list > li:nth-child(4),
.mobile-menu.is-open .mobile-menu-list > ul > li:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu.is-open .mobile-menu-list > li:nth-child(5),
.mobile-menu.is-open .mobile-menu-list > ul > li:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu.is-open .mobile-menu-list > li:nth-child(6),
.mobile-menu.is-open .mobile-menu-list > ul > li:nth-child(6) { animation-delay: 0.3s; }