/**
 * Estilos para Sistema de Notificaciones Toast
 * Diseño moderno y accesible
 */

/* Contenedor de notificaciones */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Notificación Toast */
.notification-toast {
    position: relative;
    background: var(--background-white, #ffffff);
    border-radius: var(--border-radius, 12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border-left: 4px solid;
    min-width: 300px;
    max-width: 100%;
    overflow: hidden;
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-toast.closing {
    opacity: 0;
    transform: translateX(100%);
    margin-bottom: -100%;
}

/* Tipos de notificación */
.notification-toast.notification-success {
    border-left-color: var(--success-green, #10b981);
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}

.notification-toast.notification-error {
    border-left-color: var(--error-red, #ef4444);
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.notification-toast.notification-warning {
    border-left-color: var(--warning-yellow, #f59e0b);
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.notification-toast.notification-info {
    border-left-color: var(--primary-blue, #3b82f6);
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

/* Contenido de notificación */
.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 50%;
    margin-top: 2px;
}

.notification-success .notification-icon {
    color: var(--success-green, #10b981);
    background: rgba(16, 185, 129, 0.1);
}

.notification-error .notification-icon {
    color: var(--error-red, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

.notification-warning .notification-icon {
    color: var(--warning-yellow, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
}

.notification-info .notification-icon {
    color: var(--primary-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark, #1e293b);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-message {
    font-size: 13px;
    color: var(--text-medium, #64748b);
    line-height: 1.5;
    word-wrap: break-word;
}

.notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-medium, #64748b);
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 0;
    margin-top: 2px;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark, #1e293b);
}

.notification-close i {
    font-size: 18px;
}

/* Acciones de notificación */
.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.notification-action {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.notification-action-primary {
    color: var(--primary-green, #10b981);
    background: rgba(16, 185, 129, 0.1);
}

.notification-action-primary:hover {
    background: rgba(16, 185, 129, 0.2);
}

.notification-action-secondary {
    color: var(--text-medium, #64748b);
    background: rgba(100, 116, 139, 0.1);
}

.notification-action-secondary:hover {
    background: rgba(100, 116, 139, 0.2);
}

/* Barra de progreso */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    width: 100%;
    transform-origin: left;
    animation: notificationProgress linear;
}

.notification-success .notification-progress {
    background: var(--success-green, #10b981);
}

.notification-error .notification-progress {
    background: var(--error-red, #ef4444);
}

.notification-warning .notification-progress {
    background: var(--warning-yellow, #f59e0b);
}

.notification-info .notification-progress {
    background: var(--primary-blue, #3b82f6);
}

@keyframes notificationProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Efecto Ripple para botones */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    pointer-events: none;
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Estados de carga mejorados */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Spinner mejorado */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.125em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.1em;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Mejoras en formularios */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.form-group.focused {
    transform: translateY(-2px);
}

.form-group.valid .form-control {
    border-color: var(--success-green, #10b981);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-group.invalid .form-control {
    border-color: var(--error-red, #ef4444);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ef4444'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-group.valid .form-control:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group.invalid .form-control:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Mensajes de error en formularios */
.form-error-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--error-red, #ef4444);
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejoras en alertas Bootstrap */
.alert {
    border-radius: var(--border-radius, 8px);
    border-left: 4px solid;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    border-left-color: var(--success-green, #10b981);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: #065f46;
}

.alert-danger {
    border-left-color: var(--error-red, #ef4444);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #991b1b;
}

.alert-warning {
    border-left-color: var(--warning-yellow, #f59e0b);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: #92400e;
}

.alert-info {
    border-left-color: var(--primary-blue, #3b82f6);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: #1e40af;
}

.alert .btn-close {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* Mejoras en botones */
.btn {
    position: relative;
    overflow: hidden;
    transform: none;
    box-sizing: border-box;
    outline: none;
}

.btn:hover:not(:disabled) {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:focus {
    outline: none;
    transform: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Efectos de hover en cards */
.card, .modern-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover, .modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Animaciones suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-toast {
        min-width: auto;
        padding: 14px;
    }

    .notification-title {
        font-size: 13px;
    }

    .notification-message {
        font-size: 12px;
    }

    .notification-icon {
        width: 20px;
        height: 20px;
        font-size: 18px;
    }
}

/* Accesibilidad */
.notification-toast:focus {
    outline: 2px solid var(--primary-blue, #3b82f6);
    outline-offset: 2px;
}

/* Modo oscuro (si se implementa) */
@media (prefers-color-scheme: dark) {
    .notification-toast {
        background: var(--surface-dark, #1e293b);
        color: var(--text-light, #f1f5f9);
    }

    .notification-title {
        color: var(--text-light, #f1f5f9);
    }

    .notification-message {
        color: var(--text-secondary-dark, #94a3b8);
    }
}

