/* ============================================
   CUSTOM ALERTS & NOTIFICATIONS
   Pas de popups système - Design personnalisé
   ============================================ */

.custom-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-lg);
    animation: slideInDown 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    transition: opacity 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-alert-success {
    background: linear-gradient(135deg, rgba(77, 175, 110, 0.1) 0%, rgba(55, 142, 86, 0.05) 100%);
    border-left: 4px solid var(--secondary-green);
}

.custom-alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    border-left: 4px solid #EF4444;
}

.custom-alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    border-left: 4px solid #F59E0B;
}

.custom-alert-info {
    background: linear-gradient(135deg, rgba(26, 82, 136, 0.1) 0%, rgba(45, 108, 168, 0.05) 100%);
    border-left: 4px solid var(--primary-blue);
}

.alert-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.custom-alert-success .alert-icon {
    background: rgba(77, 175, 110, 0.2);
    color: var(--secondary-green);
}

.custom-alert-error .alert-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.custom-alert-warning .alert-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
}

.custom-alert-info .alert-icon {
    background: rgba(26, 82, 136, 0.2);
    color: var(--primary-blue);
}

.alert-content {
    flex: 1;
}

.alert-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--surface-dark);
}

.alert-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.alert-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--surface-dark);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notifications (position fixe en haut à droite) */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
}

.toast {
    background: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-sm);
}

.progress-fill {
    height: 100%;
    background: var(--secondary-green);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Modal personnalisé (pas de popup système) */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.custom-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: var(--surface-dark);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    padding: var(--space-xl);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .custom-modal {
        padding: var(--space-sm);
    }

    .modal-content {
        max-height: 95vh;
    }
}