/* app.css - Updated Orange Theme */

:root {
    /* Orange color palette */
    --orange-50: #FE8012; /* First color */
    --orange-100: #F96E1A;
    --orange-200: #F45C22;
    --orange-300: #EF4A2A;
    --orange-400: #EA382F;
    --orange-500: #D6D6D6; /* Middle color */
    --orange-600: #D83C1A;
    --orange-700: #CC341B;
    --orange-800: #C02C1C;
    --orange-900: #434343; /* Last color */
}

/*:root {
    
    --orange-50: #FE8012; 
    --orange-100: #F96E1A;
    --orange-200: #F45C22;
    --orange-300: #EF4A2A;
    --orange-400: #EA382F;
    --orange-500: #E44419; 
    --orange-600: #D83C1A;
    --orange-700: #CC341B;
    --orange-800: #C02C1C;
    --orange-900: #C41900; 
}
*/
/*
:root {
    
    --orange-50: #fff8f0;
    --orange-100: #ffe8cc;
    --orange-200: #ffd6a8;
    --orange-300: #ffba75;
    --orange-400: #ff9d42;
    --orange-500: #ff8000; 
    --orange-600: #ff6a00;
    --orange-700: #e05000;
    --orange-800: #cc3d00;
    --orange-900: #a62e00;
}
*/


html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: white /*var(--orange-50)*/;
}

.btn-primary {
    color: #fff;
    background-color: var(--orange-600);
    border-color: var(--orange-700);
}

    .btn-primary:hover {
        background-color: var(--orange-700);
        border-color: var(--orange-800);
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--orange-500);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--orange-400);
}

.invalid {
    outline: 1px solid var(--orange-700);
}

.validation-message {
    color: var(--orange-700);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1zbnM6eGxpbms9Imh0d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DE4MyAyNTkuMzEzIDY3LjEyNDUgMjU5LjMxMyA2OS4zMzcgMjU5LjMxMyA2OS42MTAyIDI1OS4zMzIgNjkuODYwOCAyNTkuMzcxIDcwLjA4ODdMMjYxLjc5NSA4NC4wMTYxIDI2NS4zOCA4NC4wMTYxIDI2Ny44MjEgNjkuNzQ3NUMyNjcuODYgNjkuNzMwOSAyNjcuODc5IDY5LjU4NzcgMjY3Ljg3OSA2OS4zMTc5IDI2Ny44NzkgNjcuMTE4MiAyNjYuNDQ4IDY2LjAxODMgMjYzLjU4NiA2Ni4wMTgzWk0yNjMuNTc2IDg2LjA1NDdDMjYxLjA0OSA4Ni4wNTQ3IDI1OS43ODYgODcuMzAwNSAyNTkuNzg2IDg5Ljc5MjEgMjU5Ljc4NiA5Mi4yODM3IDI2MS4wNDkgOTMuNTI5NSAyNjMuNTc2IDkzLjUyOTUgMjY2LjExNiA5My41Mjk1IDI2Ny4zODcgOTIuMjgzNyAyNjcuMzg3IDg5Ljc5MjEgMjY3LjM4NyA4Ny4zMDA1IDI2Ni4xMTYgODYuMDU0NyAyNjMuNTc2IDg2LjA1NDdaIiBmaWxsPSIjRkZFNTAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L2c+PC9zdmc+) no-repeat 1rem/1.8rem, var(--orange-800);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Navigation */
.top-row {
    height: 5rem;
    background-color: var(--orange-500) !important;
    color: var(--orange-900) !important;
}

.nav-logo {
    height: 120px; /* Adjust the height as needed */
    margin-right: 10px; /* Space between the logo and the text */
    margin-top: -20px;
}

.navbar {
    background-color: var(--orange900);
    color: var(--orange-100) !important;
}

.nav-link {
    color: white /*var(--orange-50) */ !important;
}

    .nav-link:hover {
        /*color: var(--orange-100) !important;*/
        font-weight: bolder;
        background-color: var(--orange-800);
    }

    .nav-link.active {
        color: white !important;
        font-weight: bolder;
        background-color: var(--orange-700);
    }

.nav-scrollable {
    overflow-y: auto;
    max-height: 150vh;
    background-color: var(--orange-900);
}

.navbar-toggler {
    display: none;
    color: var(--orange-100);
    border-color: var(--orange-300);
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
}

/* Nested Menu Styles */
.nav-item {
    position: relative;
    color: white;
}

/* First level dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: var(--orange-100);
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px 0;
    margin: 0;
    border-radius: 4px;
    border: 1px solid var(--orange-300);
    left: 0;
    top: 100%;
}

/* Show dropdown on hover */
.nav-item:hover > .dropdown-menu {
    display: block;
}

/* Second level (nested) dropdown */
.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -8px;
        margin-left: 1px;
    }

    /* Show second level dropdown on hover */
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }

/* Dropdown item styling */
.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    clear: both;
    font-weight: 400;
    color: var(--orange-900);
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none;
}

    .dropdown-item:hover, .dropdown-item:focus {
        color: var(--orange-900);
        text-decoration: none;
        background-color: var(--orange-300);
    }

/* Add dropdown indicators */
.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid var(--orange-300);
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-submenu > a::after {
    display: inline-block;
    float: right;
    margin-top: 8px;
    content: "";
    border-left: 0.3em solid var(--orange-500);
    border-top: 0.3em solid transparent;
    border-right: 0;
    border-bottom: 0.3em solid transparent;
}

/* Add custom indicator for parent menu items and left Icon */
.nav-item.has-submenu > a {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

    .nav-item.has-submenu > a::before {
        content: "\25CF";
        font-size: 0.8em;
        margin-right: 5px;
        color: white /*var(--orange-400)*/;
    }

    .nav-item.has-submenu > a::after {
        content: "\25BE";
        font-size: 0.8em;
        margin-left: auto;
        color: white /* var(--orange-400) */;
    }

.row-default {
    background-color: transparent;
}

.row-amber {
    background-color: #FFC107 !important; /* Amber */
    color: var(--bs-body-color); /* Adjust text color for themes */
}

.row-red {
    background-color: #FF5722 !important; /* Red */
    color: var(--bs-body-color); /* Adjust text color for themes */
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .navbar-toggler {
        display: block;
        background-color: var(--orange-700);
    }

    .nav-scrollable {
        display: none;
        width: 100%;
    }

    .navbar-toggler:checked + .nav-scrollable {
        display: block;
    }

    /* Responsive nested menu */
    .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        box-shadow: none;
        border: none;
        padding-left: 15px;
        background-color: var(--orange-800);
    }

    .dropdown-submenu > .dropdown-menu {
        position: static;
        left: 0;
        margin: 0;
        padding-left: 15px;
        background-color: var(--orange-700);
    }

    .dropdown-item {
        color: var(--orange-100);
    }

        .dropdown-item:hover, .dropdown-item:focus {
            color: white;
            background-color: var(--orange-600);
        }

    .dropdown-submenu > a::after {
        transform: rotate(90deg);
    }

    /* Toggle visibility using JavaScript classes */
    .nav-scrollable.mobile-open {
        display: block;
    }

    .dropdown-menu.mobile-open {
        display: block;
    }

    .nav-item.has-submenu > a::after {
        transform: rotate(90deg);
    }

    @media (prefers-color-scheme: dark) {
        .row-amber {
            background-color: #FFB300; /* Darker Amber for dark mode */
        }

        .row-red {
            background-color: #E64A19; /* Darker Red for dark mode */
        }
    }

    @media (max-width: 768px) {
        .results-table-container table {
            font-size: 0.9rem; /* Adjust font size for mobile */
        }
    }
}

.flex-column {
    width: 500px;
}

.page-title {
    text-align: center;
    margin-top: 20px;
}

/* Dark Theme */
.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

    .dark-theme .mud-paper {
        background-color: #1e1e1e !important;
        color: #e0e0e0 !important;
    }

    .dark-theme .mud-table {
        background-color: rgb(75, 75, 75) !important;
        color: #e0e0e0 !important;
    }

    .dark-theme .mud-table-head {
        background-color: #2d2d2d !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-table-row:hover {
        background-color: #404040 !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-table-row.selected {
        background-color: #1976d2 !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-table-row:active {
        background-color: #505050 !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-text {
        color: #e0e0e0 !important;
    }

        .dark-theme .mud-text.mud-typography-h4,
        .dark-theme .mud-text.mud-typography-h5,
        .dark-theme .mud-text.mud-typography-h6 {
            color: #ffffff !important;
        }

    .dark-theme .mud-chart {
        background-color: #1e1e1e !important;
    }

    .dark-theme .mud-table-cell {
        color: black !important;
        border-color: #404040 !important;
    }

    .dark-theme .mud-table-head .mud-table-cell {
        color: #ffffff !important;
        font-weight: 600;
    }

    .dark-theme .mud-chip {
        color: #ffffff !important;
    }

    /* Dark Theme - Top Menu Improvements */
    .dark-theme .mud-appbar {
        background-color: #1e1e1e !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-menu-item {
        color: #ffffff !important;
    }

        .dark-theme .mud-menu-item:hover {
            background-color: #333333 !important;
            color: #ffffff !important;
        }

        .dark-theme .mud-menu-item .mud-icon {
            color: #ffffff !important;
        }

    .dark-theme .mud-avatar {
        background-color: #ff6b35 !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-popover-paper {
        background-color: #2d2d2d !important;
        color: #ffffff !important;
    }

    .dark-theme .mud-icon {
        color: #ffffff !important;
    }

    .dark-theme .mud-appbar .mud-icon {
        color: #ffffff !important;
    }

    .dark-theme .mud-menu .mud-icon {
        color: #ffffff !important;
    }

    .dark-theme .mud-list-item .mud-icon {
        color: #ffffff !important;
    }

    .dark-theme .mud-menu-item-icon {
        color: #ffffff !important;
    }

    .dark-theme svg {
        fill: #ffffff !important;
    }

/* Make the area around the header in CustomersList dark in dark mode */
.mud-theme-dark .mobile-header,
.mud-theme-dark .mobile-header .responsive-toolbar {
    background: #1e1e1e !important;
    color: #fff !important;
    border-bottom: 1px solid #444 !important;
}

/* Remove white background from .mobile-header in dark mode */
.mud-theme-dark .mobile-header {
    background: #1e1e1e !important;
}

/* Make disabled MudBlazor save buttons more prominent */
.mud-button.mud-disabled, .mud-button[disabled] {
    opacity: 0.7 !important;
    background-color: grey !important; /* Brighter orange */
    color: #fff !important;
    border: 1px solid white !important;
    box-shadow: 0 0 0 2px #ffa72644;
    cursor: not-allowed !important;
    font-weight: bold;
}

/* Support .dark-theme (used by our JS) for MudBlazor components */
.dark-theme .mud-drawer,
.dark-theme .mud-drawer-paper,
.dark-theme .app-drawer {
    background-color: #23272b !important;
    color: #fff !important;
    z-index: 3000 !important;
}

.dark-theme .mud-nav-link,
.dark-theme .mud-nav-link .mud-icon-root,
.dark-theme .mud-nav-link .mud-icon,
.dark-theme .mud-nav-link .mud-nav-link-text {
    color: #fff !important;
/*    fill: #fff !important;
*/

}

    .dark-theme .mud-nav-link.mud-nav-link-active {
        background-color: #33384d !important;
        color: #fff !important;
    }

/* Ensure SVG icons inside the drawer are white */
.dark-theme .app-drawer svg,
.dark-theme .app-drawer .mud-icon {
    color: #fff !important;
    fill: #fff !important;
}

/* Inputs in dark-theme */
.dark-theme input,
.dark-theme textarea,
.dark-theme .mud-input-root input,
.dark-theme .mud-input-root textarea,
.dark-theme .mud-input-slot input,
.dark-theme .mud-picker-input input,
.dark-theme .mud-textfield .mud-input-slot input {
    color: #fff !important;
    background-color: #23272b !important;
    border-color: #444 !important;
    caret-color: #fff !important;
}

.dark-theme .mud-input-label {
    color: #bbb !important;
}

/* Ensure nav logo at the bottom is visible in dark mode */
.dark-theme .nav-logo,
.mud-theme-dark .nav-logo {
    filter: brightness(2) invert(0) drop-shadow(0 0 2px #fff);
    background: transparent !important;
}

.dark-theme .mud-drawer,
.dark-theme .mud-drawer-paper,
.dark-theme .app-drawer,
.mud-theme-dark .mud-drawer,
.mud-theme-dark .mud-drawer-paper,
.mud-theme-dark .app-drawer {
    background-color: #23272b !important;
    color: #fff !important;
}

    /* If the logo is an <img>, make sure it is not hidden by background */
    .dark-theme .mud-drawer img.nav-logo,
    .mud-theme-dark .mud-drawer img.nav-logo {
        filter: brightness(2) invert(0) drop-shadow(0 0 2px #fff);
        background: transparent !important;
    }

/* Ensure nav link text is visible in dark mode */
.mud-theme-dark .mud-nav-link-text,
.mud-theme-dark .mud-nav-link,
.dark-theme .mud-nav-link-text,
.dark-theme .mud-nav-link {
    color: #fff !important;
    font-weight: 500 !important;
}

    .mud-theme-dark .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
    .dark-theme .mud-nav-link.mud-nav-link-active .mud-nav-link-text {
        color: #fff !important;
        font-weight: 700 !important;
    }

    .mud-theme-dark .mud-nav-link span,
    .dark-theme .mud-nav-link span,
    .mud-theme-dark .mud-nav-link-text,
    .dark-theme .mud-nav-link-text {
        color: #fff !important;
        font-weight: 500 !important;
        opacity: 1 !important;
        display: inline !important;
    }

/* --- FORCE NAV TEXT VISIBLE IN DARK MODE AND MINI DRAWER --- */
.mud-theme-dark .mud-nav-link,
.mud-theme-dark .mud-nav-link .mud-nav-link-text,
.mud-theme-dark .mud-nav-link span,
.dark-theme .mud-nav-link,
.dark-theme .mud-nav-link .mud-nav-link-text,
.dark-theme .mud-nav-link span {
    color: #fff !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    display: inline !important;
}

.mud-theme-dark .mud-nav-link.mud-nav-link-active,
.mud-theme-dark .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
.mud-theme-dark .mud-nav-link.mud-nav-link-active span,
.dark-theme .mud-nav-link.mud-nav-link-active,
.dark-theme .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
.dark-theme .mud-nav-link.mud-nav-link-active span {
    color: #fff !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    display: inline !important;
}

/* Prevent text from being hidden in mini/collapsed drawer */
.mud-nav-link .mud-nav-link-text,
.mud-nav-link span {
    display: inline !important;
    opacity: 1 !important;
}

/* Remove any color: transparent or display: none from nav text */
.mud-theme-dark .mud-nav-link-text[style*="transparent"],
.dark-theme .mud-nav-link-text[style*="transparent"] {
    color: #fff !important;
    display: inline !important;
    opacity: 1 !important;
}
