/* Protection parentale - Modal */
.parental-protection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.parental-protection-overlay.active {
    display: flex;
    opacity: 1;
}

.parental-protection-modal {
    background-color: var(--page-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    border: 3px solid var(--primary-color);
}

.parental-protection-overlay.active .parental-protection-modal {
    transform: scale(1);
}

.parental-protection-header {
    margin-bottom: 25px;
}

.parental-protection-header h2 {
    color: var(--primary-color);
    font-size: 1.5em;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.parental-protection-header .icon {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.parental-protection-description {
    color: var(--text-color);
    font-size: 1em;
    margin-bottom: 25px;
    line-height: 1.4;
}

.parental-protection-question {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.parental-protection-input {
    width: 100%;
    max-width: 180px;
    padding: 15px;
    font-size: 1.2em;
    text-align: center;
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    margin-bottom: 20px;
    background-color: white;
    color: var(--text-color);
    font-weight: bold;
}

.parental-protection-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.parental-protection-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.parental-protection-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.parental-protection-btn.verify {
    background-color: var(--primary-color);
    color: white;
}

.parental-protection-btn.verify:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.parental-protection-btn.cancel {
    background-color: #e74c3c;
    color: white;
}

.parental-protection-btn.cancel:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.parental-protection-error {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 10px;
    font-weight: bold;
    display: none;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.parental-protection-error.show {
    display: block;
    animation: shake 0.5s ease-in-out;
}

/* Style pour les messages de succès (réutilise le même élément) */
.parental-protection-error.success {
    background-color: rgba(39, 174, 96, 0.1);
    border: 1px solid #27ae60;
    color: #27ae60;
}

.parental-protection-error.error {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

/* Animation de secousse pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Styles responsifs */
@media (max-width: 480px) {
    .parental-protection-modal {
        padding: 20px;
        margin: 20px;
    }
    
    .parental-protection-header h2 {
        font-size: 1.3em;
    }
    
    .parental-protection-question {
        font-size: 1.1em;
        padding: 15px;
    }
    
    .parental-protection-input {
        max-width: 180px;
        padding: 12px;
        font-size: 1.1em;
    }
    
    .parental-protection-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .parental-protection-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Animation d'entrée */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.parental-protection-modal.entering {
    animation: fadeInScale 0.3s ease-out;
}

/* Accessibilité : texte uniquement pour lecteurs d'écran */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    overflow: hidden; white-space: nowrap;
  }

  .parental-protection-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }

/* Image mascotte dans l'en-tête */
.parental-protection-header .icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px; /* garde l'espacement existant */
    min-height: 128px;   /* réserve la place pour éviter le CLS */
  }
  
  /* L'image est masquée tant qu'elle n'est pas chargée ; le bouclier reste visible */
  .parental-protection-mascotte {
    display: none;
    width: 128px;
    height: 128px;       /* cohérent avec les attributs HTML */
    object-fit: contain; /* au cas où l'image ne soit pas parfaitement carrée */
  }
  
  /* Quand l'image est chargée, on cache l'icône bouclier */
  .parental-protection-header .icon.has-image i {
    display: none;
  }
  
  /* Ajustement mobile */
  @media (max-width: 480px) {
    .parental-protection-header .icon { min-height: 96px; }
    .parental-protection-mascotte { width: 96px; height: 96px; }
  }
