/**
 * notifications-bell.css
 * Estilos para la campanita de notificaciones
 * FASE 4 - Frontend - Diseño Moderno Minimalista
 */

/* ===== CAMPANITA EN HEADER ===== */
.notifications-bell-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.notification-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
}

.notification-bell-btn:hover {
    background: rgba(100, 116, 139, 0.08);
    color: #334155;
    transform: translateY(-1px);
}

.notification-bell-btn:active {
    transform: translateY(0);
    background: rgba(100, 116, 139, 0.12);
}

.notification-bell-btn svg,
.notification-bell-btn i {
    font-size: 18px;
    transition: all 0.25s ease;
}

.notification-bell-btn:hover svg,
.notification-bell-btn:hover i {
    animation: bellSwing 0.6s ease;
}

@keyframes bellSwing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50% { transform: rotate(-8deg); }
    20%, 40% { transform: rotate(8deg); }
    60% { transform: rotate(0deg); }
}

/* Badge contador minimalista */
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.35),
                0 0 0 2px white;
    animation: badgePulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

@keyframes badgePulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== PANEL DE NOTIFICACIONES ===== */
.notifications-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100000;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.notifications-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Flecha decorativa */
.notifications-panel::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 12px;
    width: 16px;
    height: 16px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

/* Header del panel */
.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.mark-all-read-btn {
    background: none;
    border: none;
    color: #10b981;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mark-all-read-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* Body del panel */
.panel-body {
    max-height: 400px;
    overflow-y: auto;
}

.panel-body::-webkit-scrollbar {
    width: 6px;
}

.panel-body::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.panel-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.panel-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Lista de notificaciones */
.notifications-list {
    padding: 8px 0;
}

/* Item de notificación */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #f0fdf4;
    border-left-color: #10b981;
}

.notification-item.unread:hover {
    background: #dcfce7;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
}

.notification-item.unread .notification-icon {
    background: rgba(16, 185, 129, 0.2);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notification-message {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    color: #9ca3af;
    font-size: 0.75rem;
}

.notification-dot {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-50%) scale(1.2);
    }
}

/* Estado vacío */
.notification-empty {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.notification-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Loading */
.notification-loading {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #f3f4f6;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.notification-loading p {
    margin: 0;
    font-size: 0.9rem;
}

/* Footer del panel */
.panel-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
    text-align: center;
}

.view-all-link {
    color: #10b981;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: #059669;
    text-decoration: underline;
}

/* ===== TOAST NOTIFICATIONS ===== */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .notifications-panel {
        width: calc(100vw - 30px);
        max-width: 400px;
        right: 10px;
        left: auto;
        transform: translateY(-10px);
    }
    
    .notifications-panel.open {
        transform: translateY(0);
    }
    
    .notifications-panel::before {
        left: auto;
        right: 20px;
        transform: rotate(45deg);
    }
    
    .mark-all-read-btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .panel-header h3 {
        font-size: 1rem;
    }
    
    .panel-body {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .notifications-panel {
        width: calc(100vw - 20px);
        right: 50%;
        transform: translateX(50%) translateY(-10px);
        left: auto;
    }
    
    .notifications-panel.open {
        transform: translateX(50%) translateY(0);
    }
    
    .notifications-panel::before {
        left: 50%;
        right: auto;
        transform: translateX(-50%) rotate(45deg);
    }
    
    .notification-item {
        padding: 12px 16px;
    }
    
    .notification-title {
        font-size: 0.85rem;
    }
    
    .notification-message {
        font-size: 0.8rem;
    }
}

/* ===== ENLACE AL PERFIL EN NOTIFICACIONES ===== */
.notification-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 4px 10px;
    background: #4CAF50;
    color: white !important;
    text-decoration: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.notification-profile-link:hover {
    background: #45a049;
    transform: translateX(2px);
}

.notification-profile-link i {
    font-size: 11px;
}
