/**
 * BolaRadar Frontend Stylesheet — Mobile-First Responsive Design
 * Sponsor banner + Logo + Hamburger menu + Modern layout
 */

/* =============================================
   CSS VARIABLES & RESET
   ============================================= */
:root {
    --gold: #d4af37;
    --gold-light: #f0d878;
    --gold-dark: #b8941f;
    --bg: #0a0e27;
    --bg-light: #111827;
    --bg-card: #1a1a2e;
    --text: #e8e0d5;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --header-height: 56px;
    --transition: all 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* =============================================
   FORCE LIGHT TEXT — Override Inline Dark Colors
   This fixes old articles with stored dark text
   ============================================= */
.bnexus-content-wrapper,
.bnexus-content-wrapper p,
.bnexus-content-wrapper h1,
.bnexus-content-wrapper h2,
.bnexus-content-wrapper h3,
.bnexus-content-wrapper h4,
.bnexus-content-wrapper h5,
.bnexus-content-wrapper h6,
.bnexus-content-wrapper li,
.bnexus-content-wrapper span,
.bnexus-content-wrapper div,
.bnexus-content-wrapper strong,
.bnexus-content-wrapper b,
.bnexus-content-wrapper em,
.bnexus-content-wrapper i,
.bnexus-content-wrapper a:not(.bnexus-nav-item):not(.bnexus-footer-btn):not(.bnexus-sponsor-link):not(.bnexus-homepage-link a) {
    color: var(--text) !important;
}

/* Keep links colored but visible — EXCLUDE footer CTA button */
.bnexus-content-wrapper a:not(.bnexus-footer-btn):not(.bnexus-homepage-link a) {
    color: var(--gold) !important;
}

/* Tables inside content — force all cells to light text */
.bnexus-content-wrapper table,
.bnexus-content-wrapper table td,
.bnexus-content-wrapper table th,
.bnexus-content-wrapper table tr,
.bnexus-content-wrapper table tbody,
.bnexus-content-wrapper table thead,
.bnexus-content-wrapper table tfoot {
    color: var(--text) !important;
    background: var(--bg-card) !important;
}

/* Table headers with gold background need dark text for contrast */
.bnexus-content-wrapper table th {
    color: #0a0e27 !important;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
}

/* Odds/probability numbers in tables */
.bnexus-content-wrapper td[style*="#4caf50"],
.bnexus-content-wrapper td[style*="#ff9800"],
.bnexus-content-wrapper td[style*="#2196f3"],
.bnexus-content-wrapper td[style*="#e74c3c"],
.bnexus-content-wrapper td[style*="#2ecc71"],
.bnexus-content-wrapper td[style*="#f39c12"] {
    color: inherit !important;
}

/* Force any element with inline dark colors to be light */
.bnexus-content-wrapper [style*="color:#1a"],
.bnexus-content-wrapper [style*="color: #1a"],
.bnexus-content-wrapper [style*="color:#0a"],
.bnexus-content-wrapper [style*="color: #0a"],
.bnexus-content-wrapper [style*="color:#000"],
.bnexus-content-wrapper [style*="color: #000"],
.bnexus-content-wrapper [style*="color:black"],
.bnexus-content-wrapper [style*="color: black"],
.bnexus-content-wrapper [style*="color:#333"],
.bnexus-content-wrapper [style*="color: #333"],
.bnexus-content-wrapper [style*="color:#222"],
.bnexus-content-wrapper [style*="color: #222"] {
    color: var(--text) !important;
}

/* =============================================
   HEADER & NAVIGATION
   ============================================= */
.bnexus-header {
    background: var(--bg);
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: var(--shadow);
}

.bnexus-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

/* Logo */
.bnexus-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.bnexus-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.bnexus-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* =============================================
   HAMBURGER MENU (MOBILE)
   ============================================= */
.bnexus-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid var(--gold);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 8px;
    z-index: 10001;
}

.bnexus-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: var(--transition);
}

.bnexus-menu-toggle[aria-expanded="true"] .bnexus-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.bnexus-menu-toggle[aria-expanded="true"] .bnexus-bar:nth-child(2) {
    opacity: 0;
}

.bnexus-menu-toggle[aria-expanded="true"] .bnexus-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   NAVIGATION LINKS
   ============================================= */
.bnexus-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bnexus-nav-item {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.bnexus-nav-item:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
}

.bnexus-nav-item.bnexus-nav-active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0d0d0d;
    font-weight: 700;
}

/* =============================================
   MAIN CONTENT WRAPPER
   ============================================= */
.bnexus-site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bnexus-main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 16px 40px;
}

.bnexus-content-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* =============================================
   TABLE STYLES
   ============================================= */
.bnexus-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 14px;
}

.bnexus-table thead {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0a0e27;
}

.bnexus-table th,
.bnexus-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.bnexus-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.bnexus-table tbody tr:hover {
    background: #f0f4ff;
}

/* =============================================
   FEATURED IMAGE
   ============================================= */
.bnexus-featured-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    display: block;
    margin: 0 auto 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* =============================================
   HOMEPAGE BANNER
   ============================================= */
.bnexus-homepage-link {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
}

.bnexus-homepage-link a {
    color: #0d0d0d;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    display: block;
}

/* =============================================
   FOOTER CTA
   ============================================= */
.bnexus-footer-cta {
    background: var(--bg-light);
    border: 2px solid var(--gold);
    padding: 24px;
    border-radius: var(--radius);
    margin-top: 30px;
    text-align: center;
}

.bnexus-footer-text {
    color: var(--text) !important;
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.6;
}

.bnexus-footer-btn,
.bnexus-content-wrapper .bnexus-footer-btn,
.bnexus-content-wrapper .bnexus-footer-btn:link,
.bnexus-content-wrapper .bnexus-footer-btn:visited {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0a0e27 !important;
    -webkit-text-fill-color: #0a0e27 !important;
    padding: 14px 36px;
    border-radius: var(--radius-sm);
    font-weight: 900;
    text-decoration: none;
    font-size: 16px;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: 2px solid #0a0e27;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    text-shadow: 0 0 1px rgba(255,255,255,0.3);
}

.bnexus-footer-btn:hover,
.bnexus-content-wrapper .bnexus-footer-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    border-color: var(--gold-light);
    color: #0a0e27 !important;
    -webkit-text-fill-color: #0a0e27 !important;
}

/* =============================================
   FOOTER
   ============================================= */
.bnexus-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 40px 16px 20px;
    margin-top: auto;
}

.bnexus-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.bnexus-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.bnexus-footer-col h4 {
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bnexus-footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
    transition: var(--transition);
}

.bnexus-footer-col a:hover {
    color: var(--gold);
    padding-left: 4px;
}

.bnexus-footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
}

.bnexus-footer-bottom p {
    color: var(--text) !important;
    font-size: 13px;
    margin: 0;
    letter-spacing: 0.3px;
}

.bnexus-footer-bottom a {
    color: var(--gold) !important;
    text-decoration: none;
}

/* =============================================
   MOBILE RESPONSIVE — MAX 768px
   ============================================= */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
    }

    /* Sponsor banner: reduce max-width */
    .bnexus-sponsor-link {
        max-width: 100%;
    }

    .bnexus-sponsor-img {
        max-width: 100%;
    }

    /* Show hamburger, hide nav by default */
    .bnexus-menu-toggle {
        display: flex;
    }

    .bnexus-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 2px solid var(--gold);
        flex-direction: column;
        padding: 8px 16px 16px;
        gap: 2px;
        box-shadow: var(--shadow);
    }

    .bnexus-nav.bnexus-nav-open {
        display: flex;
    }

    .bnexus-nav-item {
        display: block;
        width: 100%;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        font-size: 15px;
    }

    .bnexus-nav-item.bnexus-nav-active {
        margin: 4px 0;
    }

    /* Content */
    .bnexus-main {
        padding: 12px 12px 30px;
    }

    .bnexus-content-wrapper {
        padding: 16px;
        border-radius: var(--radius-sm);
    }

    /* Tables: smaller text */
    .bnexus-table {
        font-size: 12px;
    }

    .bnexus-table th,
    .bnexus-table td {
        padding: 8px 10px;
    }

    /* Footer: 2 columns on tablet */
    .bnexus-footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* =============================================
   MOBILE RESPONSIVE — MAX 480px
   ============================================= */
@media (max-width: 480px) {
    .bnexus-logo-img {
        width: 32px;
        height: 32px;
    }

    .bnexus-logo-text {
        font-size: 16px;
    }

    .bnexus-content-wrapper {
        padding: 14px;
    }

    /* Footer: single column */
    .bnexus-footer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bnexus-footer-cta {
        padding: 18px;
    }

    .bnexus-footer-btn {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Tables: extra small */
    .bnexus-table {
        font-size: 11px;
    }

    .bnexus-table th,
    .bnexus-table td {
        padding: 6px 8px;
    }

    /* Homepage banner */
    .bnexus-homepage-link {
        padding: 10px 14px;
    }

    .bnexus-homepage-link a {
        font-size: 13px;
    }
}

/* =============================================
   TABLET 769px–1024px
   ============================================= */
@media (min-width: 769px) and (max-width: 1024px) {
    .bnexus-header-inner {
        padding: 0 12px;
    }

    .bnexus-nav-item {
        padding: 8px 10px;
        font-size: 13px;
    }

    .bnexus-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   LARGE SCREENS 1200px+
   ============================================= */
@media (min-width: 1200px) {
    .bnexus-header-inner,
    .bnexus-main,
    .bnexus-footer-inner {
        max-width: 1200px;
    }
}

/* =============================================
   ACCESSIBILITY
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard nav */
.bnexus-nav-item:focus,
.bnexus-menu-toggle:focus,
.bnexus-footer-btn:focus,
.bnexus-logo:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
