﻿/* ============================================================
   🧩 IMPORTS Y FUENTES
============================================================ */
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';

@font-face {
    font-family: 'Exo2';
    src: url('fonts/Exo2-VariableFont_wght.ttf');
}

/* ============================================================
   🔄 RESETEO Y BASE
============================================================ */
html, body, #app {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    min-height: 100vh;
    --body-font: 'Exo2', "Segoe UI", sans-serif;
    font-family: var(--body-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    color: var(--neutral-foreground-rest);
    background: linear-gradient( 160deg, var(--neutral-layer-1) 0%, color-mix(in srgb, var(--neutral-layer-3) 100%, var(--accent-fill-rest) 5%) 5%, color-mix(in srgb, var(--neutral-layer-3) 100%, var(--accent-fill-rest) 5%) 100% );
}

/* ============================================================
   ✴️ ESTADOS Y ENFOQUE
============================================================ */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--focus-border-color-light), 0 0 0 0.25rem var(--focus-shadow-color-light);
}

/* ============================================================
   🧱 LAYOUT PRINCIPAL
============================================================ */
.main {
    min-height: calc(100dvh - 50px);
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
    background: linear-gradient( 160deg, var(--neutral-layer-1) 80%, color-mix(in srgb, var(--neutral-layer-1) 100%, var(--accent-fill-rest) 5%) 100% );
}

.body-content, .content {
    align-self: stretch;
    display: flex;
    width: 100%;
    color: var(--neutral-foreground-rest);
    background: linear-gradient( 160deg, var(--neutral-layer-1) 80%, color-mix(in srgb, var(--neutral-layer-1) 100%, var(--accent-fill-rest) 5%) 100% );
}

.manage {
    width: 100dvw;
}

.main-content,
.main-content-gf {
    flex: 1 1 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--neutral-foreground-rest);
    overflow-x: hidden;
}

.main-content {
    background-color: var(--neutral-layer-2);
    overflow-y: auto;
}

    .main-content.shifted,
    .main-content-gf.shifted {
        transform: translateX(15%);
    }

.main-content-gf {
    padding: 5px 30px;
    border-top-left-radius: 15px;
    background: var(--neutral-layer-2);
    background-image: linear-gradient( 135deg, color-mix(in srgb, var(--neutral-layer-2) 90%, var(--accent-fill-rest) 10%), color-mix(in srgb, var(--neutral-layer-2) 90%, var(--accent-fill-hover) 10%) );
    overflow: hidden;
}

/* ============================================================
   ⚙️ PANEL DE CONFIGURACIÓN
============================================================ */
.theme-settings-panel {
    height: 100%;
    color: var(--neutral-foreground-rest);
    background-color: var(--neutral-layer-1);
    transition: background 0.6s ease;
}

/* ============================================================
   🦶 FOOTER
============================================================ */
footer {
    background: var(--neutral-layer-4);
    color: var(--neutral-foreground-rest);
    align-items: center;
    padding: 10px;
}

    footer a {
        color: var(--neutral-foreground-rest);
        text-decoration: none;
    }

        footer a:focus {
            outline: 1px dashed;
            outline-offset: 3px;
        }

        footer a:hover {
            text-decoration: underline;
        }

/* ============================================================
   ⚠️ ALERTAS
============================================================ */
.alert {
    border: 1px dashed var(--accent-fill-rest);
    padding: 5px;
}

/* ============================================================
   💥 BLAZOR ERROR UI
============================================================ */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    position: fixed;
    display: none;
    left: 0;
    width: 100%;
    padding: 0.6rem 1.25rem 0.7rem;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
        cursor: pointer;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,...) no-repeat 1rem/1.8rem, #b32121;
    color: white;
    padding: 1rem 1rem 1rem 3.7rem;
}

    .blazor-error-boundary::before {
        content: "An error has occurred. ";
    }

/* ============================================================
   ⏳ LOADING PROGRESS
============================================================ */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* ============================================================
   🧮 CÓDIGO DESTACADO
============================================================ */
code {
    color: #c02d76;
}

/* ============================================================
   📋 PANEL LATERAL
============================================================ */
.panel-lateral {
    position: fixed;
    top: 0;
    left: 0;
    width: max-content;
    min-width: 30vw;
    max-width: 45vw;
    height: 100%;
    padding: 2rem 1.8rem;
    background: var(--neutral-layer-2);
    background-image: linear-gradient( 135deg, color-mix(in srgb, var(--neutral-layer-2) 90%, var(--accent-fill-rest) 10%), color-mix(in srgb, var(--neutral-layer-2) 90%, var(--accent-fill-hover) 10%) );
    background-size: 200% 200%;
    animation: subtleGradient 14s ease-in-out infinite alternate;
    box-shadow: 6px 0 22px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    border-right: 2px solid color-mix(in srgb, var(--accent-fill-active) 25%, transparent);
    transform: translateX(-105%) scale(0.98);
    filter: blur(4px);
    overflow-y: auto;
}

    .panel-lateral.open {
        transform: translateX(0) scale(1);
        opacity: 1;
        filter: blur(0);
        box-shadow: 12px 0 30px rgba(0, 0, 0, 0.35);
        border-right: 2px solid color-mix(in srgb, var(--accent-fill-active) 50%, transparent);
    }

.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 999;
}

    .panel-overlay.active {
        opacity: 1;
    }

/* Animación de fondo */
@keyframes subtleGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ============================================================
   📚 NAVMENU Y SIDENAV
============================================================ */
.navmenu {
    width: auto;
    transition: transform 0.3s ease;
}

    .navmenu.minimized {
        position: fixed;
        transform: translateX(-100%);
    }

.navmenu-icon {
    display: none;
}

/* Sidenav por defecto cerrado */
.sitenav {
    width: 50px;
    transition: width 0.3s ease;
    overflow: hidden;
}

    .sitenav:hover {
        width: 230px;
    }

/* ============================================================
   🎚️ SCROLLBARS PERSONALIZADOS
============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* ============================================================
   📱 MEDIA QUERIES
============================================================ */
@media (max-width: 600px) {
    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

        #main-menu > div:first-child:is(.expander) {
            display: none;
        }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

        #navmenu-toggle ~ nav {
            display: none;
        }

        #navmenu-toggle:checked ~ nav {
            display: block;
        }

    .navmenu-icon {
        cursor: pointer;
        z-index: 10;
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        width: 20px;
        height: 20px;
        border: none;
    }
}

/* Modo alto contraste */
@media (forced-colors: active) {
    .example {
        forced-color-adjust: none;
        background-color: ButtonFace;
        color: ButtonText;
    }
}
