/**
 * SISTEMA DE NOTIFICACIONES PUSH - ESTILOS TOAST
 * Diseño idéntico al sistema de pasantías (Tailwind adaptado a CSS puro)
 */

/* ============================================================================
   CONTENEDOR DE TOASTS
   ============================================================================ */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 24rem; /* max-w-sm */
    pointer-events: none;
    padding: 1rem;
}

@media (min-width: 768px) {
    #toast-container {
        padding: 0;
    }
}

/* ============================================================================
   ANIMACIONES (Idénticas al HTML original)
   ============================================================================ */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ============================================================================
   TOAST BASE (Idéntico al HTML original)
   ============================================================================ */
.notification-toast {
    pointer-events: auto;
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); /* shadow-lg */
    border-left-width: 4px;
    border-left-style: solid;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-toast:hover {
    transform: translateX(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
}

.notification-toast.toast-exit {
    animation: slideOut 0.4s ease-in forwards;
}

/* ============================================================================
   CONTENIDO DEL TOAST
   ============================================================================ */
.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
}

.toast-icon-wrapper {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem; /* w-10 h-10 */
    height: 2.5rem;
    border-radius: 9999px; /* rounded-full */
    margin-right: 0.75rem; /* mr-3 */
}

.toast-icon-wrapper i {
    font-size: 1.5rem; /* w-6 h-6 equivalente */
}

.toast-body {
    flex: 1;
    padding-top: 0.125rem; /* pt-0.5 */
}

.toast-title {
    font-size: 0.875rem; /* text-sm */
    font-weight: 700; /* font-bold */
    color: #111827; /* text-gray-900 */
    margin: 0 0 0.25rem 0; /* mb-1 */
    line-height: 1.25;
}

.toast-message {
    font-size: 0.875rem; /* text-sm */
    color: #6b7280; /* text-gray-500 */
    margin: 0;
    line-height: 1.625; /* leading-relaxed */
}

.toast-close {
    flex-shrink: 0;
    margin-left: 0.75rem; /* ml-3 */
    padding: 0;
    background: transparent;
    border: none;
    color: #9ca3af; /* text-gray-400 */
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.toast-close:hover {
    color: #4b5563; /* hover:text-gray-600 */
}

.toast-close i {
    font-size: 1rem; /* w-4 h-4 */
}

/* ============================================================================
   BARRA DE PROGRESO (Idéntica al HTML original)
   ============================================================================ */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0.25rem; /* h-1 */
    width: 100%;
    animation: progress 6s linear forwards;
}

/* ============================================================================
   VARIANTES POR TIPO DE NOTIFICACIÓN (Colores idénticos al HTML original)
   ============================================================================ */

/* INFO - Nueva Solicitud (blue-500, blue-100, blue-600) */
.notification-toast.toast-info {
    border-left-color: #3b82f6; /* border-blue-500 */
}
.notification-toast.toast-info .toast-icon-wrapper {
    background-color: #dbeafe; /* bg-blue-100 */
    color: #2563eb; /* text-blue-600 */
}
.notification-toast.toast-info .toast-progress {
    background-color: #3b82f6; /* bg-blue-500 */
}

/* WARNING - Asignación Docente (amber-500, amber-100, amber-600) */
.notification-toast.toast-warning {
    border-left-color: #f59e0b; /* border-amber-500 */
}
.notification-toast.toast-warning .toast-icon-wrapper {
    background-color: #fef3c7; /* bg-amber-100 */
    color: #d97706; /* text-amber-600 */
}
.notification-toast.toast-warning .toast-progress {
    background-color: #f59e0b; /* bg-amber-500 */
}

/* SUCCESS - Profesor Acepta (emerald-500, emerald-100, emerald-600) */
.notification-toast.toast-success {
    border-left-color: #10b981; /* border-emerald-500 */
}
.notification-toast.toast-success .toast-icon-wrapper {
    background-color: #d1fae5; /* bg-emerald-100 */
    color: #059669; /* text-emerald-600 */
}
.notification-toast.toast-success .toast-progress {
    background-color: #10b981; /* bg-emerald-500 */
}

/* CONFIRM - Actividad Confirmada (indigo-500, indigo-100, indigo-600) */
.notification-toast.toast-confirm {
    border-left-color: #6366f1; /* border-indigo-500 */
}
.notification-toast.toast-confirm .toast-icon-wrapper {
    background-color: #e0e7ff; /* bg-indigo-100 */
    color: #4f46e5; /* text-indigo-600 */
}
.notification-toast.toast-confirm .toast-progress {
    background-color: #6366f1; /* bg-indigo-500 */
}

/* MATERIALS - Solicitud de Materiales (rose-500, rose-100, rose-600) */
.notification-toast.toast-materials {
    border-left-color: #f43f5e; /* border-rose-500 */
}
.notification-toast.toast-materials .toast-icon-wrapper {
    background-color: #ffe4e6; /* bg-rose-100 */
    color: #e11d48; /* text-rose-600 */
}
.notification-toast.toast-materials .toast-progress {
    background-color: #f43f5e; /* bg-rose-500 */
}

/* START - Inicio de Actividad (purple-500, purple-100, purple-600) */
.notification-toast.toast-start {
    border-left-color: #a855f7; /* border-purple-500 */
}
.notification-toast.toast-start .toast-icon-wrapper {
    background-color: #f3e8ff; /* bg-purple-100 */
    color: #9333ea; /* text-purple-600 */
}
.notification-toast.toast-start .toast-progress {
    background-color: #a855f7; /* bg-purple-500 */
}

/* FINISH - Actividad Finalizada (teal-500, teal-100, teal-600) */
.notification-toast.toast-finish {
    border-left-color: #14b8a6; /* border-teal-500 */
}
.notification-toast.toast-finish .toast-icon-wrapper {
    background-color: #ccfbf1; /* bg-teal-100 */
    color: #0d9488; /* text-teal-600 */
}
.notification-toast.toast-finish .toast-progress {
    background-color: #14b8a6; /* bg-teal-500 */
}

/* REJECTED - Actividad Rechazada (red-500, red-100, red-600) */
.notification-toast.toast-rejected {
    border-left-color: #ef4444; /* border-red-500 */
}
.notification-toast.toast-rejected .toast-icon-wrapper {
    background-color: #fee2e2; /* bg-red-100 */
    color: #dc2626; /* text-red-600 */
}
.notification-toast.toast-rejected .toast-progress {
    background-color: #ef4444; /* bg-red-500 */
}

/* CANCELLED - Actividad Cancelada (gray-500, gray-100, gray-600) */
.notification-toast.toast-cancelled {
    border-left-color: #6b7280; /* border-gray-500 */
}
.notification-toast.toast-cancelled .toast-icon-wrapper {
    background-color: #f3f4f6; /* bg-gray-100 */
    color: #4b5563; /* text-gray-600 */
}
.notification-toast.toast-cancelled .toast-progress {
    background-color: #6b7280; /* bg-gray-500 */
}

/* REMINDER - Recordatorio (cyan-500, cyan-100, cyan-600) */
.notification-toast.toast-reminder {
    border-left-color: #06b6d4; /* border-cyan-500 */
}
.notification-toast.toast-reminder .toast-icon-wrapper {
    background-color: #cffafe; /* bg-cyan-100 */
    color: #0891b2; /* text-cyan-600 */
}
.notification-toast.toast-reminder .toast-progress {
    background-color: #06b6d4; /* bg-cyan-500 */
}

/* DEFAULT - Genérico (slate-500, slate-100, slate-600) */
.notification-toast.toast-default {
    border-left-color: #64748b; /* border-slate-500 */
}
.notification-toast.toast-default .toast-icon-wrapper {
    background-color: #f1f5f9; /* bg-slate-100 */
    color: #475569; /* text-slate-600 */
}
.notification-toast.toast-default .toast-progress {
    background-color: #64748b; /* bg-slate-500 */
}

/* ============================================================================
   HOVER EFFECTS
   ============================================================================ */
.notification-toast:hover {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.notification-toast:hover .toast-progress {
    animation-play-state: paused;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 640px) {
    #toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
    
    .notification-toast {
        border-radius: 0.5rem;
    }
    
    .toast-content {
        padding: 0.875rem;
    }
    
    .toast-icon-wrapper {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .toast-icon-wrapper i {
        font-size: 1.125rem;
    }
    
    .toast-title {
        font-size: 0.8125rem;
    }
    
    .toast-message {
        font-size: 0.8125rem;
    }
}
