/* ========================================
   NAVBAR SISTEMA LA OLA
   Estilos completos del navbar superior
   ======================================== */

:root {
    /* Colores navbar */
    --pink-light: #f8b4d9;
    --pink-main: #e89fc7;
    --pink-soft: #fde8f3;
    --pink-strong: #d597b5;
    --pink-ultra-soft: #FFF5F8;
    
    --red-light: #ffcccb;
    --red-main: #ff9999;
    --red-soft: #ffe5e5;
    --red-dark: #ff6b6b;
    --red-ola: #E50000;
    
    --orange-light: #ffd4a3;
    --orange-main: #ffc78f;
    --orange-soft: #fff5f0;
    --orange-dark: #f5a560;
    --orange-laola: #FF8D00;
    
    --purple-light1: #d4b5e8;
    --purple-light: #D9C7F0;
    --purple-main1: #c29fd9;
    --purple-main: #A88FC2;
    --purple-soft1: #f0e8f8;
    --purple-soft: #F3EBFF;
    --purple-dark1: #a88bc4;
    --purple-dark: #7C4DA0;
    --purple-laola: #770088;
    --purple-ola: #4A1161;
    --purple-bg: #F8F5FF;
  
    --blue-light: #a8c9e8;
    --blue-main: #8fb5d9;
    --blue-soft: #e8f0f8;
    --blue-dark: #6fa0c9;
    --blue-laola: #004CFF;
    
    --yellow-light: #ffeb9c;
    --yellow-main: #ffe066;
    --yellow-soft: #fff9e6;
    --yellow-dark: #f5d742;
    --yellow-laola: #FFEE00;

    --green-light: #a8d5ba;
    --green-main: #8ec9a3;
    --green-soft: #e8f5f3;
    --green-dark: #6eb890;
    --green-laola: #028121;

    /* Neutrales */
    --text-dark: #374151;
    --text-medium: #6B7280;
    --text-muted: #9CA3AF;
    --text-secondary: #5a6b7b;
    
    --bg-white: #ffffff;
    --bg-light: #F9FAFB;
    
    --border-light: #e8eef3;
    --border-medium: #E5E7EB;
    --navbar-bg: #FFFFFF;
    --navbar-text: #202020;
    --navbar-text-secondary: #6D6D6D;
    --navbar-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   NAVBAR PRINCIPAL
   ======================================== */
.dashboard-navbar {
    background: var(--bg-white);
    padding: 0.75rem 2rem;
    box-shadow: var(--navbar-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid var(--border-light);
}

/* ========================================
   BUSCADOR CON BORDE LGBT
   ======================================== */
.navbar-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.navbar-search-wrapper {
    position: relative;
    padding: 3px;
    border-radius: 24px;
    background: linear-gradient(
        to right,
        #008026 50%,     /* Verde */
        #24408E 66.66%,  /* Azul */
        #732982 83.33%   /* Violeta */
    );
}

.navbar-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: none;
    border-radius: 21px;
    background: white;
    color: var(--navbar-text);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.navbar-search input::placeholder {
    color: var(--navbar-text-secondary);
    opacity: 0.6;
}

.navbar-search input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 77, 160, 0.1);
}

.navbar-search i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--navbar-text-secondary);
    font-size: 0.8rem;
    z-index: 1;
}

/* ========================================
   ACCIONES NAVBAR
   ======================================== */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* ========================================
   NOTIFICACIONES
   ======================================== */
.navbar-notifications {
    position: relative;
}

.navbar-notification-trigger {
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-notification-trigger:hover {
    background: var(--bg-light);
}

.navbar-notification-trigger i {
    color: var(--navbar-text);
    font-size: 1.3rem;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #E89494;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(232, 148, 148, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
}

/* Dropdown de notificaciones */
.dropdown-notifications {
    min-width: 350px;
    max-height: 500px;
    overflow-y: auto;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
    margin-top: 0.5rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header-notifications {
    background: linear-gradient(135deg, rgba(232, 165, 184, 0.1), rgba(253, 232, 243, 0.15));
    padding: 1rem;
    border-radius: 12px 12px 0 0;
}

.dropdown-header-notifications strong {
    color: var(--text-dark);
    font-weight: 600;
}

.dropdown-item-notification {
    padding: 1rem;
    border-bottom: 1px solid #F0F0F0;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.dropdown-item-notification.unread {
    background: var(--bg-light);
}

.dropdown-item-notification:hover {
    background: rgba(168, 143, 194, 0.05);
    transform: translateX(3px);
}

.notification-content {
    display: flex;
    gap: 0.75rem;
}

.notification-icon {
    flex-shrink: 0;
}

.notification-icon i.bi-exclamation-circle-fill {
    color: #DC2626;
    font-size: 1.2rem;
}

.notification-icon i.bi-info-circle-fill {
    color: #E8A5B8;
    font-size: 1.2rem;
}

.notification-text {
    flex: 1;
}

.notification-text strong {
    font-size: 0.9rem;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.25rem;
}

.notification-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.25rem 0;
}

.notification-text small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-item-view-all {
    display: block;
    text-align: center;
    padding: 0.85rem;
    color: var(--purple-dark);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-item-view-all:hover {
    background: var(--purple-soft);
    color: var(--purple-ola);
}

.dropdown-item-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.dropdown-item-empty i {
    font-size: 0.8rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 0.5rem;
}

.dropdown-item-empty p {
    margin: 0.5rem 0 0 0;
}

/* ========================================
   USUARIO NAVBAR - TRIGGER CON FONDO PÚRPURA
   ======================================== */
.navbar-user {
    position: relative;
}

.navbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: var(--purple-bg);
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid var(--purple-main1);
}

.navbar-user-trigger:hover {
    box-shadow: 0 4px 12px rgba(124, 77, 160, 0.25);
    transform: translateY(-1px);
}

.navbar-user-avatar {
    width: 30px;
    height: 30x;
    border-radius: 30%;
    background: var(--purple-laola);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-bg);
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.navbar-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    font-size: 0.8rem
}

.navbar-user-name {
    color: var(--purple-ola);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-user-role {
    color: var(--purple-ola);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}

.navbar-user-trigger > i {
    color: var(--purple-laola);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.navbar-user:hover .navbar-user-trigger > i {
    transform: rotate(180deg);
}

/* ========================================
   DROPDOWN DE USUARIO
   ======================================== */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 280px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    font-size: 0.85rem
}

.navbar-user:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header del dropdown */
.dropdown-header-user {
    background: linear-gradient(135deg, var(--purple-ola), var(--purple-dark));
    padding: 1.5rem;
    color: white;
}

.dropdown-user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.dropdown-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.dropdown-user-text {
    flex: 1;
    min-width: 0;
}

.dropdown-user-text h6 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.dropdown-user-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.dropdown-user-text p span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Items del dropdown */
.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    color: var(--navbar-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-item-custom:hover {
    background: rgba(168, 143, 194, 0.08);
    color: var(--purple-dark);
    text-decoration: none;
}

.dropdown-item-custom i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--navbar-text-secondary);
}

.dropdown-item-custom:hover i {
    color: var(--purple-dark);
}

/* Logout */
.dropdown-item-logout {
    color: #DC2626;
}

.dropdown-item-logout:hover {
    background: #FEE2E2;
}

.dropdown-item-logout i {
    color: #DC2626;
}

.dropdown-divider-custom {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(168, 143, 194, 0.2),
        transparent
    );
    margin: 0.5rem 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
    .dashboard-navbar {
        padding: 0.6rem 1.5rem;
        gap: 1rem;
    }
    
    .navbar-search {
        max-width: 300px;
    }
    
    .navbar-search input {
        font-size: 0.8rem;
        padding: 0.5rem 0.9rem 0.5rem 2.3rem;
    }
}

@media (max-width: 768px) {
    .dashboard-navbar {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
    }
    
    .navbar-search {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
        margin-top: 0.75rem;
    }
    
    .navbar-actions {
        gap: 1rem;
    }
    
    .navbar-user-trigger {
        padding: 0.4rem 0.75rem;
        gap: 0.5rem;
    }
    
    .navbar-user-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    
    .navbar-user-name {
        font-size: 0.85rem;
    }
    
    .navbar-user-role {
        font-size: 0.7rem;
    }
    
    .user-dropdown {
        min-width: 260px;
        right: -10px;
    }
    
    .dropdown-notifications {
        min-width: 300px;
        right: -50px;
    }
}

@media (max-width: 576px) {
    .navbar-user-info {
        display: none;
    }
    
    .navbar-user-trigger > i {
        display: none;
    }
    
    .navbar-user-trigger {
        padding: 0.3rem;
    }
    
    .user-dropdown {
        right: 0;
        left: auto;
        min-width: 240px;
    }
}

/* ========================================
   SCROLLBAR DEL DROPDOWN DE NOTIFICACIONES
   ======================================== */
.dropdown-notifications::-webkit-scrollbar {
    width: 6px;
}

.dropdown-notifications::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 0 0 12px 0;
}

.dropdown-notifications::-webkit-scrollbar-thumb {
    background: rgba(168, 143, 194, 0.3);
    border-radius: 3px;
}

.dropdown-notifications::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 143, 194, 0.5);
}

/* ============================================
   BÚSQUEDA GLOBAL - ESTILOS
   ============================================ */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-section {
    padding: 0.5rem 0;
}

.search-section:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

.search-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background: purple;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: 0.15s ease;
}

.search-result-item:hover {
    background: #f3f4f6;
}

.search-result-item:focus {
    background: #ede9fe;
    outline: none;
}


.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--purple-ola);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-name mark {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.125rem;
}

.search-result-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-result-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.search-result-badge.active {
    background: #dcfce7;
    color: #16a34a;
}

.search-result-badge.inactive {
    background: #fee2e2;
    color: #dc2626;
}

.search-result-badge.complex {
    background: #fee2e2;
    color: #dc2626;
}

.search-result-badge.judicial {
    background: #fef3c7;
    color: #d97706;
}

.search-empty,
.search-loading {
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
}

.search-empty i,
.search-loading i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.5;
}

.search-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.search-hint {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

.search-hint i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.4;
}

.search-view-all {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    color: #7c3aed;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border-top: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

.search-view-all:hover {
    background: #f3f4f6;
    color: #6d28d9;
}

.search-shortcuts {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    font-size: 0.8rem;
    color: #9ca3af;
}

.search-shortcuts kbd {
    background: #e5e7eb;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
}
