/* Mobile Responsive Styles for PocketQuizz */

@media (max-width: 768px) {
    /* Questions en texte blanc sur mobile avec taille fixe */
    .question-text {
        color: white;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
        font-weight: 700;
        margin-bottom: 2rem;
        font-size: 1.8rem !important;
    }
    
    /* Suppression de la barre sous les questions */
    .question-text::after {
        display: none;
    }
    
    /* Nouveau background pour answers-section avec positionnement dynamique */
    .answers-section {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.5) 80%, transparent 100%) !important;
        backdrop-filter: none !important;
        padding: 1rem !important;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        min-height: 40vh;
        max-height: 70vh;
        overflow-y: auto;
        /* Positionnement dynamique basé sur le contenu */
        top: auto;
    }
    
    /* Calcul dynamique de la hauteur basé sur la question */
    .question-slide[data-question-type="text"] .answers-section {
        min-height: 35vh;
        padding-bottom: 1rem !important; /* Espacement minimal pour les textarea */
    }
    
    .question-slide[data-question-type="multiple"] .answers-section {
        min-height: 45vh;
        padding-bottom: 80px !important; /* Espace pour le bouton fixe */
        justify-content: flex-start !important; /* Ancrer le contenu en haut */
        align-items: flex-start !important; /* Aligner le contenu en haut */
        padding-top: 2rem !important; /* Espacement en haut */
    }
    
    .question-slide[data-question-type="single"] .answers-section {
        min-height: 40vh;
        padding-bottom: 1rem !important; /* Espacement réduit pour les choix uniques */
    }
    
    .question-slide[data-question-type="dual"] .answers-section {
        min-height: 40vh;
        padding-bottom: 1rem !important; /* Espacement minimal pour les choix duaux */
    }
    
    .question-slide[data-question-type="slider"] .answers-section {
        min-height: 35vh;
        padding-bottom: 80px !important; /* Espace pour le bouton fixe */
    }
    
    /* Ajustement du contenu des réponses */
    .answers-content {
        max-width: 100%;
        margin: 0;
    }
    
    /* Ajustement spécifique du contenu pour les choix multiples */
    .question-slide[data-question-type="multiple"] .answers-content {
        width: 100%;
        margin-top: 0 !important;
    }
    
    /* Espacement réduit pour les choix multiples */
    .answers-grid {
        margin-bottom: 1rem !important; /* Espacement réduit entre les cartes et le bouton */
    }
    
    /* Styles pour les textarea sur mobile */
    .text-input-wrapper {
        position: relative;
        margin-bottom: 1rem;
    }
    
    .text-input {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: #333;
        font-size: 16px; /* Évite le zoom sur iOS */
        padding: 1rem;
        padding-right: 60px; /* Espace pour le bouton */
        border-radius: 12px;
        transition: all 0.3s ease;
        min-height: 50px;
        resize: none; /* Empêche le redimensionnement manuel */
        line-height: 1.4;
        /* Alignement en haut par défaut pour tous les textarea */
        vertical-align: top;
        padding-top: 1rem;
    }
    
    .text-input:focus {
       /* min-height: 120px; */
        background: rgba(255, 255, 255, 1);
        border-color: var(--primary-color);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        vertical-align: top;
        padding-top: 1rem;
    }
    
    .text-input.multiline {
       /* min-height: 55px; */
    }
    
    .text-input.multiline:focus {
       /* min-height: 150px; */
    }
    
    .text-input::placeholder {
        color: #666;
    }
    
    /* Masquer le bouton next original sur mobile pour les inputs text */
    .text-input-wrapper ~ .next-btn {
        display: none !important;
    }

    /* Bouton intégré dans le textarea */
    .text-input-wrapper .next-btn {
        position: absolute;
        right: 8px;
        bottom: 8px;
        width: 40px;
        height: 40px;
        background: var(--primary-color);
        border: none;
        border-radius: 50%;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transform: scale(0.8);
        transition: all 0.3s ease;
        z-index: 10;
    }

    .text-input-wrapper .next-btn:not([disabled]) {
        opacity: 1;
        transform: scale(1);
    }

    .text-input-wrapper .next-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Styles pour email-sms sur mobile */
    .email-sms-wrapper {
        position: relative;
        margin-bottom: 1rem;
    }

    .email-sms-field {
        margin-bottom: 1rem;
    }

    .email-input,
    .phone-input {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: #333;
        font-size: 16px;
        padding: 1rem;
        border-radius: 12px;
    }

    .email-input:focus,
    .phone-input:focus {
        background: rgba(255, 255, 255, 1);
        border-color: var(--primary-color);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .email-input.invalid,
    .phone-input.invalid {
        border-color: #ff4444 !important;
        background: rgba(255, 68, 68, 0.05);
    }

    .phone-input-group {
        display: flex;
        gap: 0.5rem;
    }

    .country-code-wrapper {
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        padding: 1rem 0.75rem;
        min-width: 90px;
    }

    .country-code-wrapper:focus-within {
        background: rgba(255, 255, 255, 1);
        border-color: var(--primary-color);
    }

    .plus-prefix {
        font-size: 16px;
        color: #333;
        font-weight: 500;
        margin-right: 2px;
    }

    .country-code-input {
        background: transparent !important;
        border: none;
        outline: none;
        font-size: 16px;
        color: #333;
        font-weight: 500;
        width: 40px;
        padding: 0;
    }

    .phone-input {
        flex: 1;
    }

    /* Masquer le bouton next original pour email-sms */
    .email-sms-wrapper ~ .next-btn {
        display: none !important;
    }

    /* Bouton pour email-sms - toujours visible en bas */
    .mobile-email-sms-btn {
        position: fixed !important;
        bottom: 1rem !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        height: 56px !important;
        border-radius: 28px !important;
        background: var(--primary-color) !important;
        color: white !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
        z-index: 1000 !important;
        transition: all 0.3s ease !important;
        border: none !important;
    }

    .mobile-email-sms-btn:disabled {
        background: rgba(255, 255, 255, 0.3) !important;
        color: rgba(255, 255, 255, 0.6) !important;
        cursor: not-allowed !important;
    }

    .mobile-email-sms-btn:not([disabled]) {
        opacity: 1 !important;
    }

    /* Ajustement des sections pour email-sms */
    .question-slide[data-question-type="email-sms"] .answers-section {
        min-height: 45vh;
        padding-bottom: 80px !important;
    }
    
    /* Masquer les boutons next originaux pour les autres types */
    .answers-grid ~ .next-btn,
    .dual-choice ~ .next-btn,
    .slider-wrapper ~ .next-btn {
        display: none !important;
    }
    
    /* Bouton pour les choix multiples et sliders - full width en bas */
    .mobile-fullwidth-btn {
        position: fixed !important;
        bottom: 1rem !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        height: 56px !important;
        border-radius: 28px !important;
        background: var(--primary-color) !important;
        color: white !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
        z-index: 1000 !important;
        transition: all 0.3s ease !important;
        border: none !important;
    }
    
    .mobile-fullwidth-btn:disabled {
        background: rgba(255, 255, 255, 0.3) !important;
        color: rgba(255, 255, 255, 0.6) !important;
        transform: translateY(100px) !important;
        opacity: 0 !important;
    }
    
    .mobile-fullwidth-btn:not([disabled]) {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
    
    /* Ajustement des boutons de réponse */
    .answer-btn {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: #333;
        padding: 1rem;
        border-radius: 12px;
        font-size: 16px;
    }
    
    .answer-btn:hover,
    .answer-btn.selected {
        background: rgba(255, 255, 255, 1);
        border-color: var(--primary-color);
        color: #333;
    }
    
    .answer-text {
        color: #333;
        font-size: 16px;
    }
    
    /* Styles pour les choix duaux */
    .dual-btn {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: #333;
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .dual-btn:hover,
    .dual-btn.selected {
        background: rgba(255, 255, 255, 1);
        border-color: var(--primary-color);
    }
    
    .dual-text {
        color: #333;
        font-size: 16px;
    }
    
    /* Ajustement du slider */
    .slider-wrapper {
        background: rgba(255, 255, 255, 0.95);
        padding: 1.5rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .slider-labels {
        color: #666;
        font-size: 14px;
        margin-bottom: 0 !important; /* Suppression du margin-bottom */
    }
    
    .slider-value {
        color: #333;
        font-weight: 600;
        font-size: 18px;
    }
}

/* Styles spécifiques pour très petits écrans */
@media (max-width: 480px) {
    .question-text {
        font-size: 1.8rem !important; /* Maintien de la même taille sur très petits écrans */
    }
    
    .answers-section {
        padding: 0.75rem !important;
        max-height: 75vh;
    }
    
    /* Ajustement spécifique du padding-bottom pour très petits écrans */
    .question-slide[data-question-type="text"] .answers-section {
        padding-bottom: 0.75rem !important;
    }
    
    .question-slide[data-question-type="multiple"] .answers-section,
    .question-slide[data-question-type="slider"] .answers-section {
        padding-bottom: 80px !important;
    }
    
    .question-slide[data-question-type="single"] .answers-section,
    .question-slide[data-question-type="dual"] .answers-section {
        padding-bottom: 0.75rem !important;
    }
    
    .answers-grid {
        margin-bottom: 0.75rem !important;
    }
    
    .text-input {
        font-size: 16px;
        padding: 0.875rem;
        padding-right: 55px;
        padding-top: 0.875rem;
    }
    
    .text-input:focus {
        padding-top: 0.875rem;
    }
    
    .answer-btn {
        padding: 0.3rem;
    }
    .dual-btn {
        padding: 0.7rem;
    }
    
    .slider-wrapper {
        padding: 1.25rem;
    }
    
    .mobile-fullwidth-btn {
        bottom: 0.75rem !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        height: 52px !important;
        font-size: 15px !important;
    }
}
@media (max-width: 768px) {
    /* Adaptation du start-prompt pour correspondre au style answers-section */
    .start-prompt {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.5) 80%, transparent 100%) !important;
        backdrop-filter: none !important;
        padding: 1rem !important;
        min-height: 25vh !important;
        max-height: 40vh !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .start-prompt-content {
        margin-bottom: 2rem !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .start-prompt-content h2 {
        color: white !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7) !important;
        font-weight: 700 !important;
        font-size: 1.8rem !important;
        margin: 0 !important;
        padding: 0 !important;
        background: none !important;
        border-radius: 0 !important;
        backdrop-filter: none !important;
    }
}

@media (max-width: 480px) {
    /* Ajustement du start-prompt pour très petits écrans */
    .start-prompt {
        min-height: 20vh !important;
        max-height: 35vh !important;
        padding: 0.75rem !important;
    }
    
    .start-prompt-content h2 {
        font-size: 1.6rem !important;
    }
}

/* Ajout dans custom-mobile.css */

@media (max-width: 768px) {
    /* Positionnement des sous-titres au-dessus de answers-section */
    .subtitles-container {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important; /* Centre horizontal ET vertical */
        width: 95% !important;
        max-width: none !important;
        z-index: 15 !important;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
        height:52px;
    }
    
 
    /* Position spéciale pour les sous-titres avec le texte blanc visible */
    .question-slide.active .subtitles-container {

        bottom: 0;
        z-index:9999; 
    }
    
    /* Style des sous-titres sur mobile avec fond plus visible */
    .subtitle-text {
        background: rgba(0, 0, 0, 0.9) !important; /* Plus opaque */
        color: white;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.3;
        padding: 10px 16px;
        border-radius: 8px;
        text-align: center;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        display: inline-block; /* Pour que le background s'adapte au texte */
    }
    
    @keyframes subtitleFadeIn {
        from {
            transform: translateY(10px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    /* Animation d'apparition des sous-titres */
    .subtitles-container.active {
        opacity: 1 !important;
    }
    

}

/* Styles spécifiques pour très petits écrans */
@media (max-width: 480px) {
    .subtitles-container {
        width: 95% !important;
    }
    
    .subtitle-text {
        font-size: 13px;
        padding: 8px 14px;
    }
    
   
    
}