﻿/* === GLOBAL STYLES === */

#main-content-paper h1,
#main-content-paper h2,
#main-content-paper h3,
#main-content-paper h4,
#main-content-paper h5,
#main-content-paper h6 {
    font-family: 'Merriweather', serif !important;
}

.mud-popover .mud-list-item-text {
    color: var(--mud-palette-text-primary) !important;
}

.mud-button-filled-tertiary,
.mud-button-filled-secondary,
.mud-button-filled-success {
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    transition: all 0.2s ease-in-out;
}

    .mud-button-filled-tertiary:hover,
    .mud-button-filled-secondary:hover,
    .mud-button-filled-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    }

#main-content-paper {
    --mud-palette-surface: transparent !important;
    background-color: transparent !important;
    background-image: url('/css/felt-texture.png') !important;
    background-repeat: repeat;
    border-radius: var(--mud-layout-default-border-radius) !important;
}

.mud-appbar,
#nav-drawer {
    background-image: url('/css/wood-grain.png') !important;
    background-size: cover !important;
}

/* --- WIDENED NAV-DRAWER --- */
.mud-drawer-responsive.mud-drawer-open {
    width: 300px !important;
}

#nav-drawer {
    height: calc(100% - 112px) !important;
}

    #nav-drawer .mud-nav-link {
        display: flex;
        width: calc(100% - 16px);
        margin: 4px 8px;
        border-radius: 4px;
        background-color: rgba(0, 0, 0, 0.25) !important;
        transition: background-color 0.2s ease-in-out;
    }

        #nav-drawer .mud-nav-link:hover {
            background-color: rgba(0, 0, 0, 0.4) !important;
        }

        /* --- FIX FOR ACTIVE NAV ITEM WRAPPING --- */
        #nav-drawer .mud-nav-link.active {
            background-color: rgba(0, 0, 0, 0.4) !important;
            position: relative; /* Required for the pseudo-element */
        }

            /* Creates the active indicator bar without affecting layout */
            #nav-drawer .mud-nav-link.active::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 4px;
                height: 100%;
                background-color: var(--mud-palette-tertiary);
            }
    /* --- END FIX --- */


    #nav-drawer .mud-nav-link-icon {
        color: var(--mud-palette-tertiary) !important;
        opacity: 0.8;
    }

    #nav-drawer .mud-nav-link.active .mud-nav-link-icon {
        color: white !important;
        opacity: 1.0;
    }

    #nav-drawer .mud-nav-group > .mud-nav-link .mud-nav-link-expand-icon {
        color: var(--mud-palette-tertiary) !important;
        opacity: 0.8;
    }

#main-content-paper .mud-alert-filled-info {
    background-color: rgba(29, 161, 242, 0.25) !important;
    border: 1px solid rgba(29, 161, 242, 0.5);
    backdrop-filter: blur(5px);
}

    #main-content-paper .mud-alert-filled-info .mud-alert-message {
        width: 100%;
        text-align: center;
    }

    #main-content-paper .mud-alert-filled-info .mud-icon-root {
        color: var(--mud-palette-tertiary) !important;
        opacity: 0.9;
    }

.mud-snackbar {
    background-color: var(--mud-palette-black) !important;
    border: 2px solid var(--mud-palette-tertiary) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6) !important;
    border-radius: var(--mud-layout-default-border-radius) !important;
}

    .mud-snackbar .mud-snackbar-content .mud-snackbar-message {
        color: var(--mud-palette-tertiary) !important;
    }

    .mud-snackbar .mud-snackbar-icon {
        color: var(--mud-palette-tertiary) !important;
    }

.mud-snackbar-location-top-right {
    top: 70px !important;
}

#main-content-paper .mud-table {
    background-color: rgba(0, 0, 0, 0.25) !important;
    border-radius: var(--mud-layout-default-border-radius);
}

#main-content-paper .mud-table-head .mud-table-cell {
    background-color: rgba(0, 0, 0, 0.2) !important;
    color: var(--mud-palette-tertiary) !important;
    font-weight: bold;
}

#main-content-paper .mud-table-body .mud-table-row.mud-table-striped {
    background-color: transparent !important;
}

#main-content-paper .mud-table-body .mud-table-cell {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* --- Style Form Inputs --- */
#main-content-paper .mud-input-control .mud-input-label {
    color: rgba(255, 255, 255, 0.6) !important;
}

#main-content-paper .mud-input-control .mud-input {
    color: rgba(255, 255, 255, 0.9) !important;
}

#main-content-paper .mud-input-control .mud-input-underline:before {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

#main-content-paper .mud-input-control .mud-input-underline:after {
    border-bottom-width: 2px !important;
}

#main-content-paper .mud-input-control > .mud-input-control-input-container {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px 4px 0 0;
}

#main-content-paper .mud-input-adornment .mud-icon-button {
    color: var(--mud-palette-tertiary) !important;
}

.mud-picker-calendar {
    background-color: #2c2c2c !important;
}

.mud-picker-calendar-header {
    background-color: rgba(0,0,0,0.2) !important;
}

.mud-picker-calendar .mud-day,
.mud-picker-calendar .mud-weekday {
    color: var(--mud-palette-text-primary) !important;
}

    .mud-picker-calendar .mud-day.mud-selected {
        background-color: var(--mud-palette-tertiary) !important;
        color: #fff !important;
    }

    .mud-picker-calendar .mud-day.mud-current {
        border: 1px solid var(--mud-palette-tertiary-lighten) !important;
    }

    .mud-picker-calendar .mud-day.mud-disabled {
        color: var(--mud-palette-text-disabled) !important;
    }


/* Style for empty/placeholder content */
#main-content-paper .empty-content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0.6;
}

    #main-content-paper .empty-content-container .mud-icon-root {
        font-size: 4rem;
        color: var(--mud-palette-tertiary) !important;
    }


.wood-grain-card {
    background-image: url('/css/wood-grain.png') !important;
    background-size: cover !important;
    background-color: var(--mud-palette-secondary) !important;
}

    .wood-grain-card .mud-card-header-content .mud-text,
    .wood-grain-card .mud-card-content .mud-text,
    .wood-grain-card .mud-card-actions .mud-button {
        color: white !important;
        opacity: 0.9;
    }

    .wood-grain-card .mud-card-header-content .mud-text {
        opacity: 1.0;
    }

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background-color: var(--mud-palette-secondary);
    border-radius: 20px;
    border: 3px solid rgba(0, 0, 0, 0.3);
}

    ::-webkit-scrollbar-thumb:hover {
        background-color: var(--mud-palette-tertiary);
    }

/* === Mobile Responsive Styles === */


@media (max-width: 768px) {
    .mud-appbar .user-name-text {
        display: none !important;
    }

    #main-content-paper {
        padding: 12px !important;
    }

        #main-content-paper h1,
        #main-content-paper h2 {
            font-size: 1.5rem !important;
            line-height: 1.3;
        }

        #main-content-paper .mud-typography-body1 {
            font-size: 0.9rem !important;
        }

    .mud-appbar-bottom .mud-toolbar {
        flex-direction: column;
        height: auto !important;
        padding: 8px 0;
        gap: 4px;
    }

        .mud-appbar-bottom .mud-toolbar .mud-typography-caption {
            font-size: 0.65rem !important;
        }
}

@media (max-width: 480px) {
    .mud-appbar .league-name-text {
        display: none !important;
    }

    #main-content-paper h1,
    #main-content-paper h2 {
        font-size: 1.3rem !important;
    }
}

/* === DATAGRID FIX === */

/* Set a semi-transparent background for the data grid rows */
.mud-data-grid {
    background-color: rgba(0, 0, 0, 0.25) !important;
    border: none !important;
}

    /* This targets the entire header section to ensure it's a solid, layered block */
    .mud-data-grid .mud-table-head {
        background-color: #1c1c21 !important;
        position: relative; /* Establish stacking context */
        z-index: 1; /* Ensure header is layered above the scrolling body */
    }

        /* This is the key fix. It overrides the inherited transparent surface variable 
   for the toolbar, header cells, and filter row cells.
*/
        .mud-data-grid .mud-data-grid-toolbar,
        .mud-data-grid .mud-table-head .mud-table-cell,
        .mud-data-grid .mud-table-row-filter .mud-table-cell {
            --mud-palette-surface: #1c1c21 !important; /* Override the surface variable */
            background-color: transparent !important; /* Let the parent thead control the color */
            opacity: 1 !important;
        }

        /* Style for the header text */
        .mud-data-grid .mud-table-head .mud-table-cell {
            color: var(--mud-palette-tertiary) !important;
            font-weight: bold;
        }

    /* Style for the data rows */
    .mud-data-grid .mud-table-body .mud-table-row {
        background-color: transparent !important;
    }

    /* Style for the data cells */
    .mud-data-grid .mud-table-body .mud-table-cell {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* Style for the pager, ensuring it also has a solid background */
    .mud-data-grid .mud-data-grid-pager {
        --mud-palette-surface: #1c1c21 !important;
        background-color: #1c1c21 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
