﻿/* ============================================================
   navmenu.css — Navbar CONSEDE ERP (Bootstrap 5 nativo)
   Coloca en: wwwroot/css/navmenu.css
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   NAVBAR BASE
   ════════════════════════════════════════════════════════════ */
.csde-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 60px;
    background-color: #1B3568 !important;
    border-bottom: 3px solid #C0272D;
    box-shadow: 0 2px 12px rgba(27, 53, 104, 0.30);
    font-family: 'Inter', system-ui, sans-serif;
    padding: 0 !important;
}

.csde-navbar-inner {
    height: 60px;
    padding: 0 1.25rem !important;
    gap: 0.5rem;
}

/* ════════════════════════════════════════════════════════════
   BRAND
   ════════════════════════════════════════════════════════════ */
.csde-brand {
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    text-decoration: none !important;
    flex-shrink: 0;
    padding: 0 !important;
    margin-right: 0.5rem;
}

.csde-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: 0.05em;
    line-height: 1;
}

/* ════════════════════════════════════════════════════════════
   LINKS DE NAVEGACIÓN
   ════════════════════════════════════════════════════════════ */
.csde-nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.855rem !important;
    font-weight: 500 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
    line-height: 1.4 !important;
}

    .csde-nav-link:hover,
    .csde-nav-link:focus {
        background-color: rgba(255, 255, 255, 0.12) !important;
        color: #ffffff !important;
    }

    /* Item activo (Bootstrap añade .active automáticamente con NavLink) */
    .csde-nav-link.active {
        background-color: rgba(255, 255, 255, 0.18) !important;
        color: #ffffff !important;
        font-weight: 600 !important;
    }

/* Ícono SVG junto al texto */
.csde-nav-icon {
    flex-shrink: 0;
    opacity: 0.80;
}

.csde-nav-link:hover .csde-nav-icon,
.csde-nav-link.active .csde-nav-icon {
    opacity: 1;
}

/* Caret (▾) de Bootstrap — ajustamos tamaño y color */
.csde-nav-link.dropdown-toggle::after {
    margin-left: 0.25rem;
    opacity: 0.65;
    vertical-align: 0.1em;
}

/* ════════════════════════════════════════════════════════════
   DROPDOWNS DE NAVEGACIÓN
   ════════════════════════════════════════════════════════════ */
.csde-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #DDE3EE !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 24px rgba(27, 53, 104, 0.14) !important;
    padding: 0.35rem !important;
    min-width: 185px !important;
    margin-top: 6px !important;
    animation: csdeDropIn 0.15s ease;
}

@keyframes csdeDropIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Items dentro del dropdown */
.csde-dd-nav {
    color: #1E2A3B !important;
    font-size: 0.845rem !important;
    font-weight: 400 !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: 7px !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    transition: background-color 0.12s ease, color 0.12s ease !important;
}

    .csde-dd-nav:hover,
    .csde-dd-nav:focus {
        background-color: #EBF0FA !important;
        color: #1B3568 !important;
    }

    .csde-dd-nav.active {
        background-color: #EBF0FA !important;
        color: #1B3568 !important;
        font-weight: 600 !important;
    }

/* ════════════════════════════════════════════════════════════
   HAMBURGER (toggler)
   ════════════════════════════════════════════════════════════ */
.csde-toggler {
    border-color: rgba(255, 255, 255, 0.25) !important;
    padding: 0.3rem 0.5rem !important;
    border-radius: 6px !important;
    transition: background-color 0.15s ease !important;
}

    .csde-toggler:hover {
        background-color: rgba(255, 255, 255, 0.10) !important;
    }

    .csde-toggler:focus {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.20) !important;
    }

    /* Ícono hamburger en blanco */
    .csde-toggler .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C 255%2C 255%2C 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }

/* ════════════════════════════════════════════════════════════
   MENÚ COLAPSADO (móvil / tablet)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .csde-navbar {
        height: auto !important;
        min-height: 60px;
    }

    .csde-navbar-inner {
        height: auto !important;
        flex-wrap: wrap !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        min-height: 60px;
    }

    /* Panel colapsado — fondo blanco con sombra para que flote sobre el contenido */
    #csdeNavMain {
        background-color: #ffffff !important;
        border-top: 3px solid #C0272D;
        box-shadow: 0 8px 24px rgba(27, 53, 104, 0.18);
        padding: 0.6rem 1.25rem 0.9rem;
        margin: 0 -1.25rem;
    }

    /* Links en móvil — texto oscuro sobre fondo blanco */
    .csde-nav-link {
        color: #1B3568 !important;
        padding: 0.55rem 0.75rem !important;
        border-radius: 6px !important;
        width: 100%;
        font-weight: 500 !important;
    }

        .csde-nav-link:hover,
        .csde-nav-link:focus {
            background-color: #EBF0FA !important;
            color: #1B3568 !important;
        }

        .csde-nav-link.active {
            background-color: #EBF0FA !important;
            color: #1B3568 !important;
            font-weight: 600 !important;
        }

        /* Caret en oscuro */
        .csde-nav-link.dropdown-toggle::after {
            border-top-color: #1B3568 !important;
            opacity: 0.6;
        }

    /* Dropdowns en móvil — acordeón sobre fondo blanco */
    .csde-dropdown {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background-color: #F1F4F8 !important;
        padding: 0.25rem 0 0.25rem 0.75rem !important;
        margin-top: 2px !important;
        animation: none !important;
    }

    .csde-dd-nav {
        color: #2C3E5A !important;
        font-size: 0.83rem !important;
        padding: 0.42rem 0.75rem !important;
        border-radius: 5px !important;
    }

        .csde-dd-nav:hover,
        .csde-dd-nav:focus {
            background-color: #DDE3EE !important;
            color: #1B3568 !important;
        }
}

/* ════════════════════════════════════════════════════════════
   NOTIFICACIONES
   ════════════════════════════════════════════════════════════ */
.csde-notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

    .csde-notif-btn:hover {
        background: rgba(255, 255, 255, 0.16);
        color: #ffffff;
    }

.csde-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #C0272D;
    border-radius: 50%;
    font-size: 0.58rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #1B3568;
    line-height: 1;
}

/* ════════════════════════════════════════════════════════════
   MENÚ DE USUARIO
   ════════════════════════════════════════════════════════════ */
.csde-user-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 0.28rem 0.6rem 0.28rem 0.4rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.90);
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
}

    .csde-user-btn:hover,
    .csde-user-btn[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.22);
        color: #ffffff;
    }

    /* Ocultar el caret por defecto de Bootstrap en el user-btn
   (usamos nuestro propio chevron SVG) */
    .csde-user-btn.dropdown-toggle::after {
        display: none !important;
    }

/* Avatar */
.csde-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #C0272D;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.22);
    font-family: 'Inter', sans-serif;
    user-select: none;
}

    .csde-avatar.csde-avatar-lg {
        width: 40px;
        height: 40px;
        font-size: 0.88rem;
        border: 2.5px solid rgba(27, 53, 104, 0.14);
    }

.csde-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.csde-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.csde-user-role {
    font-size: 0.67rem;
    color: rgba(255, 255, 255, 0.52);
    white-space: nowrap;
}

.csde-user-chevron {
    color: rgba(255, 255, 255, 0.50);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.csde-user-btn[aria-expanded="true"] .csde-user-chevron {
    transform: rotate(180deg);
}

/* ── Dropdown de usuario ─────────────────────────────── */
/* Se refuerzan todos los estilos con !important para
   ganar sobre los estilos globales de radzen.blazor.css */
.csde-user-dropdown {
    min-width: 240px !important;
    background-color: #ffffff !important;
    border: 1px solid #DDE3EE !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(27, 53, 104, 0.16) !important;
    padding: 0 !important;
    overflow: hidden !important;
    margin-top: 8px !important;
    animation: csdeDropIn 0.15s ease;
    /* Radzen puede inyectar color de fondo oscuro globalmente */
    color: #1E2A3B !important;
}

.csde-user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
    background: #ffffff !important;
    color: #1E2A3B !important;
}

.csde-dd-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1E2A3B;
    line-height: 1.2;
}

.csde-dd-email {
    font-size: 0.72rem;
    color: #8A97A8;
    margin-top: 1px;
    line-height: 1.2;
}

.csde-dd-divider {
    margin: 0.25rem 0 !important;
    border-color: #DDE3EE !important;
}

/* Items del dropdown de usuario
   !important en todo para ganar sobre radzen.blazor.css */
.csde-user-dropdown .csde-dd-item,
.csde-dd-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    width: 100% !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.845rem !important;
    font-weight: 400 !important;
    color: #1E2A3B !important;
    background-color: transparent !important;
    font-family: 'Inter', sans-serif !important;
    transition: background-color 0.12s ease, color 0.12s ease !important;
    text-align: left !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
}

    .csde-user-dropdown .csde-dd-item:hover,
    .csde-user-dropdown .csde-dd-item:focus,
    .csde-dd-item:hover,
    .csde-dd-item:focus {
        background-color: #EBF0FA !important;
        color: #1B3568 !important;
    }

    .csde-dd-item svg {
        flex-shrink: 0;
        opacity: 0.60;
        color: #4A5568 !important;
    }

    .csde-dd-item:hover svg {
        opacity: 1;
    }

/* Logout en rojo */
.csde-user-dropdown .csde-dd-logout,
.csde-dd-logout {
    color: #C0272D !important;
    background-color: transparent !important;
}

    .csde-user-dropdown .csde-dd-logout:hover,
    .csde-user-dropdown .csde-dd-logout:focus,
    .csde-dd-logout:hover,
    .csde-dd-logout:focus {
        background-color: #FDECEA !important;
        color: #9B1E23 !important;
    }

    .csde-dd-logout svg {
        color: #C0272D !important;
        opacity: 0.80;
    }

/* Ocultar nombre/rol en pantallas muy pequeñas */
@media (max-width: 767.98px) {
    .csde-user-info {
        display: none;
    }

    .csde-user-chevron {
        display: none;
    }

    .csde-user-btn {
        padding: 0.28rem 0.4rem;
    }
}
