﻿/* ============================================================
   TYPOGRAPHY OVERRIDES
   ============================================================ */

.mud-typography-h1, h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
}

.mud-typography-h2, h2 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
}

.mud-typography-h3, h3 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
}

.mud-typography-body1,
.mud-typography-body2,

body {
    font-family: 'Roboto', sans-serif;
}

/* ============================================================
   ICON NORMALIZATION
   ============================================================ */

.mud-icon {
    font-size: 1.25rem;
}

/* ============================================================
   CONTRAST FIXES FOR MUD COMPONENTS
   ============================================================ */

/* Tabs */
.mud-tabs .mud-tab {
    color: var(--mud-palette-text-secondary) !important;
}

    .mud-tabs .mud-tab.mud-selected {
        color: var(--mud-palette-text-primary) !important;
    }

/* Select */
.mud-select {
    color: var(--mud-palette-text-primary) !important;
}

    .mud-select .mud-input-slot {
        color: var(--mud-palette-text-secondary) !important;
    }

/* Dropdown items */
.mud-popover .mud-list-item {
    color: var(--mud-palette-text-primary) !important;
}

    .mud-popover .mud-list-item.mud-selected {
        background-color: var(--mud-palette-primary) !important;
        color: var(--mud-palette-primary-contrast-text) !important;
    }

/* Drawer */
.mud-drawer {
    color: var(--mud-palette-text-primary) !important;
    background-color: var(--mud-palette-drawer-background) !important;
    overflow-y: auto !important; /* independent scroll */
    overflow-x: hidden;
}

    .mud-drawer .mud-list-item {
        color: var(--mud-palette-text-secondary) !important;
    }

        .mud-drawer .mud-list-item.mud-selected {
            color: var(--mud-palette-primary-contrast-text) !important;
            background-color: var(--mud-palette-primary) !important;
        }

/* AppBar */
.mud-appbar {
    color: var(--mud-palette-appbar-text) !important;
    background-color: var(--mud-palette-appbar-background) !important;
}

/* Chips */
.mud-chip {
    color: var(--mud-palette-text-secondary) !important;
}

    .mud-chip.mud-selected {
        color: var(--mud-palette-primary-contrast-text) !important;
        background-color: var(--mud-palette-primary) !important;
    }

/* Cards & Paper */
.mud-card,
.mud-paper {
    color: var(--mud-palette-text-primary) !important;
}

.mud-card-subtitle,
.mud-card-header {
    color: var(--mud-palette-text-secondary) !important;
}

/* Typography (captions, body text) */
.mud-typography.mud-caption,
.mud-typography.mud-body2 {
    color: var(--mud-palette-text-secondary) !important;
}

/* Inputs */
.mud-input-slot {
    color: var(--mud-palette-text-secondary) !important;
}

.mud-input {
    color: var(--mud-palette-text-primary) !important;
}

/* Lists & Menus */
.mud-list-item {
    color: var(--mud-palette-text-secondary) !important;
}

    .mud-list-item.mud-selected {
        color: var(--mud-palette-primary-contrast-text) !important;
        background-color: var(--mud-palette-primary) !important;
    }

/* Buttons */
.mud-button {
    color: var(--mud-palette-text-primary) !important;
}

    .mud-button.mud-button-outlined {
        color: var(--mud-palette-primary) !important;
        border-color: var(--mud-palette-primary) !important;
    }

    .mud-button.mud-button-filled {
        color: var(--mud-palette-primary-contrast-text) !important;
        background-color: var(--mud-palette-primary) !important;
    }

/* ============================================================
   SCROLLBARS
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background-color: #1f2a36;
}

::-webkit-scrollbar-thumb {
    background-color: #ff8800;
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background-color: #ff9800;
    }

/* ============================================================
   MODAL OVERRIDES
   ============================================================ */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1040;
}

.modal-container {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2a2f36;
    color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    z-index: 1050;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

    .modal-container label,
    .modal-container .mud-input-label {
        color: #f8f9fa;
    }

/* ============================================================
   APP LAYOUT (FULL HEIGHT + STICKY FOOTER + SCROLLING SIDEBAR)
   ============================================================ */
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 0 16px;
    min-height: 64px;
}

.app-bottom-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    width: 100%;
    min-height: 48px;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    /* Make MudLayout participate in flex */
    .app-shell > .mud-layout,
    .app-shell > .mud-layout-root,
    .app-shell > .mud-layout-root .mud-layout {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

/* Main content column */
.mud-main-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

    /* Inner wrapper MudBlazor adds */
    .mud-main-content > div {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden; /* contain scroll */
    }

    /* Container becomes the scrollable column */
    .mud-main-content .mud-container {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto; /* main content scrolls */
    }

        /* Footer sticks to bottom inside container */
        .mud-main-content .mud-container > *:last-child {
            margin-top: auto;
        }

/* Sidebar scrolls independently */
.mud-drawer {
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Bottom bar visuals */
.app-bottom-bar {
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.app-bottom-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}

    .app-bottom-bar-inner .center {
        text-align: center;
    }

.topbar-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0 12px;
    min-height: 56px; /* ensures enough height for avatar + menu */
    overflow: hidden; /* prevents avatar from dropping below */
    flex-wrap: nowrap; /* prevents stacking */
}

    .topbar-mobile .mud-typography {
        flex: 1 1 auto;
        text-align: center;
    }

.module-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    max-width: 40%; /* or whatever fits your layout */
}

/* Base styling for nav links */
.module-nav .mud-nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--mud-palette-text-primary);
    opacity: 0.75;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

    /* Hover */
    .module-nav .mud-nav-link:hover {
        opacity: 1;
        background-color: rgba(255,255,255,0.08);
        transition: color 0.2s ease;
    }

    /* Active state */
    .module-nav .mud-nav-link.active {
        color: var(--mud-palette-secondary);
        font-weight: 600;
        opacity: 1;
        background-color: rgba(var(--mud-palette-secondary-rgb), 0.25);
        border-bottom: 2px solid var(--mud-palette-secondary);
        padding-bottom: 3px;
    }

    .mobile-nav .mud-nav-link.active::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: var(--mud-palette-primary);
        transition: width 0.3s ease;
    }

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.footer-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 180px; /* prevents squishing */
    flex: 1 1 auto; /* allows natural expansion */
}

    .footer-section .mud-select,
    .footer-section .mud-input,
    .footer-section .mud-switch {
        min-width: 120px; /* ensures dropdown text is visible */
    }

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.powered {
    font-size: 0.75rem;
    opacity: 0.75;
    font-style: italic;
}

    .powered:hover {
        opacity: 1;
        color: var(--mud-palette-primary);
        transition: 0.2s ease;
    }

@media (max-width: 600px) {
    .app-bottom-bar-inner {
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
        text-align: center;
    }

    .footer-section {
        flex-direction: column;
        align-items: stretch;
        min-width: 100%;
    }

        .footer-section .mud-select,
        .footer-section .mud-input,
        .footer-section .mud-switch {
            width: 100%;
            min-width: 0;
    }
}