/* LA Tarot Académie - Styles CSS */

/* === RÉINITIALISATION GLOBALE DES STYLES === */
/* Réinitialise tous les éléments pour une cohérence cross-browser */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === VARIABLES CSS (COULEURS DE LA MARQUE) === */
/* Définition des couleurs principales utilisées dans toute l'application */
:root {
    --gold: #A68245;    /* Couleur dorée principale de la marque */
    --black: #0A0A0A;   /* Noir profond pour les fonds */
    --white: #FFFFFF;   /* Blanc pur pour les contrastes */
    --shadow: rgba(10, 10, 10, 0.3); /* Ombre standard */
}

/* === STYLES DE BASE DU BODY === */
/* Configuration générale de la page avec fond dégradé sombre */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #0A0A0A 100%);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* === SYSTÈME DE PARTICULES ANIMÉES === */
/* Container des particules dorées flottantes pour l'ambiance mystique */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;  /* Les particules ne bloquent pas les interactions */
    overflow: hidden;
    z-index: 1;            /* Derrière le contenu principal */
}

/* Style individuel de chaque particule */
.particle {
    position: absolute;
    background: var(--gold);
    border-radius: 50%;    /* Forme circulaire */
    opacity: 0;
    animation: floatUp 8s infinite;
}

/* Animation de flottement vers le haut des particules */
@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);  /* Départ du bas, invisible */
    }
    10% {
        opacity: 0.6;      /* Apparition progressive */
    }
    50% {
        opacity: 0.3;      /* Fade au milieu du parcours */
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1.5);  /* Disparition en haut */
    }
}

/* === CONTAINER PRINCIPAL DU CONTENU === */
/* Centre le contenu et le place au-dessus des particules */
.main-container {
    position: relative;
    z-index: 2;            /* Au-dessus des particules (z-index: 1) */
    max-width: 1200px;     /* Largeur maximale pour grands écrans */
    margin: 0 auto;        /* Centrage horizontal */
    padding: 20px;
}

/* === EN-TÊTE DE L'APPLICATION === */
/* Zone contenant le logo et le sous-titre avec fond dégradé subtil */
.header {
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(166, 130, 69, 0.1) 0%, transparent 100%);
    border-radius: 20px;
    margin-bottom: 40px;
}

/* Container pour le contenu du header */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

/* Logo de La Tarot Académie */
.academie-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(166, 130, 69, 0.3);
    background: white;
}

/* Container pour le texte du header */
.header-text {
    text-align: left;
}

/* Logo principal de La Tarot Académie */
.logo {
    font-family: 'Arial Black', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--gold);
    text-transform: uppercase;
    text-shadow: 2px 2px 4px var(--shadow);
    margin-bottom: 10px;
}

/* Sous-titre descriptif */
.subtitle {
    font-size: 1.2rem;
    color: var(--gold);
    opacity: 0.9;
    letter-spacing: 1px;
}

/* === SECTION D'INTRODUCTION === */
/* Zone explicative avec effet de glassmorphism */
.intro-section {
    background: rgba(255, 255, 255, 0.05);      /* Fond légèrement transparent */
    border: 1px solid rgba(166, 130, 69, 0.3);  /* Bordure dorée subtile */
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);                /* Effet de flou arrière-plan */
}

.intro-section h2 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.intro-section p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* === ZONE DE TIRAGE DES CARTES === */
/* Section contenant le bouton principal de tirage */
.draw-section {
    text-align: center;
    margin: 100px 0;  /* Augmenté de 50px à 100px pour plus d'espace */
    padding: 40px 0;  /* Ajout de padding pour encore plus de mise en valeur */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Bouton principal pour tirer une carte */
.draw-button {
    background: linear-gradient(135deg, #D4AF37 0%, var(--gold) 35%, #8B6914 70%, #6B5515 100%);
    color: var(--white);
    border: none;
    padding: 20px 50px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 50px;                        /* Bouton arrondi */
    cursor: pointer;
    transition: all 0.3s ease;                  /* Animation fluide au survol */
    box-shadow: 0 8px 25px rgba(166, 130, 69, 0.3),
                0 4px 10px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.draw-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(166, 130, 69, 0.5),
                0 6px 15px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.draw-button:active {
    transform: translateY(0);
}

/* État du bouton pendant le mélange des cartes */
.draw-button.shuffling {
    pointer-events: none;             /* Désactive le clic pendant l'animation */
    opacity: 0.9;
}

/* Étoile qui tourne pendant le chargement */
.spinning-star {
    display: inline-block;
    font-size: 2.5rem;
    animation: spin 1s linear infinite;
}

/* Animation de rotation pour l'étoile */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation de pulsation (désactivée mais gardée si besoin) */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }   /* Léger grossissement */
}

/* === MINIATURE DE LA CARTE SAUVEGARDÉE === */
.saved-card-thumbnail {
    display: none;  /* Caché par défaut */
    width: 240px;   /* Doublé de 120px */
    height: 360px;  /* Doublé de 180px */
    border-radius: 15px;
    overflow: visible;  /* Changé pour permettre au bouton de déborder */
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(166, 130, 69, 0.4);
    border: 3px solid var(--gold);
    margin-top: 40px;  /* Plus d'espace pour le bouton */
}

.saved-card-thumbnail.visible {
    display: block;
}

.saved-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;  /* Arrondi pour correspondre au conteneur */
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(166, 130, 69, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.saved-card-thumbnail:hover .thumbnail-overlay {
    background: rgba(166, 130, 69, 0.8);
    opacity: 1;
}

.thumbnail-overlay span {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

.saved-card-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(166, 130, 69, 0.6);
}

/* Bouton de suppression de la carte */
.delete-card-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: var(--gold);
    color: var(--black);
    border: 3px solid white;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(166, 130, 69, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.delete-card-btn:hover {
    background: var(--black);
    color: var(--gold);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 15px rgba(166, 130, 69, 0.7);
    border-color: var(--gold);
}

/* === OVERLAY TIRAGES SAUVEGARDÉS === */
.saved-draws-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9998;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.saved-draws-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.saved-draws-container {
    background: linear-gradient(135deg, #1a1a1a 0%, var(--black) 100%);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.saved-draws-container h2 {
    color: var(--gold);
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

.saved-draws-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.saved-card-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gold);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.saved-card-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(166, 130, 69, 0.3);
}

.saved-card-item img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
}

.saved-card-name {
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 5px;
}

.saved-card-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.saved-draws-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold);
    color: var(--black);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.saved-draws-close:hover {
    background: var(--white);
    transform: rotate(90deg);
}

.clear-history-button {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.clear-history-button:hover {
    background: #ff6b6b;
    color: white;
}

.no-draws-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 40px;
}

/* === POPUP DE CONFIRMATION === */
.confirm-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.confirm-popup.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.confirm-popup-content {
    background: linear-gradient(135deg, #1a1a1a 0%, var(--black) 100%);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.confirm-popup-content h3 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.confirm-popup-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    line-height: 1.6;
}

.confirm-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-button {
    padding: 12px 30px;
    border-radius: 25px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-yes {
    background: #ff6b6b;
    color: white;
}

.confirm-yes:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.confirm-no {
    background: var(--gold);
    color: var(--black);
}

.confirm-no:hover {
    background: #D4AF37;
    transform: scale(1.05);
}

/* === OVERLAY MODAL POUR L'AFFICHAGE DE LA CARTE === */
/* Fond semi-transparent qui couvre toute la page lors de l'affichage d'une carte */
.card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);   /* Fond noir semi-transparent */
    display: none;                      /* Caché par défaut */
    justify-content: center;
    align-items: center;
    z-index: 9999;                      /* Au-dessus de tout */
    backdrop-filter: blur(5px);         /* Flou de l'arrière-plan */
    padding: 20px;
}

/* Container pour la carte et les boutons */
.card-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.card-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Container de la carte avec perspective 3D */
.card-container {
    position: relative;
    width: 300px;
    height: 500px;
    perspective: 1000px;       /* Active la perspective 3D */
}

/* Élément qui effectue la rotation 3D */
.card-flip {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;  /* Préserve l'effet 3D des enfants */
    transition: transform 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);  /* Animation avec rebond */
}

/* État retourné de la carte */
.card-flip.flipped {
    transform: rotateY(180deg);    /* Rotation complète sur l'axe Y */
}

/* Styles communs aux deux faces de la carte */
.card-face, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;   /* Cache la face non visible */
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* Face arrière de la carte (dos doré) */
.card-back {
    background: linear-gradient(135deg, var(--gold) 0%, #5C4A1F 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--gold);
}

/* Symbole décoratif sur le dos de la carte */
.card-back::before {
    content: "✦";
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Face avant de la carte (contenu révélé) */
.card-face {
    transform: rotateY(180deg);     /* Déjà retournée pour être visible après flip */
    background: var(--white);
    color: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 3px solid var(--gold);
    overflow: hidden;
}

/* Image de la carte de tarot */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;        /* Maintient les proportions de l'image */
    border-radius: 12px;
}

/* Placeholder affiché si l'image ne charge pas */
.card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.card-symbol {
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.card-number {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold);
}

.card-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--black);
    text-align: center;
    margin-bottom: 10px;
}

.card-keywords {
    font-size: 1rem;
    color: #666;
    text-align: center;
    font-style: italic;
    padding: 0 15px;
}

/* Ancien bouton de fermeture - caché maintenant */
.close-button {
    display: none;  /* On utilise maintenant le nouveau bouton en bas */
}

/* Animation du bouton de fermeture au survol */
.close-button:hover {
    background: var(--white);
    color: var(--gold);
    transform: rotate(90deg);   /* Rotation de 90 degrés au survol */
}

/* === NOUVELLE DISPOSITION DE LA CARTE AVEC BOUTONS === */
/* Container principal pour l'affichage de la carte */
.card-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
}

/* Zone des boutons d'action sous la carte */
.card-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

/* Style commun pour les boutons d'action */
.card-action-button {
    background: linear-gradient(135deg, var(--gold), #8B6914);
    color: var(--white);
    border: 2px solid var(--gold);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(166, 130, 69, 0.3);
}

.card-action-button:hover {
    background: var(--white);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(166, 130, 69, 0.5);
}

.card-action-button span {
    font-size: 1.3rem;
}

/* Bouton pour afficher les informations */
.info-button {
    background: linear-gradient(135deg, #4A5568, #2D3748);
    border-color: #4A5568;
}

.info-button:hover {
    background: var(--white);
    color: #4A5568;
}

/* Nouveau style pour le bouton de fermeture */
.close-button-new {
    background: linear-gradient(135deg, #4B3621, #6B4E31);
    border-color: #6B4E31;
    color: var(--gold);
}

.close-button-new:hover {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
}

/* Panneau d'information de la carte */
.card-info-panel {
    display: none;
    position: fixed;  /* Changé de absolute à fixed pour meilleur positionnement mobile */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.98);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 50px 30px 30px;  /* Plus d'espace en haut pour le bouton fermer */
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;  /* Scroll fluide sur iOS */
    z-index: 10001;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Barre de défilement personnalisée */
.card-info-panel::-webkit-scrollbar {
    width: 6px;
}

.card-info-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.card-info-panel::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
    opacity: 0.6;
}

.card-info-panel::-webkit-scrollbar-thumb:hover {
    opacity: 0.8;
}

/* Bouton de fermeture pour le panneau d'information */
.card-info-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #4B3621, #6B4E31);
    border: 2px solid #6B4E31;
    color: var(--gold);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
}

.card-info-close:hover {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
    transform: scale(1.1);
}

.card-info-panel.active {
    display: block;
}

.card-info-content {
    color: var(--white);
}

.card-info-content h3 {
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 20px;
    margin-top: 0;  /* Assure que le titre commence en haut */
    text-align: center;
    padding-right: 10px;  /* Évite le chevauchement avec le bouton X */
}

.card-info-content .keywords {
    color: var(--gold);
    font-style: italic;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
    padding: 0 10px;  /* Espace latéral pour meilleure lecture */
}

.card-info-content .description {
    line-height: 1.8;
    font-size: 1rem;
    color: var(--white);
    text-align: justify;  /* Texte justifié pour meilleure lecture */
    padding: 0 5px;  /* Léger padding latéral */
}

/* === SECTION PROMOTIONNELLE POUR LA FORMATION === */
/* Zone de promotion de la formation en Psycho-Tarot */
.promo-section {
    background: linear-gradient(135deg, rgba(166, 130, 69, 0.2) 0%, rgba(166, 130, 69, 0.05) 100%);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 40px;
    padding-bottom: 60px;  /* Plus d'espace en bas pour le logo IPHM */
    margin-top: 60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.promo-section h2 {
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 20px;
}

.promo-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

/* Style pour l'info de certification IPHM */
.certification-info {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--gold);
    opacity: 0.9;
    margin-bottom: 25px;
}

/* Style pour l'info d'inscription */
.inscription-info {
    margin-top: 30px;
    font-size: 1.15rem;
}

.inscription-info strong {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(166, 130, 69, 0.3);
}

/* Bouton d'appel à l'action (CTA) pour la formation */
.cta-button {
    background: var(--gold);
    color: var(--black);
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;      /* Supprime le soulignement du lien */
    display: inline-block;
}

/* État survol du bouton CTA */
.cta-button:hover {
    background: var(--white);
    transform: translateY(-3px);   /* Léger soulèvement */
    box-shadow: 0 10px 30px rgba(166, 130, 69, 0.5);
}

/* === LOGO IPHM === */
/* Container et style pour le logo de certification */
.iphm-logo-container {
    margin-top: 40px;  /* Changé de position absolute à margin pour éviter le chevauchement */
    opacity: 0.9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Texte "En savoir plus" à gauche du logo */
.iphm-text {
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 600;
    opacity: 0.8;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.iphm-logo-container:hover .iphm-text {
    opacity: 1;
    text-decoration: underline;
}

.iphm-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.iphm-logo:hover {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 6px 15px rgba(166, 130, 69, 0.4);
}

/* === POPUP IPHM === */
/* Popup pour les informations de certification */
.iphm-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.iphm-popup.active {
    display: flex;
}

.iphm-popup-content {
    background: linear-gradient(135deg, #1a1a1a 0%, var(--black) 100%);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(166, 130, 69, 0.3);
}

.iphm-popup-content h3 {
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.iphm-popup-text {
    color: var(--white);
    line-height: 1.8;
    font-size: 1rem;
}

.iphm-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold);
    color: var(--black);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.iphm-popup-close:hover {
    background: var(--white);
    transform: rotate(90deg);
}

/* Logo IPHM dans la popup */
.iphm-popup-logo {
    text-align: center;
    margin-bottom: 20px;
}

.iphm-popup-logo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(166, 130, 69, 0.3);
}

/* Lien vers le site IPHM */
.iphm-website-link {
    text-align: center;
    margin-top: 30px;
}

.iphm-link {
    color: var(--gold);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 10px 25px;
    border: 2px solid var(--gold);
    border-radius: 25px;
    display: inline-block;
    transition: all 0.3s ease;
}

.iphm-link:hover {
    background: var(--gold);
    color: var(--black);
    box-shadow: 0 5px 20px rgba(166, 130, 69, 0.4);
}

/* === FOOTER === */
.footer {
    margin-top: 80px;
    padding: 40px 20px 20px;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(10, 10, 10, 0.95) 100%);
    border-top: 2px solid var(--gold);
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo-img {
    width: 80px;
    height: 80px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-logo-img:hover {
    opacity: 1;
}

.footer-text {
    margin-bottom: 25px;
}

.footer-title {
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.footer-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-style: italic;
}

.footer-links {
    margin-bottom: 30px;
}

.footer-link {
    color: var(--gold);
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 15px;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-link:hover {
    color: var(--white);
    transform: translateY(-2px);
}

.footer-separator {
    color: rgba(166, 130, 69, 0.5);
    margin: 0 10px;
    font-size: 1.2rem;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(166, 130, 69, 0.2);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 5px 0;
}

.footer-credit {
    color: rgba(166, 130, 69, 0.7);
    font-size: 0.8rem;
    margin-top: 10px;
}

/* === STYLES RESPONSIVE POUR MOBILES ET TABLETTES === */
/* Adaptations pour écrans de moins de 768px de large */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;  /* Logo au-dessus du texte sur mobile */
        gap: 20px;
    }

    .header-text {
        text-align: center;      /* Centre le texte sur mobile */
    }

    .academie-logo {
        width: 100px;            /* Logo plus petit sur mobile */
        height: 100px;
    }

    .logo {
        font-size: 1.8rem;        /* Réduit la taille du logo */
        letter-spacing: 1px;     /* Réduit l'espacement des lettres */
    }

    .subtitle {
        font-size: 0.9rem;        /* Réduit la taille du sous-titre */
    }

    .intro-section {
        padding: 20px 15px;      /* Moins de padding sur mobile */
    }

    .intro-section h2 {
        font-size: 1.4rem;       /* Titre plus petit */
    }

    .intro-section p {
        font-size: 0.95rem;      /* Texte légèrement plus petit */
    }

    .draw-section {
        margin: 50px 0;          /* Moins d'espace vertical */
        padding: 20px 0;
    }

    .draw-button {
        padding: 15px 30px;      /* Bouton plus petit */
        font-size: 1rem;
        letter-spacing: 1px;
    }

    /* Miniature de carte */
    .saved-card-thumbnail {
        width: 160px;            /* Plus petite sur mobile */
        height: 240px;
        margin-top: 30px;
    }

    .delete-card-btn {
        width: 30px;             /* Bouton de suppression plus petit */
        height: 30px;
        font-size: 18px;
        top: -10px;
        right: -10px;
    }

    /* Carte dans l'overlay */
    .card-container {
        width: 240px;            /* Carte plus petite sur mobile */
        height: 380px;
    }

    /* Boutons d'action sous la carte */
    .card-actions {
        flex-direction: column;  /* Boutons en colonne sur mobile */
        gap: 10px;
        width: 100%;
        padding: 0 20px;
    }

    .card-action-button {
        width: 100%;             /* Boutons pleine largeur */
        padding: 10px 20px;
        font-size: 1rem;
    }

    /* Panneau d'information */
    .card-info-panel {
        width: 92%;              /* Largeur fixe pour mobile */
        max-width: none;          /* Supprime la limite max-width */
        left: 4%;                 /* Centre avec margins égales */
        right: 4%;
        transform: translateY(-50%);  /* Seulement translation Y */
        padding: 45px 15px 20px;  /* Padding adapté : plus en haut pour le bouton X */
        max-height: 90vh;         /* Plus d'espace vertical */
        border-radius: 15px;      /* Coins moins arrondis sur mobile */
    }

    /* Bouton de fermeture sur mobile */
    .card-info-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .card-info-content h3 {
        font-size: 1.3rem;       /* Titre légèrement plus petit */
        margin-bottom: 15px;
        padding: 0 25px 0 5px;   /* Espace pour le bouton X à droite */
        line-height: 1.2;
    }

    .card-info-content .keywords {
        font-size: 0.9rem;        /* Mots-clés plus petits */
        margin-bottom: 15px;
        line-height: 1.4;
    }

    .card-info-content .description {
        font-size: 0.85rem;       /* Texte légèrement plus petit pour mobile */
        line-height: 1.6;         /* Meilleur espacement des lignes */
        text-align: left;         /* Aligné à gauche sur mobile (plus lisible) */
        padding: 0 3px;
    }

    /* Section promotionnelle */
    .promo-section {
        padding: 30px 20px;      /* Moins de padding */
        margin-top: 40px;
    }

    .promo-section h2 {
        font-size: 1.5rem;       /* Titre plus petit */
        line-height: 1.3;
    }

    .promo-section p {
        font-size: 0.95rem;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }

    /* Logo IPHM sur mobile */
    .iphm-logo-container {
        position: relative;      /* Pas absolute sur mobile */
        margin-top: 30px;
        flex-direction: column;  /* Texte au-dessus du logo */
        gap: 10px;
    }

    .iphm-logo {
        width: 60px;             /* Logo IPHM plus petit */
        height: 60px;
    }

    .iphm-text {
        font-size: 0.85rem;
    }

    /* Footer */
    .footer {
        padding: 30px 15px 15px;
        margin-top: 50px;
    }

    .footer-logo-img {
        width: 60px;
        height: 60px;
    }

    .footer-title {
        font-size: 1.2rem;
    }

    .footer-subtitle {
        font-size: 0.8rem;
    }

    .footer-link {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    /* Popups */
    .confirm-popup-content,
    .iphm-popup-content {
        padding: 20px;
        width: 95%;
    }

    .confirm-popup-content h3,
    .iphm-popup-content h3 {
        font-size: 1.3rem;
    }

    .confirm-popup-content p,
    .iphm-popup-text {
        font-size: 0.9rem;
    }
}

/* Styles pour très petits écrans (moins de 380px) */
@media (max-width: 380px) {
    .logo {
        font-size: 1.5rem;       /* Encore plus petit */
    }

    .card-container {
        width: 200px;            /* Carte encore plus petite */
        height: 320px;
    }

    .saved-card-thumbnail {
        width: 140px;
        height: 210px;
    }

    /* Panneau d'information sur très petits écrans */
    .card-info-panel {
        width: 94%;
        left: 3%;
        right: 3%;
        padding: 40px 12px 15px;
    }

    .card-info-content h3 {
        font-size: 1.2rem;
        padding-right: 30px;     /* Plus d'espace pour éviter le bouton X */
    }

    .card-info-content .keywords {
        font-size: 0.85rem;
    }

    .card-info-content .description {
        font-size: 0.82rem;
    }
}