/* Dashboard Layout Styles */

/* CRITICAL: Remove all top spacing from page */
body.dashboard-layout,
body.dashboard-layout .dashboard-wrapper,
body.dashboard-layout .dashboard-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Small white padding at top of content */
body.dashboard-layout .dashboard-content {
    margin-top: 0 !important;
    padding-top: 1rem !important;
}

/* Disable smooth scrolling to prevent conflicts with content loading */
html,
body,
body.dashboard-layout {
    scroll-behavior: auto !important;
}

/* Prevent auto-scroll on tab content changes */
.tab-content,
.tab-pane {
    overflow-anchor: none;
}

:root {
    --sidebar-width: 260px;
    --header-height: 70px;
    --sidebar-bg: #1a1d29;
    --sidebar-text: #a0a4b8;
    --sidebar-active: #4c6ef5;
    --sidebar-hover-bg: #252938;
    --dashboard-bg: #1a1d29;
    --card-bg: #252938;
    --text-primary: #e9ecef;
    --text-secondary: #a0a4b8;
    --border-color: #363a4a;
}

/* Override any backgrounds to white for light theme */
body.dashboard-layout {
    background-color: #ffffff !important;
    overflow-x: hidden;
}

/* Dashboard Wrapper */
.dashboard-layout {
    overflow-x: hidden;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #ffffff;
    margin: 0 !important;
    padding: 0 !important;
}

/* Sidebar Navigation */
.sidebar-nav {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.25rem;
}

.sidebar-brand:hover {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.9;
}

.sidebar-logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    padding: 0.5rem 0;
}

/* Override SVG text colors for dark sidebar */
.sidebar-brand img {
    /* No filter needed - SVG will display with its original colors */
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    background-color: var(--sidebar-bg);
}

.sidebar-menu .nav-item {
    margin: 0.25rem 0;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    gap: 0.75rem;
}

.sidebar-menu .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-menu .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: #ffffff;
}

.sidebar-menu .nav-link.active {
    background-color: var(--sidebar-hover-bg);
    border-left-color: var(--sidebar-active);
    color: #ffffff;
}

/* Submenu Styles */
.has-submenu > .nav-link {
    position: relative;
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.has-submenu.open > .nav-link .submenu-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0, 0, 0, 0.3);
}

.nav-submenu.show {
    max-height: 300px;
}

.nav-submenu li {
    margin: 0;
}

.nav-submenu a {
    display: block;
    padding: 0.6rem 1.25rem 0.6rem 3.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-submenu a:hover {
    background-color: var(--sidebar-hover-bg);
    color: #ffffff;
}

.nav-submenu a.active {
    background-color: var(--sidebar-hover-bg);
    border-left-color: var(--sidebar-active);
    color: #ffffff;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.nav-section-title {
    padding: 0.75rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #6c757d;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: #ffffff;
}

/* Dashboard Main Content */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ffffff !important;
}

/* Dashboard Header */
.dashboard-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sidebar-toggle {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none !important;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background-color: #ffffff;
    color: #212529;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle:focus {
    outline: none;
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 1rem 2rem 2rem 2rem !important;
    margin: 0 !important;
    background-color: #ffffff !important;
}

/* Force main element to have small top padding */
main.dashboard-content {
    margin: 0 !important;
    padding-top: 1rem !important;
}

/* First child element - remove ALL top spacing */
.dashboard-content > .container-fluid:first-child,
.dashboard-content > div:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.dashboard-content > .container-fluid:first-child > .index-hero {
    margin-top: 0 !important;
}

/* Dashboard Footer */
.dashboard-footer {
    background-color: #ffffff;
    border-top: 1px solid #dee2e6;
    padding: 1.5rem 2rem;
    margin-top: auto;
    color: #6c757d;
}

.dashboard-footer .font-weight-bold {
    color: #212529;
}

.dashboard-footer .text-muted {
    color: #6c757d !important;
}

/* Dashboard Cards */
.dashboard-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.dashboard-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

/* Stats Cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-card-change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stat-card.stat-card-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.stat-card-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.stat-card-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Search Results in Dashboard */
#lunrsearchresults {
    position: absolute;
    top: 100%;
    right: 2rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    z-index: 1001;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .sidebar-nav {
        transform: translateX(-100%);
        background-color: #1a1d29 !important;
    }

    .sidebar-nav.show {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.5);
        background-color: #1a1d29 !important;
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-content {
        padding: 1rem !important;
        margin-top: 4rem !important; /* Space for mobile menu toggle */
        background-color: #ffffff !important;
    }

    .dashboard-content > .container-fluid:first-child,
    .dashboard-content > div:first-child {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* For mobile sports pages, add padding to h2 */
    .dashboard-content .container-fluid:first-of-type > h2:first-child {
        padding-top: 1rem;
    }

    .dashboard-footer {
        padding: 1rem;
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Move toggle when sidebar is open */
    body.sidebar-open .mobile-menu-toggle {
        left: calc(var(--sidebar-width) + 1rem);
    }
}

@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Table Styles for Dashboard */
.dashboard-table {
    width: 100%;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    color: var(--text-primary);
}

.dashboard-table th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.dashboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-table tbody tr:hover {
    background-color: var(--sidebar-hover-bg);
}

/* Badge Styles */
.badge-stat {
    padding: 0.35em 0.65em;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Index Page Hero Section */
.index-hero {
    text-align: center;
    padding: 3rem 2rem;
    padding-top: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.index-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.index-hero-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    color: rgb(255, 255, 255) !important;
    line-height: 1.6;
    opacity: 1 !important;
    filter: none !important;
    -webkit-text-fill-color: rgb(255, 255, 255) !important;
}

/* Maximum priority override for subtitle */
.index-hero p.index-hero-subtitle,
p.index-hero-subtitle,
.container-fluid .index-hero p.index-hero-subtitle {
    color: rgb(255, 255, 255) !important;
    opacity: 1 !important;
    -webkit-text-fill-color: rgb(255, 255, 255) !important;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
}

/* Sport Cards for Index Page - Light Theme */
.sport-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.sport-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--sidebar-active);
}

.sport-card-light {
    background: #ffffff;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sport-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(76, 110, 245, 0.3);
    transform: translateY(-4px);
    border-color: #667eea;
}

.sport-card-light:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.sport-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.sport-icon {
    font-size: 2.5rem;
    color: var(--sidebar-active);
}

.sport-card-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.sport-card-light .sport-card-header h3 {
    color: #212529;
}

.sport-card-body {
    flex: 1;
}

.sport-card-description {
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.sport-card-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #495057;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.feature-item i {
    color: #667eea;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sport-card-light:hover .feature-item {
    background-color: rgba(102, 126, 234, 0.08);
}

.sport-stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.top-teams-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: background-color 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sport-card:hover .team-item {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}

.team-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--sidebar-active) 0%, #667eea 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.team-name {
    flex: 1;
    font-weight: 600;
    color: #ffffff !important;
}

.team-record {
    font-weight: 600;
    color: #ffffff !important;
    font-size: 0.875rem;
}

/* Ensure team item text is always white */
.sport-card .team-item .team-name,
.sport-card .team-item .team-record {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Even more specific overrides */
.sport-card-link .sport-card .top-teams-list .team-item span.team-name,
.sport-card-link .sport-card .top-teams-list .team-item span.team-record {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Override any Bootstrap or theme styles */
.team-item span {
    color: #ffffff !important;
}

.sport-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.sport-card-light .sport-card-footer {
    border-top: 2px solid #e9ecef;
}

.sport-card-footer .view-more {
    font-weight: 700;
    color: #ffffff !important;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.sport-card-light .sport-card-footer .view-more {
    color: #667eea !important;
    text-shadow: none;
}

.sport-card:hover .sport-card-footer .view-more {
    gap: 0.75rem;
    color: #ffffff !important;
}

.sport-card-light:hover .sport-card-footer .view-more {
    color: #667eea !important;
}

.sport-card:hover .sport-card-footer .view-more i {
    transform: translateX(4px);
    transition: transform 0.3s ease;
}

/* Ensure view-more text is bright white */
.sport-card-footer span.view-more,
.sport-card-footer .view-more * {
    color: #fff !important;
}

/* Responsive adjustments for sport cards */
@media (max-width: 767.98px) {
    .sport-card {
        padding: 1.5rem;
    }

    .sport-icon {
        font-size: 2rem;
    }

    .sport-card-header h3 {
        font-size: 1.5rem;
    }

    .index-hero-title {
        font-size: 2rem;
    }

    .index-hero-subtitle {
        font-size: 1.2rem;
    }

    .index-hero {
        padding: 2rem 1rem;
        padding-top: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Light Theme Text Colors for Main Content */
.dashboard-content h1,
.dashboard-content h2,
.dashboard-content h3,
.dashboard-content h4,
.dashboard-content h5,
.dashboard-content h6 {
    color: #212529 !important;
}

.dashboard-content p,
.dashboard-content .text-muted {
    color: #6c757d !important;
}

.dashboard-content strong {
    color: #212529 !important;
}

.dashboard-content .text-primary {
    color: var(--sidebar-active) !important;
}

.dashboard-content .text-dark {
    color: #212529 !important;
}

.dashboard-content .h3,
.dashboard-content .h4,
.dashboard-content .h5 {
    color: #212529 !important;
}

/* List Group Items */
.list-group-item {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.list-group-flush .list-group-item {
    background-color: transparent;
}

/* Table responsive - Light theme for main content */
.dashboard-content .table {
    color: #212529;
    background-color: #ffffff;
}

.dashboard-content .table-sm th,
.dashboard-content .table-sm td {
    color: #212529;
}

.dashboard-content .table thead th {
    border-bottom-color: #dee2e6;
}

.dashboard-content .table td,
.dashboard-content .table th {
    border-top-color: #dee2e6;
}

/* Badge Colors */
.badge-primary {
    background-color: var(--sidebar-active);
    color: #ffffff;
}

.badge-success {
    background-color: #28a745;
    color: #ffffff;
}

.badge-info {
    background-color: #17a2b8;
    color: #ffffff;
}

.badge-pill {
    color: #ffffff;
}

/* Small text */
.small,
small {
    color: var(--text-secondary);
}

.dashboard-content div,
.dashboard-content span:not(.badge) {
    color: #212529;
}

/* Form controls in light theme */
.dashboard-content .form-control {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #495057;
}

.dashboard-content .form-control:focus {
    background-color: #ffffff;
    border-color: #667eea;
    color: #495057;
}

.dashboard-content .form-label {
    color: #495057;
}

/* Override Bootstrap container backgrounds - Keep sidebar dark, content light */
.dashboard-main .container,
.dashboard-main .container-fluid,
.dashboard-main main,
.dashboard-main section,
.dashboard-main article {
    background-color: transparent !important;
}

/* Aggressive removal of Bootstrap default spacing */
.dashboard-content .container-fluid,
.dashboard-content .container {
    padding-left: 15px;
    padding-right: 15px;
}

.dashboard-content > .container-fluid:first-child,
.dashboard-content > .container:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Remove any default margins on first elements */
.dashboard-content > *:first-child {
    margin-top: 0 !important;
}

.dashboard-content .container-fluid:first-of-type {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* For sports pages (not index), add top padding to h2 */
.dashboard-content .container-fluid:first-of-type > h2:first-child {
    padding-top: 2rem;
}

/* Sidebar stays dark */
.sidebar-nav {
    background-color: var(--sidebar-bg) !important;
}

/* Main wrapper has light content area */
.dashboard-wrapper {
    background-color: #ffffff !important;
}

/* Body background - white for main content visibility */
html,
body {
    background-color: #ffffff;
    margin: 0 !important;
    padding: 0 !important;
}

body.dashboard-layout {
    background-color: #ffffff;
    margin: 0 !important;
    padding: 0 !important;
}

/* Final override for index page team text - highest priority */
.row .col-md-6 .sport-card-link .sport-card .team-item .team-name,
.row .col-md-6 .sport-card-link .sport-card .team-item .team-record {
    color: #fff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

/* Make all text in sport cards bright */
.sport-card * {
    color: inherit;
}

.sport-card .team-name,
.sport-card .team-record {
    color: #fff !important;
}
