/**
 * Styles du popup de création de rencontre
 * Design moderne et cohérent avec les popups connexion/inscription
 */

/* ========================================
   OVERLAY & CONTAINER
   ======================================== */

.terreaux-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.terreaux-popup-overlay.active {
    opacity: 1;
}

.terreaux-popup-container {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.terreaux-popup-overlay.active .terreaux-popup-container {
    transform: scale(1);
}

/* Scrollbar personnalisée */
.terreaux-popup-container::-webkit-scrollbar {
    width: 8px;
}

.terreaux-popup-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.terreaux-popup-container::-webkit-scrollbar-thumb {
    background: #6B9F3E;
    border-radius: 10px;
}

.terreaux-popup-container::-webkit-scrollbar-thumb:hover {
    background: #5a8533;
}

/* ========================================
   BOUTON FERMER
   ======================================== */

.terreaux-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.terreaux-popup-close span {
    font-size: 28px;
    line-height: 1;
    color: #666;
    font-weight: 300;
}

.terreaux-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.terreaux-popup-close:hover span {
    color: #333;
}

/* ========================================
   CONTENU
   ======================================== */

.terreaux-popup-content {
    padding: 40px 35px;
}

/* ========================================
   HEADER
   ======================================== */

.terreaux-popup-header {
    text-align: center;
    margin-bottom: 30px;
}

.terreaux-popup-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #6B9F3E 0%, #5a8533 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(107, 159, 62, 0.3);
}

.terreaux-popup-icon .dashicons {
    font-size: 35px;
    width: 35px;
    height: 35px;
    color: white;
}

.terreaux-popup-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.terreaux-popup-subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.5;
}


/* ========================================
   MESSAGES
   ======================================== */

.terreaux-message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terreaux-message::before {
    font-family: "dashicons";
    font-size: 20px;
}

.terreaux-message.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.terreaux-message.error::before {
    content: "\f534";
    color: #c33;
}

.terreaux-message.success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.terreaux-message.success::before {
    content: "\f147";
    color: #3c3;
}

/* ========================================
   FORMULAIRE
   ======================================== */

#terreaux-rencontre-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.terreaux-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terreaux-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}

.terreaux-form-group label .dashicons {
    color: #6B9F3E;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Inputs */
.terreaux-form-group input[type="text"],
.terreaux-form-group input[type="date"],
.terreaux-form-group input[type="time"],
.terreaux-form-group input[type="number"],
.terreaux-form-group select {
    width: 100%;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #2c3e50;
}


.terreaux-form-group select option {
    text-align: left;
}

.terreaux-form-group input:focus,
.terreaux-form-group select:focus {
    outline: none;
    border-color: #6B9F3E;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(107, 159, 62, 0.1);
}

.terreaux-form-group input::placeholder {
    color: #95a5a6;
}

.field-description {
    font-size: 12px;
    color: #7f8c8d;
    margin: 5px 0 0 0;
    font-style: italic;
}

/* Row pour date et heure côte à côte */
.terreaux-form-row {
    display: flex;
    gap: 15px;
}

.terreaux-form-half {
    flex: 1;
}

/* Upload de fichier */
.terreaux-file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
}

.terreaux-btn-file {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px dashed #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6B9F3E;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.terreaux-btn-file:hover {
    background: #6B9F3E;
    color: white;
    border-color: #6B9F3E;
}

.terreaux-btn-file .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.terreaux-filename {
    font-size: 13px;
    color: #7f8c8d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.terreaux-btn-remove-file {
    padding: 8px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.terreaux-btn-remove-file:hover {
    background: #f33;
    border-color: #f33;
}

.terreaux-btn-remove-file .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #c33;
}

.terreaux-btn-remove-file:hover .dashicons {
    color: white;
}
/* ========================================
   ACTIONS
   ======================================== */

.terreaux-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.terreaux-btn-primary,
.terreaux-btn-secondary,
.terreaux-btn-reset {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.terreaux-btn-primary {
    flex: 1.5;
    background: linear-gradient(135deg, #6B9F3E 0%, #5a8533 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 159, 62, 0.3);
}

.terreaux-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 159, 62, 0.4);
}

.terreaux-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.terreaux-btn-primary .dashicons {
   display:none;
}

.terreaux-btn-secondary {
    background: #f8f9fa;
    color: #2c3e50;
    border: 2px solid #e1e8ed;
}

.terreaux-btn-secondary:hover {
    background: #e1e8ed;
}

.terreaux-btn-reset {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.terreaux-btn-reset:hover {
    background: #ffc107;
    color: white;
}

.terreaux-btn-reset .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Note */
.terreaux-form-note {
    font-size: 12px;
    color: #95a5a6;
    text-align: center;
    margin: 5px 0 0 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 600px) {
    .terreaux-popup-content {
        padding: 30px 25px;
    }
    
    .terreaux-popup-header h2 {
        font-size: 22px;
    }
    
    .terreaux-popup-icon {
        width: 60px;
        height: 60px;
    }
    
    .terreaux-popup-icon .dashicons {
        font-size: 30px;
        width: 30px;
        height: 30px;
    }
    
    .terreaux-form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .terreaux-form-actions {
        flex-direction: column;
    }
    
    .terreaux-file-upload {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .terreaux-btn-file {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   ANIMATIONS DE CHARGEMENT
   ======================================== */

.terreaux-btn-primary.loading {
    position: relative;
    color: transparent;
}

.terreaux-btn-primary.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.6s linear infinite;
}

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

@keyframes shake {
    0%, 100% {
        transform: scale(1) translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: scale(1) translateX(-8px);
    }
    20%, 40%, 60%, 80% {
        transform: scale(1) translateX(8px);
    }
}

.terreaux-popup-container.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97);
}

/* Assurer que le popup ne perd pas son scale pendant le shake */
.terreaux-popup-overlay.active .terreaux-popup-container.shake {
    transform: scale(1);
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97);
}