/*
Theme Name: Astra c'cité
Description: Thème enfant d'Astra pour personnalisations
Template: astra
Version: 1.0.0
*/

/* Styles pour les modales */
.modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 40px;
    border: none;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #666;
    float: right;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    z-index: 10;
    background: none;
    border: none;
    padding: 8px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    color: #fff;
    background-color: #ff4444;
    transform: scale(1.1);
}

/* Styles pour Contact Form 7 dans les modales */
.modal .wpcf7 {
    margin: 0;
}

.modal .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal .wpcf7 input[type="text"],
.modal .wpcf7 input[type="email"],
.modal .wpcf7 input[type="tel"],
.modal .wpcf7 input[type="url"],
.modal .wpcf7 input[type="number"],
.modal .wpcf7 input[type="date"],
.modal .wpcf7 textarea,
.modal .wpcf7 select {
    width: 100% !important;
    padding: 15px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fafbfc;
}

.modal .wpcf7 input:focus,
.modal .wpcf7 textarea:focus,
.modal .wpcf7 select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
    background-color: #fff;
}

.modal .wpcf7 textarea {
    min-height: 120px;
    resize: vertical;
}

.modal .wpcf7 input[type="submit"] {
    background: linear-gradient(135deg, #0073aa, #005a8b);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal .wpcf7 input[type="submit"]:hover {
    background: linear-gradient(135deg, #005a8b, #004470);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,115,170,0.3);
}

.modal h2 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    padding-right: 50px; /* Pour éviter le bouton close */
}

/* Messages CF7 */
.modal .wpcf7-response-output {
    margin: 15px 0 0 0 !important;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.modal .wpcf7-validation-errors {
    background-color: #fff2f2;
    border: 2px solid #ff6b6b;
    color: #d63031;
}

.modal .wpcf7-mail-sent-ok {
    background-color: #f0fff4;
    border: 2px solid #51cf66;
    color: #2f9e44;
}

/* Empêcher le scroll du body quand la modale est ouverte */
body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 25px;
        border-radius: 8px;
    }
    
    .modal h2 {
        font-size: 24px;
        padding-right: 40px;
    }
    
    .close {
        right: 15px;
        top: 12px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
    
    .modal .wpcf7 input[type="text"],
    .modal .wpcf7 input[type="email"],
    .modal .wpcf7 input[type="tel"],
    .modal .wpcf7 textarea {
        padding: 12px 15px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        max-height: 80vh;
    }
    
    .modal h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
}
