﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* =========================================
   ESTRUCTURA PRINCIPAL DEL LAYOUT
   ========================================= */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* =========================================
   BARRA LATERAL (MENÚ)
   ========================================= */
.sidebar {
    /* Degradado oscuro (Azul a Morado) */
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
    color: white;
}

    /* Enlaces del menú */
    .sidebar .nav-item a {
        color: #d7d7d7;
        border-radius: 4px;
        height: 3rem;
        display: flex;
        align-items: center;
        line-height: 3rem;
        padding-left: 1rem;
        padding-right: 1rem;
        text-decoration: none;
        font-weight: 500;
    }

        /* Enlace activo (página actual) */
        .sidebar .nav-item a.active {
            background-color: rgba(255,255,255,0.25);
            color: white;
            font-weight: bold;
        }

        /* Hover (pasar el ratón) */
        .sidebar .nav-item a:hover {
            background-color: rgba(255,255,255,0.1);
            color: white;
        }

    /* Título de la App en el menú móvil */
    .sidebar .navbar-brand {
        font-size: 1.1rem;
        margin-top: 10px; /* Alineación vertical */
    }

    /* Botón Hamburguesa (Móvil) - BAJADO Y ESTILIZADO */
    .sidebar .navbar-toggler {
        background-color: rgba(255, 255, 255, 0.1);
        margin-top: 12px; /* 👈 AQUÍ LO BAJAMOS */
        margin-right: 10px;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

/* =========================================
   BARRA SUPERIOR (TOP ROW)
   ========================================= */
.top-row {
    /* MISMO ESTILO QUE EL MENÚ (Uniformidad) */
    background-image: linear-gradient(90deg, rgb(5, 39, 103) 0%, #3a0647 70%);
    color: white;
    border-bottom: 1px solid #4a1b5c;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

    /* Enlaces dentro de la barra superior */
    .top-row ::deep a, .top-row ::deep .btn-link {
        color: white !important; /* Texto blanco forzado */
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

        .top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
            text-decoration: underline;
            color: #ddd !important;
        }

/* =========================================
   CONTENIDO PRINCIPAL
   ========================================= */
.content {
    padding-top: 1.1rem;
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================= */

/* MÓVIL (Pantallas pequeñas) */
@media (max-width: 640.98px) {
    .top-row:not(.auth) {
        display: none; /* Oculta la barra superior extra en móvil para ganar espacio */
    }

    .top-row.auth {
        justify-content: space-between;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0;
    }
}

/* ESCRITORIO (Pantallas grandes) */
@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px; /* Ancho fijo del menú */
        height: 100vh; /* Altura completa de la pantalla */
        position: sticky; /* Se queda fijo al hacer scroll */
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

        .top-row.auth ::deep a:first-child {
            flex: 1;
            text-align: right;
            width: 0;
        }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* =========================================
   UTILIDADES EXTRAS (BARRA DE ERROR)
   ========================================= */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
