/**
 * Styles pour les Modales du plugin Défi Complet Claude
 *
 * @package Defi_Complet_Claude
 */

/* ==========================================================================
   Modal Base
   ========================================================================== */

.defi-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    animation: modalFadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.defi-modal.closing {
    animation: modalFadeOut 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ==========================================================================
   Modal Content
   ========================================================================== */

.defi-modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

.defi-modal.closing .defi-modal-content {
    animation: modalSlideOut 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(50px);
        opacity: 0;
    }
}

/* ==========================================================================
   Modal Header
   ========================================================================== */

.defi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.defi-modal-title {
    font-size: 2em;
    margin: 0;
    color: #333;
}

.defi-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.defi-modal-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

/* ==========================================================================
   Modal Body
   ========================================================================== */

.defi-modal-body {
    line-height: 1.8;
    color: #666;
}

.defi-modal-body h2,
.defi-modal-body h3 {
    color: #333;
    margin-top: 30px;
    margin-bottom: 15px;
}

.defi-modal-body p {
    margin-bottom: 15px;
}

.defi-modal-body ul,
.defi-modal-body ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.defi-modal-body ul li,
.defi-modal-body ol li {
    margin-bottom: 10px;
}

/* ==========================================================================
   Modal Footer
   ========================================================================== */

.defi-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.defi-modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.defi-modal-btn-primary {
    background: #0073aa;
    color: white;
}

.defi-modal-btn-primary:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.defi-modal-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.defi-modal-btn-secondary:hover {
    background: #e0e0e0;
}

.defi-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================================================
   Modal de Règlement
   ========================================================================== */

.defi-modal-reglement {
    max-width: 900px;
}

.defi-reglement-content {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.defi-reglement-section {
    margin: 30px 0;
}

.defi-reglement-section h3 {
    color: #dc3232;
    margin-bottom: 15px;
}

.defi-accept-terms {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.defi-accept-terms input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.defi-accept-terms label {
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   Modal de Participation
   ========================================================================== */

.defi-modal-participation {
    max-width: 600px;
}

.defi-duration-choice {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.defi-duration-option {
    padding: 30px;
    border: 3px solid #ddd;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.defi-duration-option:hover {
    border-color: #0073aa;
    background: #f0f9ff;
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 115, 170, 0.2);
}

.defi-duration-option.selected {
    border-color: #0073aa;
    background: #e3f2fd;
}

.defi-duration-option input[type="radio"] {
    display: none;
}

.defi-duration-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.defi-duration-label {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.defi-duration-description {
    color: #666;
    font-size: 0.95em;
}

/* ==========================================================================
   Modal de Défi (Navigation)
   ========================================================================== */

.defi-modal-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.defi-nav-btn {
    padding: 12px 24px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.defi-nav-btn:hover:not(:disabled) {
    background: #e0e0e0;
    transform: translateX(5px);
}

.defi-nav-btn.prev:hover:not(:disabled) {
    transform: translateX(-5px);
}

.defi-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   Modal Success/Error
   ========================================================================== */

.defi-modal-message {
    text-align: center;
    padding: 40px;
}

.defi-modal-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.defi-modal-message h2 {
    color: #46b450;
    margin-bottom: 20px;
}

.defi-modal-message.error h2 {
    color: #dc3232;
}

/* ==========================================================================
   Modal Info Boxes
   ========================================================================== */

.defi-info-box {
    background: #e3f2fd;
    border-left: 4px solid #0073aa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.defi-warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.defi-error-box {
    background: #ffebee;
    border-left: 4px solid #dc3232;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.defi-success-box {
    background: #e8f5e9;
    border-left: 4px solid #46b450;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

/* ==========================================================================
   Modal Loading
   ========================================================================== */

.defi-modal-loading {
    text-align: center;
    padding: 60px 40px;
}

.defi-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f0f0f0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.defi-loading-text {
    color: #666;
    font-size: 1.1em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .defi-modal {
        padding: 10px;
    }

    .defi-modal-content {
        padding: 25px;
        max-height: 95vh;
    }

    .defi-modal-title {
        font-size: 1.5em;
    }

    .defi-duration-choice {
        grid-template-columns: 1fr;
    }

    .defi-modal-footer {
        flex-direction: column;
    }

    .defi-modal-btn {
        width: 100%;
    }

    .defi-modal-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .defi-nav-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Scrollbar personnalisée (pour modal-content)
   ========================================================================== */

.defi-modal-content::-webkit-scrollbar {
    width: 8px;
}

.defi-modal-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.defi-modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.defi-modal-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.defi-modal-content:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.defi-modal-btn:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* Réduire les animations pour les utilisateurs qui préfèrent */
@media (prefers-reduced-motion: reduce) {
    .defi-modal,
    .defi-modal-content,
    .defi-modal-close,
    .defi-duration-option,
    .defi-nav-btn,
    .defi-modal-icon {
        animation: none;
        transition: none;
    }
}
