/* Import des polices Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Julius+Sans+One&family=Didact+Gothic&display=swap');

/* Conteneur principal */
.tarot-card-draw-container {
    width: 100%;
    margin: 0 auto;
    font-family: 'Didact Gothic', sans-serif;
    min-height: 400px;
}

/* Titres */
.tarot-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #a2844a;
    font-weight: 400;
    font-family: 'Julius Sans One', sans-serif;
    letter-spacing: 1px;
}

.tarot-subtitle {
    text-align: center;
    font-size: 1.5em;
    color: #666666;
    margin-bottom: 40px;
    font-family: 'Didact Gothic', sans-serif;
}

/* Étapes */
.tarot-step {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.tarot-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grille de cartes - Configuration définie en JS selon device */
.tarot-cards-grid {
    max-width: 1400px;
    margin: 0 auto;
}

/* Rangées de cartes (pour mode éventail desktop) */
.tarot-card-row {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

/* Wrapper pour les cartes dans une rangée (éventail) */
.tarot-cards-wrapper {
    position: relative;
    display: block;
}

/* Cartes - Desktop (éventail) par défaut */
.tarot-card {
    width: 115px;
    height: 172px;
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.tarot-card:hover {
    transform: translateY(-20px) scale(1.15);
    z-index: 100 !important;
}

.tarot-card.selected {
    pointer-events: none;
}

/* Inner card (pour flip) */
.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.tarot-card.flipped .tarot-card-inner {
    transform: rotateY(180deg);
}

.tarot-card-back,
.tarot-card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(65, 87, 126, 0.3);
}

.tarot-card-back {
    background: linear-gradient(135deg, #41577e 0%, #a2844a 100%);
}

.tarot-card-front {
    transform: rotateY(180deg);
    background: white;
}

.tarot-card-back img,
.tarot-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Données cachées d'interprétation */
.tarot-card-interpretation-data {
    display: none;
}

/* Carte révélée */
.tarot-reveal-container {
    max-width: 1200px;
    margin: 40px auto;
    display: flex;
    gap: 50px;
    align-items: flex-start;
    justify-content: center;
    animation: revealCard 1s ease-out;
}

.tarot-revealed-card {
    text-align: center;
    flex-shrink: 0;
}

@keyframes revealCard {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tarot-revealed-card img {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(65, 87, 126, 0.4);
    margin-bottom: 20px;
}

.tarot-revealed-card h3 {
    font-size: 2em;
    color: #41577e;
    margin: 0;
    font-family: 'Julius Sans One', sans-serif;
    letter-spacing: 1px;
    max-width: 350px;
}

/* Interprétation */
.tarot-interpretation-content {
    flex: 1;
    max-width: 700px;
    background: #fff;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0px 2px 18px 0px rgba(0, 0, 0, 0.3);
    border: 2px solid #a2844a;
}

.tarot-interpretation-text {
    color: #666666;
    font-size: 18px;
    line-height: 1.8;
    font-family: 'Didact Gothic', sans-serif;
}

.tarot-interpretation-text h1,
.tarot-interpretation-text h2,
.tarot-interpretation-text h3 {
    color: #41577e;
    font-family: 'Julius Sans One', sans-serif;
    margin-top: 0;
}

.tarot-interpretation-text h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    border-bottom: 2px solid #a2844a;
    padding-bottom: 10px;
}

.tarot-interpretation-text h3 {
    font-size: 1.4em;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #a2844a;
}

.tarot-interpretation-text p:last-child {
    margin-bottom: 0;
}

.tarot-interpretation-text p:empty {
    display: none;
}

.tarot-interpretation-text ul,
.tarot-interpretation-text ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.tarot-interpretation-text li {
    margin-bottom: 10px;
}

.tarot-interpretation-text strong {
    color: #41577e;
    font-weight: 600;
}

.tarot-interpretation-text em {
    color: #a2844a;
}

/* Formulaire */
.tarot-form {
    max-width: 500px;
    margin: 30px auto 0;
    background: #fff;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0px 2px 18px 0px rgba(0, 0, 0, 0.3);
    border: 2px solid #a2844a;
}

/* Consentement opt-in */
.tarot-consent-container {
    max-width: 900px;
    margin: 30px auto 0;
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.tarot-selected-card-preview {
    text-align: center;
    animation: cardAppear 0.8s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tarot-selected-card-preview img {
    width: 250px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(65, 87, 126, 0.4);
    transition: transform 0.3s ease;
}

.tarot-selected-card-preview img:hover {
    transform: scale(1.05);
}

.tarot-card-preview-label {
    margin-top: 15px;
    font-size: 1.2em;
    color: #41577e;
    font-weight: 600;
    font-family: 'Julius Sans One', sans-serif;
}

.tarot-consent-box {
    flex: 1;
    min-width: 400px;
    max-width: 500px;
    background: #fff;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0px 2px 18px 0px rgba(0, 0, 0, 0.3);
    border: 2px solid #a2844a;
}

.tarot-consent-text {
    font-size: 20px;
    color: #666666;
    line-height: 1.6;
    margin-bottom: 30px !important;
    text-align: center;
}

.tarot-consent-text strong {
    color: #41577e;
    font-weight: 600;
}

.tarot-consent-checkbox {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(198, 212, 238, 0.2);
    border-radius: 15px;
    border: 2px solid #c6d4ee;
}

.tarot-consent-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: #41577e;
    font-weight: 500;
}

.tarot-consent-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: #a2844a;
    flex-shrink: 0;
}

.tarot-form-group {
    margin-bottom: 25px;
}

.tarot-form-group label {
    display: none;
    margin-bottom: 8px;
    font-weight: 600;
    color: #41577e;
    font-size: 0.95em;
    font-family: 'Didact Gothic', sans-serif;
}

.tarot-card-draw-container .tarot-form-group input {
    width: 100%;
    padding: 16px !important;
    border: 0px solid #c6d4ee;
    border-radius: 30px;
    font-size: 14px;
    box-sizing: border-box;
    background-color: rgba(198, 212, 238, 0.4);
    color: #4e4e4e;
    font-family: 'Didact Gothic', sans-serif;
}

.tarot-form-group input:focus {
    outline: none;
    background-color: rgba(198, 212, 238, 1);
}

.tarot-form-message {
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 8px;
    display: none;
}

.tarot-form-message.error {
    display: block;
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.tarot-form-message.success {
    display: block;
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Boutons */
.tarot-button {
    width: 100%;
    padding: 10px 25px;
    background: #41577e;
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(162, 132, 74, 0.4);
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.7em;
}

.tarot-button:hover {
    transform: translateY(-2px);
    background: #a2844a;
}

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

.tarot-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tarot-button-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Étape de succès */
.tarot-step-success {
    text-align: center;
    padding: 60px 20px;
}

.tarot-success-card {
    font-size: 1.3em;
    color: #41577e;
    margin-top: 30px;
    font-family: 'Didact Gothic', sans-serif;
}

.tarot-success-card strong {
    color: #a2844a;
    font-family: 'Julius Sans One', sans-serif;
}

/* ============================================
   RESPONSIVE - TABLETTES (≤ 1400px)
   ============================================ */
@media (max-width: 1400px) {
    /* Mode ÉVENTAIL - cartes plus petites */
    .tarot-card {
        width: 75px;
        height: 112px;
    }
    
    .tarot-card-row {
        height: 120px;
        margin-bottom: 12px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (≤ 768px)
   MODE GRILLE 5×11
   ============================================ */
@media (max-width: 768px) {
    .tarot-title {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    
    .tarot-subtitle {
        font-size: 1em;
        margin-bottom: 25px;
    }
    
    /* Mode GRILLE sur mobile */
    .tarot-card {
        width: 70px;
        height: 105px;
        position: relative; /* Important pour grid */
    }
    
    .tarot-card:hover {
        transform: translateY(-8px) scale(1.05);
    }
    
    .tarot-form {
        padding: 30px 20px;
    }
    
    .tarot-reveal-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        margin: 20px auto;
    }
    
    .tarot-revealed-card img {
        max-width: 250px;
    }
    
    .tarot-revealed-card h3 {
        font-size: 1.5em;
    }
    
    .tarot-interpretation-content {
        max-width: 100%;
        padding: 30px 20px;
    }
    
    .tarot-interpretation-text {
        font-size: 16px;
    }
    
    .tarot-interpretation-text h2 {
        font-size: 1.5em;
    }
    
    .tarot-interpretation-text h3 {
        font-size: 1.2em;
    }
    
    .tarot-consent-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .tarot-selected-card-preview img {
        width: 200px;
    }
    
    .tarot-consent-box {
        min-width: auto;
        width: 100%;
        padding: 30px 20px;
    }
    
    .tarot-consent-text {
        font-size: 16px;
    }
}

/* ============================================
   RESPONSIVE - TRÈS PETIT MOBILE (≤ 480px)
   MODE GRILLE 5×11 avec cartes encore plus petites
   ============================================ */
@media (max-width: 480px) {
    .tarot-card {
        width: 60px;
        height: 90px;
    }
    
    .tarot-card:hover {
        transform: translateY(-6px) scale(1.03);
    }
    
    .tarot-title {
        font-size: 1.5em;
    }
    
    .tarot-subtitle {
        font-size: 0.9em;
    }
    
    .tarot-button {
        font-size: 16px;
        padding: 12px 20px;
    }
}