/* ============================================================================
 * NOTIFICATION BELL - Componente de notificaciones para directores/admins
 * Diseño neumórfico integrado con el sistema
 * ============================================================================ */

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.notification-bell-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ==================== BOTÓN DE CAMPANA ==================== */
.notification-bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--neo-surface, #ffffff);
    border: 1px solid var(--neo-border, rgba(0, 73, 255, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary, #4a5568);
    font-size: 1.125rem;
}

.notification-bell-btn:hover {
    background: var(--logo-blue-light, #e6f0ff);
    border-color: var(--logo-blue, #0049ff);
    color: var(--logo-blue, #0049ff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 73, 255, 0.15);
}

.notification-bell-btn:focus {
    outline: 2px solid var(--logo-blue, #0049ff);
    outline-offset: 2px;
}

/* ==================== BADGE DE CONTADOR ==================== */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #dc2626;
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

.notification-badge.hidden {
    display: none;
}

.notification-badge.urgent {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    animation: badgeUrgent 0.8s ease-in-out infinite;
}

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

@keyframes badgeUrgent {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.6);
    }
}

/* ==================== PANEL DE NOTIFICACIONES ==================== */
.notification-panel {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 420px;
    max-height: 600px;
    background: var(--neo-surface, #ffffff);
    border: 1px solid var(--neo-border, rgba(0, 73, 255, 0.12));
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 73, 255, 0.2);
    z-index: 9999;
    overflow: hidden;
    flex-direction: column;
}

.notification-panel.active {
    display: flex;
    animation: panelSlideIn 0.2s ease-out;
}

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

/* ==================== HEADER DEL PANEL ==================== */
.notification-panel-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--logo-blue, #0049ff) 0%, var(--holo-accent, #0066ff) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.notification-panel-header h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-panel-header h3 i {
    font-size: 1rem;
}

.notification-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-summary {
    display: flex;
    gap: 0.5rem;
}

/* Botón de cierre del panel */
.notification-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    position: relative;
    z-index: 10;
}

.notification-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.notification-close-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Chevron indicador de expandir/colapsar */
.notification-chevron {
    color: var(--text-tertiary, #94a3b8);
    font-size: 0.625rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.notification-chevron.expanded {
    transform: rotate(180deg);
}

.notification-count-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.notification-count-badge.critico {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.notification-count-badge.alto {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* ==================== LISTA DE NOTIFICACIONES ==================== */
.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--neo-border, rgba(0, 73, 255, 0.12));
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: var(--logo-blue, #0049ff);
}

/* ==================== WRAPPER DE ITEM ==================== */
.notification-item-wrapper {
    margin-bottom: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.notification-item-wrapper:last-child {
    margin-bottom: 0;
}

/* Estado expandido del wrapper */
.notification-item-wrapper.is-expanded {
    background: #f0f7ff;
    box-shadow: 0 4px 16px rgba(0, 73, 255, 0.15);
    margin-bottom: 0.75rem;
}

/* ==================== ITEMS DE NOTIFICACIÓN ==================== */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary, #1a1a1a);
    transition: all 0.25s ease;
    background: var(--neo-surface, #ffffff);
    border: 1px solid var(--neo-border, rgba(0, 73, 255, 0.12));
    cursor: pointer;
    position: relative;
}

.notification-item:hover {
    border-color: var(--logo-blue, #0049ff);
    box-shadow: 0 2px 8px rgba(0, 73, 255, 0.1);
}

.notification-item:focus {
    outline: 2px solid var(--logo-blue, #0049ff);
    outline-offset: 2px;
}

/* Estado expandido del item */
.notification-item.expanded {
    border-radius: 10px 10px 0 0;
    border-bottom: none;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: var(--logo-blue, #0049ff);
    box-shadow: none;
}

/* Prioridades */
.notification-item.prioridad-0 {
    border-left: 4px solid #dc2626;
    background: linear-gradient(90deg, #fef2f2 0%, #ffffff 100%);
}

.notification-item.prioridad-0:hover,
.notification-item.prioridad-0.expanded {
    background: linear-gradient(90deg, #fee2e2 0%, #fef2f2 100%);
}

.notification-item.prioridad-1 {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(90deg, #fffbeb 0%, #ffffff 100%);
}

.notification-item.prioridad-1:hover,
.notification-item.prioridad-1.expanded {
    background: linear-gradient(90deg, #fef3c7 0%, #fffbeb 100%);
}

.notification-item.prioridad-2 {
    border-left: 4px solid var(--logo-blue, #0049ff);
}

.notification-item.prioridad-3 {
    border-left: 4px solid #9ca3af;
}

/* ==================== ICONO DE NOTIFICACIÓN ==================== */
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.notification-icon.red {
    background: #fee2e2;
    color: #dc2626;
}

.notification-icon.orange {
    background: #ffedd5;
    color: #ea580c;
}

.notification-icon.yellow {
    background: #fef3c7;
    color: #d97706;
}

.notification-icon.blue {
    background: var(--logo-blue-light, #e6f0ff);
    color: var(--logo-blue, #0049ff);
}

.notification-icon.green {
    background: #d1fae5;
    color: #059669;
}

.notification-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

/* ==================== CONTENIDO DE NOTIFICACIÓN ==================== */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-cantidad {
    background: var(--logo-blue, #0049ff);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
}

.notification-mensaje {
    font-size: 0.8125rem;
    color: var(--text-secondary, #4a5568);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* ==================== INDICADOR DE EXPANDIR ==================== */
.notification-expand-hint {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--logo-blue, #0049ff);
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.notification-expand-hint i {
    font-size: 0.625rem;
    animation: bounceDown 1.5s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(3px);
    }
}

.notification-item:hover .notification-expand-hint {
    opacity: 1;
}

/* ==================== PANEL DE AYUDA EXPANDIDO ==================== */
.notification-help-panel {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid var(--logo-blue, #0049ff);
    border-top: 2px dashed var(--logo-blue, #0049ff);
    border-radius: 0 0 10px 10px;
    padding: 1rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Prioridades en panel de ayuda */
.notification-help-panel.prioridad-0 {
    border-left: 4px solid #dc2626;
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
}

.notification-help-panel.prioridad-1 {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.notification-help-panel.prioridad-2 {
    border-left: 4px solid var(--logo-blue, #0049ff);
}

/* ==================== HEADER DEL PANEL DE AYUDA ==================== */
.notification-help-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--logo-blue, #0049ff) 0%, var(--holo-accent, #0066ff) 100%);
    color: white;
    border-radius: 6px;
    margin-bottom: 0.875rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notification-help-header i {
    font-size: 0.875rem;
}

/* ==================== DESCRIPCIÓN DE AYUDA ==================== */
.notification-help-description {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: white;
    border: 1px solid var(--neo-border, rgba(0, 73, 255, 0.12));
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text-primary, #1a1a1a);
    line-height: 1.5;
}

.notification-help-description i {
    color: var(--logo-blue, #0049ff);
    font-size: 1.125rem;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

/* ==================== PASOS PARA RESOLVER ==================== */
.notification-help-steps {
    margin-bottom: 1rem;
    background: white;
    border: 1px solid var(--neo-border, rgba(0, 73, 255, 0.12));
    border-radius: 8px;
    padding: 0.875rem;
}

.notification-help-steps-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #4a5568);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--neo-border, rgba(0, 73, 255, 0.12));
}

.notification-help-steps-title i {
    color: var(--logo-blue, #0049ff);
    font-size: 0.9375rem;
}

.notification-steps-list {
    margin: 0;
    padding-left: 0;
    list-style-type: none;
    counter-reset: step-counter;
}

.notification-steps-list li {
    font-size: 0.8125rem;
    color: var(--text-secondary, #4a5568);
    line-height: 1.5;
    padding: 0.5rem 0;
    padding-left: 2.25rem;
    position: relative;
    border-bottom: 1px dashed var(--neo-border, rgba(0, 73, 255, 0.08));
    counter-increment: step-counter;
}

.notification-steps-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.notification-steps-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--logo-blue, #0049ff);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
}

/* ==================== INFO DE RESOLUCIÓN ==================== */
.notification-resolution-info {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
    border: 1px solid #059669;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: #065f46;
    line-height: 1.5;
}

.notification-resolution-info i {
    color: #059669;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

/* ==================== BOTÓN DE ACCIÓN ==================== */
.notification-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--logo-blue, #0049ff) 0%, var(--holo-accent, #0066ff) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 73, 255, 0.25);
}

.notification-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 73, 255, 0.35);
}

.notification-action-btn:focus {
    outline: 2px solid var(--logo-blue, #0049ff);
    outline-offset: 2px;
}

.notification-action-btn i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.notification-action-btn:hover i {
    transform: translateX(4px);
}

/* ==================== FOOTER DEL PANEL ==================== */
.notification-panel-footer {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--neo-border, rgba(0, 73, 255, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-dim, #718096);
    flex-shrink: 0;
}

.notification-panel-footer i {
    font-size: 0.75rem;
    color: var(--logo-blue, #0049ff);
}

/* ==================== ESTADO VACÍO ==================== */
.notification-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-dim, #718096);
}

.notification-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #059669;
}

.notification-empty h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary, #4a5568);
    margin: 0 0 0.5rem;
}

.notification-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* ==================== ESTADO DE CARGA ==================== */
.notification-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-dim, #718096);
}

.notification-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--neo-border, rgba(0, 73, 255, 0.12));
    border-top-color: var(--logo-blue, #0049ff);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== ERROR STATE ==================== */
.notification-error {
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 8px;
    margin: 0.5rem;
}

.notification-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ==================== ANIMACIÓN DE NUEVA NOTIFICACIÓN ==================== */
@keyframes newNotification {
    0% {
        background-color: var(--logo-blue-light);
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

.notification-item.new {
    animation: newNotification 1s ease-out;
}

/* ==================== ACCESIBILIDAD ==================== */
@media (prefers-reduced-motion: reduce) {
    .notification-badge,
    .notification-panel,
    .notification-item,
    .notification-loading-spinner,
    .notification-action-btn,
    .notification-help-panel {
        animation: none;
    }

    .notification-bell-btn:hover,
    .notification-item:hover,
    .notification-action-btn:hover,
    .notification-action-btn:hover i {
        transform: none;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .notification-panel {
        width: calc(100vw - 20px);
        right: -60px;
        max-height: 80vh;
    }

    .notification-panel-header {
        padding: 0.875rem 1rem;
    }

    .notification-item {
        padding: 0.75rem;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .notification-help-panel {
        padding: 0.75rem;
    }

    .notification-help-description {
        padding: 0.625rem;
        font-size: 0.75rem;
    }

    .notification-steps-list li {
        font-size: 0.75rem;
        padding-left: 2rem;
    }

    .notification-steps-list li::before {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.625rem;
    }

    .notification-action-btn {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .notification-expand-hint {
        font-size: 0.625rem;
    }
}
