/* Styles pour les notifications */

/* Notifications globales (en haut de page) */
.global-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 1rem;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.global-notification.success {
    background: #f0fff4;
    color: #38a169;
    border-bottom: 3px solid #9ae6b4;
}

.global-notification.error {
    background: #fed7d7;
    color: #e53e3e;
    border-bottom: 3px solid #feb2b2;
}

.global-notification.warning {
    background: #fefcbf;
    color: #d69e2e;
    border-bottom: 3px solid #faf089;
}

.global-notification.info {
    background: #ebf8ff;
    color: #3182ce;
    border-bottom: 3px solid #90cdf4;
}

.global-notification .notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

.global-notification .notification-content i {
    flex-shrink: 0;
    font-size: 1.1rem;
}

.global-notification .notification-content span {
    flex: 1;
    line-height: 1.5;
    text-align: center;
}

.global-notification .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    color: inherit;
    opacity: 0.7;
    flex-shrink: 0;
}

.global-notification .close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notifications locales (coin droit) */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    line-height: 1.4;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-left: 4px solid #065f46;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-left: 4px solid #991b1b;
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-left: 4px solid #92400e;
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-left: 4px solid #1d4ed8;
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-message {
    opacity: 0.95;
    font-size: 0.9rem;
}

.notification-close {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

/* Form states */
.form-submitting .submit-btn {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.form-field.error input,
.form-field.error textarea,
.form-field.error select {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-field.success input,
.form-field.success textarea,
.form-field.success select {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-success {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive notifications */
@media (max-width: 768px) {
    .notification {
        left: 10px;
        right: 10px;
        top: 10px;
        min-width: auto;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}
