/* Couleurs inspirées de l'Inde */
@import url('https://fonts.googleapis.com/css2?family=Rozha+One&display=swap');

:root {
    --primary-color: #FF9933;    /* Orange safran */
    --secondary-color: #138808;   /* Vert indien */
    --accent-color: #9c27b0;     /* Violet royal */
    --background-color: #fff3e0;  /* Beige clair */
    --text-color: #2c3e50;
    --gold: #d1b411;
    --success-color: rgb(39, 174, 96);     /* Vert */
    --warning-color: #f39c12;     /* Orange */
    --error-color: #c0392b;       /* Rouge foncé */
    --border-color: #bdc3c7;      /* Gris clair pour les bordures */
    font-size: 16px; /* Taille de base pour le calcul des rem */
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 1.2rem; /* 19.2px */
    line-height: 1.5;
    background: var(--background-color);
    background-image: url('images/moroccan-flower-dark.png');
    margin: 0;
    padding: 10px;
}

/* Container principal avec bordure indienne */
.indian-border {
    border: 20px solid transparent;
    padding: 20px;
    border-radius: 20px;
    background: rgba(39, 174, 96, 0.6);
}

/* Titre stylisé */
.title-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.title-decoration h1 {
    font-family: 'Rozha One', serif;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.title-decoration i {
    font-size: 2rem;
    color: var(--gold);
}

/* Style du formulaire */
.select-wrapper {
    position: relative;
    margin: 20px 0;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--text-color);
    pointer-events: none;
}

/* Animations */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Mise à jour des styles existants */
button {
    background: linear-gradient(45deg, var(--primary-color), var(--gold));
    border: none;
    padding: 15px 30px;
    color: white;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: var(--primary-color);
}

/* Question container avec décoration */
.question-decoration {
    background: white;
    padding: 30px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.question-decoration::before,
.question-decoration::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background-image: url('images/paisley.png');
    background-size: contain;
    opacity: 0.1;
}

.question-decoration::before {
    top: -20px;
    left: -20px;
}

.question-decoration::after {
    bottom: -20px;
    right: -20px;
    transform: rotate(180deg);
}

.container {
    min-height: fit-content;
    margin: 10px;
    padding: 15px;
    width: calc(100% - 20px);
    box-sizing: border-box;
    background: linear-gradient(135deg, rgb(250, 133, 0), rgb(241, 197, 1));
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(17, 134, 6, 1);
    transform-style: preserve-3d;
    animation: containerFloat 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes containerFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

h1 {
    color: var(--primary-color);
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    font-family: 'Poppins', Arial, sans-serif;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

select, button {
    padding: 12px 24px;
    margin: 10px 0;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

select {
    width: 100%;
    cursor: pointer;
    background: white;
    color: var(--text-color);
    border: 1px solid var(--primary-color);
    appearance: none;
}

select option {
    background: white;
    color: var(--text-color);
}

button {
    background: linear-gradient(45deg, var(--primary-color), var(--gold));
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s;
}

button:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

#quiz-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); opacity: 1; }
}

#question-container {
    font-size: 1.6rem;
    line-height: 1.5;
    padding: 20px;
    margin-bottom: 1.5rem;
}

#buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

#true-btn, #false-btn {
    flex: 1;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#true-btn {
    background: var(--secondary-color);
}

#false-btn {
    background: #e74c3c;
}

#true-btn:hover, #false-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#quiz-end {
    text-align: center;
    background: linear-gradient(45deg, var(--primary-color), var(--gold));
    color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.nav-button {
    display: inline-block;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#time-check {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    font-weight: bold;
    animation: pulse 2s infinite;
    line-height: 1.5;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Styles pour la page de tirage */
.winner-entry {
    background: white;
    margin: 15px 0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    animation: slideIn 0.5s ease-out, glow 2s infinite;
    border: 1px solid var(--border-color);
}

@keyframes glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 4px 20px rgba(255, 153, 51, 0.3); }
}

.winner-number {
    background: var(--secondary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.winner-name {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Ajoutez ces styles pour les messages d'erreur */
.error-message {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

/* Ajout d'un style pour les messages d'information */
.info-message {
    color: #2980b9;
    background: rgba(41, 128, 185, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

/* Ajout du style pour le message de fin de quiz */
.quiz-ended-message {
    text-align: center;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.quiz-ended-message h2 {
    color: var(--primary-color);
}

.quiz-ended-message p {

    font-size: 1.1rem;
    color: #666;
}

/* Tablettes et petits écrans */
@media screen and (max-width: 768px) {
    .container {
        margin: 0;
        padding: 1rem;
        width: 100%;
        box-shadow: none;
    }

    .indian-border {
        border-width: 10px;
        padding: 10px;
    }

    .dex-logo {
        width: 180px; /* Logo plus petit sur mobile */
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    /* Ajustement des boutons pour mobile */
    .option-btn {
        padding: 15px;
        font-size: 1rem;
        width: 100%;
        margin: 5px 0;
    }

    /* Progression plus compacte */
    .progress-container {
        padding: 8px;
        margin: 0.5rem 0;
    }

    .step {
        width: 25px;
        height: 25px;
        font-size: 0.9rem;
    }

    /* Messages plus compacts */
    .game-intro, 
    #time-check {
        padding: 10px;
        font-size: 1rem;
        margin: 0.5rem 0;
    }

    /* Ajustement du select */
    select {
        padding: 12px;
        font-size: 0.9rem;
    }

    /* Score et messages de fin */
    .score-container {
        padding: 1rem;
        margin: 1rem 0;
    }

    .success-message,
    .error-message {
        font-size: 1rem;
    }

    #buttons {
        flex-direction: column;
        gap: 1rem;
    }

    #true-btn, #false-btn {
        width: 100%;
    }
}

/* Optimisation pour les petits écrans mobiles */
@media screen and (max-width: 480px) {
    body {
        padding: 5px;
        min-height: fit-content;
    }

    .container {
        margin: 5px;
        padding: 10px;
        min-height: fit-content;
    }

    .indian-border {
        border-width: 10px;
        padding: 10px;
        min-height: fit-content;
    }

    /* Logo */
    .dex-logo {
        width: 160px;
    }

    /* Titres */
    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 20px;
        margin: 10px 0;
    }

    /* Questions */
    #question-container {
        font-size: 20px;
        padding: 15px;
        margin-bottom: 15px;
        line-height: 1.3;
    }

    /* Boutons de réponse */
    .option-btn {
        font-size: 18px;
        padding: 20px 15px;
        min-height: 70px;
        margin: 8px 0;
        line-height: 1.2;
    }

    /* Messages */
    .game-intro, 
    #time-check,
    .success-message,
    .error-message {
        font-size: 18px;
        line-height: 1.3;
    }

    /* Liste déroulante */
    select {
        font-size: 16px;
        padding: 15px;
        height: 50px;
    }

    /* Bouton de démarrage */
    #start-quiz {
        font-size: 18px;
        padding: 15px;
        margin-top: 15px;
    }

    /* Progression */
    .step {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}

/* Pour les très petits écrans */
@media screen and (max-width: 320px) {
    .dex-logo {
        width: 150px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .step {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }
}

/* Ajustements pour les grands écrans */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1000px;
    }
}

/* Orientation paysage sur mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .container {
        margin: 0;
        padding: 0.5rem;
    }

    .dex-logo {
        width: 120px;
        margin-bottom: 10px;
    }

    .progress-container {
        margin: 0.3rem 0;
    }

    .question-decoration {
        padding: 15px;
    }
}

/* Styles pour l'animation de loterie */
.lottery-container {
    height: 120px;
    overflow: hidden;
    background: white;
    border-radius: 15px;
    margin: 20px auto;
    position: relative;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.lottery-container::before,
.lottery-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 2;
    pointer-events: none;
}

.lottery-container::before {
    top: 0;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.8) 20%,
        transparent 100%
    );
}

.lottery-container::after {
    bottom: 0;
    background: linear-gradient(0deg, 
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.8) 20%,
        transparent 100%
    );
}

.lottery-list {
    transition: transform 5s cubic-bezier(0.21, 0.53, 0.29, 0.99);
}

.lottery-item {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    padding: 0 20px;
    position: relative;
}

/* Effet de surbrillance pour l'élément sélectionné */
.lottery-item.focus {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    background: rgba(52, 152, 219, 0.1);
}

/* Ligne de sélection centrale */
.lottery-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 153, 51, 0.05) 10%,
        rgba(255, 153, 51, 0.1) 50%,
        rgba(255, 153, 51, 0.05) 90%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Indicateurs de défilement */
.lottery-container::before {
    content: '⌄';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--primary-color);
    opacity: 0.5;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

.winners-table {
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.winners-table.show {
    opacity: 1;
    transform: translateY(0);
}

.winner-entry {
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.winner-entry.selected {
    animation: winnerSelected 0.5s ease forwards;
}

@keyframes winnerSelected {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        background: var(--secondary-color);
    }
    100% {
        transform: scale(1);
        background: var(--primary-color);
        color: white;
    }
}

/* Style pour le conteneur du bouton de tirage */
#draw-container {
    text-align: center;
    margin: 2rem 0;
}

.draw-button {
    font-size: 1.2rem;
    padding: 15px 30px;
    background: linear-gradient(45deg, var(--primary-color), var(--gold));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.draw-button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.draw-button.in-progress {
    background: var(--secondary-color);
    animation: pulse 2s infinite;
}

.draw-button.completed {
    background: var(--accent-color);
}

#options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.option-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    background: white;
    color: var(--text-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: var(--background-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.score-container {
    background: white;
    border-radius: 15px;
    text-align: center;
}

.success-message {
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(19, 136, 8, 0.1);
    border-radius: 8px;

}

.error-message {
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    margin: 1rem 0;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.dex-logo {
    width: 240px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    animation: logoFloat 4s ease-in-out infinite;
}

/* Animation subtile pour le logo */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.game-intro {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 153, 51, 0.1);
    border-radius: 10px;
}

/* Suppression de l'ancien style prize-info qui n'est plus utilisé */
.prize-info {
    display: none;
}

/* Ajout des styles pour la progression */
.progress-container {
    width: 100%;
    background: rgba(255, 153, 51, 0.1);
    border-radius: 10px;
    margin: 1rem 0;
    padding: 10px;
    text-align: center;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 300px;
}

.step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    position: relative;
}

.step.active {
    background: var(--primary-color);
    color: white;
}

.step.completed {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* Animation pour la réponse sélectionnée */
.option-btn.selected {
    animation: selectedAnswer 0.5s ease;
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@keyframes selectedAnswer {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Style pour la recherche et les résultats */
.search-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.search-input {
    width: 80%;
    padding: 12px 40px 12px 20px;
    font-size: 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 153, 51, 0.3);
}

.search-icon {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
}

/* Liste des résultats */
.search-results {
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none; /* Caché par défaut */
}

.search-results.show {
    display: block;
}

.participant-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.participant-item:last-child {
    border-bottom: none;
}

.participant-item:hover {
    background: rgba(255, 153, 51, 0.1);
}

.participant-item.selected {
    background: var(--primary-color);
    color: white;
}

.participant-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.participant-company {
    font-size: 0.9rem;
    color: #666;
}

.participant-item.selected .participant-company {
    color: rgba(255, 255, 255, 0.8);
}

/* Scrollbar personnalisée */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #e67300;
}

/* Animation de chargement */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: linear-gradient(135deg, rgba(255, 153, 51, 0.95), rgba(255, 87, 51, 0.95));
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.1);
    min-width: 300px;
    animation: float 3s ease-in-out infinite;
    z-index: 10000;
}

.spinner {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    border: 6px solid rgba(255, 255, 255, 0.8);
    border-top: 6px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-content p {
    font-size: 1.4rem;
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    margin: 0;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
} 