/*--------------------------------------------------
 # Contact Page Styles Unified
 # Author: Naery Web Development
 # Version: 2.0
 # Description: Styles fusionnés pour la page de contact
--------------------------------------------------*/

/**************************************************
 *               TABLE DES MATIÈRES               *
 ***************************************************
 * 1. SECTION HERO
 * 2. SECTION FORMULAIRE
 *    2.1 Structure du formulaire
 *    2.2 Inputs et champs
 *    2.3 Bouton d'envoi
 *    2.4 Messages de statut
 * 3. SECTION CONTACT INFO
 *    3.1 Layout général
 *    3.2 Liens sociaux et animations
 * 4. ANIMATIONS ET EFFETS
 * 5. RESPONSIVE
 **************************************************/

/*--------------------------------------------------
 # 1. SECTION HERO
--------------------------------------------------*/
.contact-hero {
    position: relative;
    min-height: 35vh; /* Hauteur identique au projet */
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--gradient-project-contact); /* Utilisation du même gradient que la page projet */
    color: white;
    padding: 60px 0; /* Padding réduit comme sur la page projet */
}

/* Effet lumineux optimisé pour le nouveau dégradé violet */
.contact-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 60% 25%, rgba(255, 255, 255, 0.15), transparent 55%), 
                radial-gradient(ellipse at 30% 60%, rgba(255, 255, 255, 0.1), transparent 50%),
                radial-gradient(circle at 85% 40%, rgba(255, 255, 255, 0.08), transparent 35%);
    pointer-events: none;
    z-index: 1;
}

.contact-hero .container {
    position: relative;
    z-index: 10;
}

.contact-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-subtitle {
    white-space: nowrap;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.contact-hero .section-title h1 {
    color: #fff;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.contact-hero .section-title h1:after {
    display: none !important;
}

.contact-hero .section-title.visible h1:after {
    width: 100%;
    left: 0;
    transform: none;
}

.contact-hero .section-title p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    margin-bottom: 2rem;
}

/* SVG Animations in Hero */
.contact-hero .svg-animations-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
    filter: brightness(1.15) contrast(1.05);
}

.contact-hero .svg-item {
    position: absolute;
    width: 180px;
    height: auto;
    opacity: 1;
    z-index: 2;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

/* Positionnement des SVGs */
.contact-hero .svg-item[data-svg="screen-coding"] {
    top: 31%;
    left: 1%;
    width: 200px !important;
    transform: translateY(-50%) rotate(0deg) scale(0.7);
}

.contact-hero .svg-item[data-svg="code-connect"] {
    top: 68%;
    left: 11%;
    width: 200px !important;
    transform: translateY(-50%) rotate(0deg) scale(0.7);
}

.contact-hero .svg-item[data-svg="code-windows"] {
    top: 65%;
    right: 8%;
    width: 200px !important;
    transform: translateY(-50%) rotate(0deg) scale(0.7);
}

.contact-hero .svg-item[data-svg="gear"] {
    top: 25%;
    right: 0%;
    width: 220px !important;
    transform: translateY(-50%) rotate(0deg) scale(0.7);
}

/* SVGs supplémentaires */
.contact-hero .svg-item[data-svg="loading"] {
    top: 26%;
    left: 19%;
    width: 282px !important;
    transform: translateY(-50%) rotate(0deg) scale(0.7);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.contact-hero .svg-item[data-svg="puzzle"] {
    top: 28%;
    right: 16%;
    width: 312px !important;
    transform: translateY(-50%) rotate(0deg) scale(0.7);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

/*--------------------------------------------------
 # 2. SECTION FORMULAIRE
--------------------------------------------------*/

/*--------------------------------------------------
 # 2.1 Structure du formulaire
--------------------------------------------------*/
.contact-form-section {
    padding: 120px 0 80px; /* Augmenté le padding top de 80px à 120px */
    margin-top: -60px;
    position: relative;
    z-index: 5;
    overflow: visible;
}

.contact-form-container {
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 15px 50px rgba(69, 39, 160, 0.1), 0 5px 20px rgba(0, 0, 0, 0.05);
}

/*--------------------------------------------------
 # 3. SECTION CONTACT INFO
--------------------------------------------------*/

/*--------------------------------------------------
 # 3.1 Layout général
--------------------------------------------------*/
/* Contact Info */
.contact-info {
    padding: 40px;
    background: linear-gradient(135deg, #4527a0, #7b1fa2);
    color: #fff;
    border-radius: 20px 0 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    position: relative;
    color: #ffffff;
}

.contact-info h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.contact-info p {
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 0.95rem;
    opacity: 0.9;
}

.contact-method {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

.contact-method:hover {
    transform: translateX(5px);
}

.contact-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

.contact-icon .fa-circle {
    color: #4CAF50;
}

.contact-text h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: #ffffff;
}

.contact-text p {
    font-size: 0.9rem;
    margin-bottom: 0;
    opacity: 0.8;
}

/*--------------------------------------------------
 # 3.2 Liens sociaux et animations
--------------------------------------------------*/
.social-links {
    margin-top: auto;
    display: flex;
    gap: 15px;
}

.social-link {
    color: #fff;
    opacity: 0.8;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 5px;
}

.social-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #fff;
    transition: width 0.3s ease;
}

.social-link:hover {
    opacity: 1;
}

.social-link:hover:after {
    width: 100%;
}

/* Form Container */
.form-container {
    padding: 40px;
    background-color: #fff;
}

.contact-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Form Group Structure */
.form-group {
    flex: 1 0 calc(50% - 10px);
    margin-bottom: 3px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    transform-origin: left center;
}

/*--------------------------------------------------
 # 4. ANIMATIONS ET EFFETS
--------------------------------------------------*/

/* Slide up animation for form groups */
.form-group.fade-in {
    animation: slideIn 0.6s forwards cubic-bezier(0.215, 0.61, 0.355, 1);
}

.form-group.full-width {
    flex: 1 0 100%;
}

/*--------------------------------------------------
 # 2.2 Inputs et champs
--------------------------------------------------*/
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.required::after {
    content: ' *';
    color: #4527a0; /* Changé de rose à bleu */
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    box-sizing: border-box; /* Assure que les bordures sont incluses dans la largeur */
    margin: 0; /* Réinitialise les marges par défaut */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4527a0; /* Changé de rose à bleu */
    box-shadow: 0 0 0 2px rgba(69, 39, 160, 0.08); /* Effet plus subtil */
    background-color: #fff;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.recaptcha-container {
    margin: 0;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

/*--------------------------------------------------
 # 2.3 Bouton d'envoi
--------------------------------------------------*/
.form-submit {
    width: 100%;
    margin-top: 10px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #4527a0, #7b1fa2);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Effet d'ondulation subtil pour le bouton d'envoi */
.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.05); /* Réduit l'opacité pour un effet plus subtil */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 1.2s cubic-bezier(0.19, 1, 0.22, 1), height 1.2s cubic-bezier(0.19, 1, 0.22, 1); /* Easing plus doux */
    z-index: 1;
    pointer-events: none; /* Assure que l'effet ne perturbe pas les clics */
}

.submit-btn:hover::after {
    width: 180px; /* Légèrement plus petit pour un effet moins agressif */
    height: 180px;
}

.submit-btn span {
    position: relative;
    z-index: 2;
}

.submit-btn:hover {
    background: linear-gradient(90deg, #3b1f8a, #6a1a8c);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(123, 31, 162, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(123, 31, 162, 0.3);
}

.submit-btn .btn-loading {
    display: none;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loading {
    display: block;
}

.submit-btn.loading {
    cursor: wait;
    opacity: 0.8;
}

/* Styles pour les liens sociaux dans la section contact */
.contact-social-links {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrer horizontalement les icônes */
    width: 100%;
}

/* Styles pour les liens sociaux et email */
.contact-info .animated-social-link {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 5px;
    overflow: hidden;
    background: transparent;
    margin-bottom: 20px;
    color: white;
}

/*--------------------------------------------------
 # 2.4 Messages de statut
--------------------------------------------------*/
/* Style du message de confirmation */
.form-success-message {
    background-color: rgba(72, 187, 120, 0.1);
    border-left: 4px solid var(--success-color, #48bb78);
    padding: 15px;
    border-radius: 0 4px 4px 0;
    margin: 20px 0;
    display: none;
}

.form-success-message.visible {
    display: block;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation du chargement lors de l'envoi */
.submit-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/*--------------------------------------------------
 # 4.1 Form Progress Bar
--------------------------------------------------*/
.form-progress-container {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0px; /* Minimal space with captcha */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.form-progress-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #4527a0, #7b1fa2, #bd28ba);
    background-size: 200% 100%;
    border-radius: 12px;
    width: 0;
    transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 12px rgba(189, 40, 186, 0.7);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.form-progress-bar.complete {
    background: linear-gradient(90deg, #43a047, #00c853, #43a047);
    background-size: 200% 100%;
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.6);
    animation: completeGradient 2s ease infinite;
}

@keyframes completeGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.form-progress-stats {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-top: 2px;
    margin-bottom: 0px; /* No margin with captcha */
    font-weight: 500; /* Slightly bolder text */
}

/*--------------------------------------------------
 # 4.2 Validation Indicators
--------------------------------------------------*/
.validation-icon {
    position: absolute;
    right: 15px;
    top: 40px; /* Adjusted to align with inputs */
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform: scale(0.5);
    color: #4CAF50;
    z-index: 2;
}

.form-group.error .validation-icon {
    color: #F44336;
    opacity: 1;
    transform: scale(1);
}

.form-group.valid .validation-icon {
    color: #4CAF50;
    opacity: 1;
    transform: scale(1);
}

/* Error tooltip */
.error-tooltip {
    position: absolute;
    right: 40px; /* Positioned to the right of the field */
    top: 40px; /* Aligned with the middle of the field */
    background-color: rgba(244, 67, 54, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 5; /* Increased z-index for visibility */
    pointer-events: none;
    max-width: none; /* Allow message to display in full */
    white-space: nowrap;
    overflow: visible; /* Ensure text isn't truncated */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.form-group.error .error-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/*--------------------------------------------------
 # 4.3 Status Animations
--------------------------------------------------*/
.form-status {
    transition: all 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translateY(20px);
    opacity: 0;
}

.form-status.success,
.form-status.error {
    transform: translateY(0);
    opacity: 1;
    animation: statusPulse 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes statusPulse {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/*--------------------------------------------------
 # 5. RESPONSIVE
--------------------------------------------------*/

/* Grand écran */
@media (max-width: 992px) {
    .contact-form-container {
        grid-template-columns: 1fr;
        display: block; /* Fallback pour la mise en page si grid ne fonctionne pas */
    }
    
    .contact-info {
        border-radius: 20px 20px 0 0;
    }
    
    .contact-hero .section-title h1 {
        font-size: 2.8rem;
    }
}

/* Tablette */
@media (max-width: 768px) {
    .form-group {
        flex: 1 0 100%;
    }
    
    .contact-form-section {
        padding: 140px 0 60px; /* Augmenté le padding top spécifiquement pour tablette */
    }
    
    .contact-hero {
        padding: 100px 0 60px;
    }
    
    .contact-hero .section-title h1 {
        font-size: 2.5rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .contact-form-section {
        padding: 130px 0 50px;
    }
    
    .contact-info,
    .form-container {
        padding: 30px 20px;
    }
    
    .contact-hero .section-title h1 {
        font-size: 2rem;
    }
    
    .contact-hero .section-title p {
        font-size: 1rem;
    }
}

.contact-info .animated-social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
}

.contact-info .icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 2;
    margin-right: 15px;
}

.contact-info .animated-social-link:hover .icon-container {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.contact-info .social-icon {
    width: 24px;
    height: 24px;
    fill: #fff;
    transition: all 0.3s ease;
}

.contact-info .animated-social-link:hover .social-icon {
    transform: scale(1.1); /* Lu00e9ger effet de grossissement au survol */
}

.contact-info .link-text {
    position: relative;
    opacity: 0;
    transform: translateX(20px) translateY(1px); /* Léger décalage pour centrer le texte */
    transition: all 0.3s ease 0.1s; /* Léger délai pour commencer après le déplacement de l'icône */
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.contact-info .animated-social-link:hover .link-text {
    opacity: 1;
    transform: translateX(0) translateY(1px); /* Maintenir le décalage sur l'axe Y */
}

/* Animation du texte dactylographié */
.contact-info .typing-content {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    transition: max-width 0.4s ease 0.2s; /* Démarrer après l'apparition du texte */
}

.contact-info .animated-social-link:hover .typing-content {
    max-width: 200px;
}

/* Animation effet lame lumineuse */
.contact-info .animated-social-link:after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: all 0.7s ease;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.contact-info .animated-social-link:hover:after {
    left: 130%;
    opacity: 0.8;
}

/* Status Messages */
.form-status {
    display: none;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.95rem;
    text-align: center;
}

.form-status.success {
    display: block;
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.form-status.error {
    display: block;
    background-color: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Message visibility control */
.form-status .success-message,
.form-status .error-message {
    display: none;
}

.form-status.success .success-message {
    display: block !important;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
}

.form-status.error .error-message {
    display: block !important;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    color: #c62828;
}

.form-status.success .error-message,
.form-status.error .success-message {
    display: none !important;
}

/* Fin des styles de contact */
