/* ==========================================================================
   VOTE PHASE 2 - STYLES MODERNES
   ========================================================================== */

/* Container principal */
.vote-phase2-container {
    min-height: 80vh;
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Titre principal */
.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 0 0 2rem 0;
}

/* ==========================================================================
   CONTRÔLES EN BAS
   ========================================================================== */
.bottom-controls {
    margin-top: auto;
    padding-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* ==========================================================================
   NAVIGATION BETWEEN CATEGORIES
   ========================================================================== */
.category-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

/* ==========================================================================
   PROGRESS INDICATOR
   ========================================================================== */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 10px;
    width: 33.33%; /* 1/3 = 33.33% */
    transition: width 0.3s ease;
}

.progress-text {
    color: #ffd700;
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 60px;
    text-align: center;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px; /* Largeur augmentée pour accommoder "Terminer" */
    width: 140px; /* Largeur fixe pour tous les boutons */
    height: 48px; /* Hauteur fixe pour tous les boutons */
    justify-content: center;
    box-sizing: border-box; /* Inclut border et padding dans la hauteur */
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: #ffd700;
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.nav-btn span {
    font-size: 1.2rem;
}

/* ==========================================================================
   CATEGORIES WRAPPER
   ========================================================================== */
.categories-wrapper {
    position: relative;
    overflow: hidden;
    height: 750px; /* Hauteur plus généreuse pour éviter les coupures */
    display: flex;
    align-items: flex-start; /* Alignement en haut pour éviter les coupures */
    padding-top: 2rem;
}

.category-slide {
    display: none;
    opacity: 0;
    transform: translateX(0);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.category-slide.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Alignement en haut pour éviter les coupures */
    opacity: 1;
    transform: translateX(0);
    overflow-y: auto; /* Permet le scroll si nécessaire */
}

/* Category Header */
.category-header {
    text-align: center;
    margin-bottom: 3rem;
}

.category-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffd700;
    margin: 0 0 1rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 400;
    min-height: 24px;
}

/* ==========================================================================
   FINALISTS BOX - UNE SEULE BOX POUR LES 3 FINALISTES
   ========================================================================== */
.finalists-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 25px;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   FINALIST ITEMS - ÉLÉMENTS INDIVIDUELS DANS LA BOX
   ========================================================================== */
.finalist-item {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    text-align: center;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
}

/* Effet hover - seulement agrandissement et couleur, PAS d'effet doré */
.finalist-item:hover {
    transform: scale(1.08) translateY(-8px);
}

/* État sélectionné - effet doré temporaire au clic */
.finalist-item.selected {
    transform: scale(1.08) translateY(-8px);
}

.finalist-item.gold-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 215, 0, 1) 0%, rgba(255, 237, 78, 0.8) 20%, rgba(255, 215, 0, 0.5) 50%, transparent 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: goldRipple 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    pointer-events: none;
}

@keyframes goldRipple {
    0% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    15% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(2);
    }
    100% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(4);
    }
}

/* Image container - adapté pour images carrées */
.finalist-image {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.finalist-image img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    transition: all 0.4s ease;
    /* Effet grayscale par défaut */
    filter: grayscale(100%) brightness(0.7);
}

/* Hover - retour couleur et léger zoom */
.finalist-item:hover .finalist-image img,
.finalist-item.selected .finalist-image img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.05);
}

/* Nom du finaliste */
.finalist-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.finalist-item:hover .finalist-name,
.finalist-item.selected .finalist-name {
    color: #ffd700;
    transform: translateY(-5px);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   SUBMIT SECTION
   ========================================================================== */
.submit-section {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.submit-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    border: none;
    border-radius: 15px;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
    .finalists-box {
        gap: 2rem;
        padding: 2.5rem 1.5rem;
    }
    
    .finalist-item {
        min-width: 230px;
        max-width: 280px;
    }
    
    .finalist-image img {
        width: 240px;
        height: 240px;
    }
}

@media (max-width: 768px) {
    .vote-phase2-container {
        padding: 1rem 0.5rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .category-navigation {
        gap: 2rem;
    }
    
    .nav-btn {
        min-width: 100px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .finalists-box {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 2rem 1rem;
    }
    
    .finalist-item {
        max-width: 100%;
        width: 100%;
        min-width: auto;
    }
    
    .finalist-image img {
        width: 300px;
        height: 300px;
    }
    
    .category-title {
        font-size: 1.8rem;
    }
    
    .progress-bar {
        width: 250px;
    }
    
    .bottom-controls {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .categories-wrapper {
        height: 850px; /* Plus de hauteur sur mobile pour compenser la mise en page verticale */
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.6rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .finalist-image img {
        width: 260px;
        height: 260px;
    }
    
    .finalist-name {
        font-size: 1.2rem;
    }
    
    .finalists-box {
        padding: 1.5rem 0.5rem;
    }
    
    .progress-bar {
        width: 200px;
    }
    
    .category-navigation {
        gap: 1rem;
    }
    
    .categories-wrapper {
        height: 950px; /* Encore plus de hauteur sur très petits écrans */
    }
}

/* Conteneur des catégories en grid avec minimum 380px par case */
#votePhase2Form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    justify-content: center; /* centre la grille quand la dernière ligne n'est pas complète */
}

.option.selected {
    background: #28a745; /* fond vert */
}

/* ========================================================================== */
/* SUMMARY MODAL */
/* ========================================================================== */
.summary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.summary-overlay.open {
    display: flex;
}

.summary-modal {
    width: min(1000px, 95vw);
    max-height: 90vh;
    background: rgb(30, 30, 30);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.summary-header {
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.summary-header h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.4rem;
    color: #ffd700;
}
.summary-header p {
    margin: 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
}

.summary-content {
    padding: 1rem 1.5rem;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--vtafr-purple) transparent;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
    justify-content: space-between; /* Place le pseudo au bout de la ligne */
}
.summary-item:last-child {
    border-bottom: none;
}
.summary-item .cat {
    color: #ffd700;
    font-weight: 600;
    min-width: 42px;
}
.summary-item .name {
    color: #fff;
    font-weight: 500;
    margin-left: auto; /* pousse le pseudo à droite */
    text-align: right;
}
.summary-item .placeholder {
    color: rgba(255,255,255,0.6);
    font-style: italic;
}

.summary-actions {
    padding: 1rem 1.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.summary-btn {
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1.25rem;
    font-weight: 700;
    cursor: pointer;
}
.summary-btn.back-btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.summary-btn.finalize-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}