/* Focus Mode - Popups Modernes inspirés de KodingSchools */

/* Variables CSS pour cohérence */
:root {
    --focus-primary: #00A79D;
    --focus-secondary: #F7941D;
    --focus-danger: #e74c3c;
    --focus-success: #27ae60;
    --focus-bg: #ffffff;
    --focus-overlay: rgba(0, 0, 0, 0.5);
    --focus-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --focus-radius: 12px;
    --focus-font: "Montserrat", sans-serif;
}

/* Overlay moderne */
.ldfm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--focus-overlay);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ldfm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal moderne */
.ldfm-modal {
    background: var(--focus-bg);
    border-radius: var(--focus-radius);
    box-shadow: var(--focus-shadow);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    font-family: var(--focus-font);
}

.ldfm-modal-overlay.active .ldfm-modal {
    transform: scale(1) translateY(0);
}

/* Header simplifié - juste le X */
.ldfm-modal-header {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.ldfm-modal-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 24px;
    padding: 5px;
}

.ldfm-modal-close:hover {
    color: #666;
    transform: scale(1.1);
}

/* Body */
.ldfm-modal-body {
    padding: 40px 20px 30px;
    text-align: center;
    position: relative;
}

.ldfm-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.ldfm-modal-icon.success {
    background: #00A79D;
    color: white;
}

.ldfm-modal-icon.warning {
    background: var(--focus-secondary);
}

.ldfm-modal-icon.danger {
    background: var(--focus-danger);
}

.ldfm-modal-message {
    font-size: 16px;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Footer avec boutons */
.ldfm-modal-footer {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ldfm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-family: var(--focus-font);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.ldfm-btn-primary {
    background: var(--focus-primary);
    color: white;
}

.ldfm-btn-primary:hover {
    background: var(--focus-secondary);
    transform: translateY(-2px);
}

.ldfm-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.ldfm-btn-secondary:hover {
    background: #e9ecef;
}

/* Toast notifications */
.ldfm-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: var(--focus-radius);
    box-shadow: var(--focus-shadow);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100000;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
}

.ldfm-toast.show {
    transform: translateX(0);
}

.ldfm-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.ldfm-toast.success .ldfm-toast-icon {
    background: var(--focus-success);
}

.ldfm-toast.error .ldfm-toast-icon {
    background: var(--focus-danger);
}

.ldfm-toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Loading state */
.ldfm-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ldfm-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .ldfm-modal {
        width: 95%;
        margin: 20px;
    }
    
    .ldfm-modal-header {
        padding: 16px;
    }
    
    .ldfm-modal-body {
        padding: 20px 16px;
    }
    
    .ldfm-modal-footer {
        padding: 0 16px 16px;
        flex-direction: column;
    }
    
    .ldfm-btn {
        width: 100%;
    }
}

/* Animations d'entrée */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ldfm-modal.slide-in {
    animation: slideInFromTop 0.3s ease-out;
}