/* ==========================================================================
   THEME SELECTOR - LeClainche Family Site
   Interface uniformisée avec 4 boutons circulaires fixes
   ========================================================================== */

@import url('family-colors.css');

/* ==========================================================================
   CONTENEUR PRINCIPAL DES THÈMES
   ========================================================================== */

.theme-selector-container {
    width: 100%;
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.theme-selector-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--family-blue-dark), var(--family-green-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   BOUTONS CIRCULAIRES UNIFORMISÉS
   ========================================================================== */

.theme-circle-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    position: relative;
    text-decoration: none;
}

.theme-circle-button:hover {
    transform: translateY(-2px);
}

.theme-circle-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.theme-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: white;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   ORDRE FIXE DES COULEURS FAMILIALES
   ========================================================================== */

/* Position 1 - Bleu (Thierry) */
.theme-circle-button:nth-child(1) .theme-circle {
    border: 3px solid var(--family-blue);
    color: var(--family-blue);
}

.theme-circle-button:nth-child(1):hover .theme-circle {
    box-shadow: 0 4px 20px rgba(168, 198, 240, 0.4);
}

.theme-circle-button:nth-child(1).active .theme-circle {
    background: var(--family-blue);
    color: white;
    box-shadow: 0 6px 25px rgba(168, 198, 240, 0.6);
}

/* Position 2 - Jaune (Commun) */
.theme-circle-button:nth-child(2) .theme-circle {
    border: 3px solid var(--family-yellow);
    color: var(--family-yellow-dark);
}

.theme-circle-button:nth-child(2):hover .theme-circle {
    box-shadow: 0 4px 20px rgba(252, 232, 165, 0.4);
}

.theme-circle-button:nth-child(2).active .theme-circle {
    background: var(--family-yellow);
    color: var(--family-yellow-dark);
    box-shadow: 0 6px 25px rgba(252, 232, 165, 0.6);
}

/* Position 3 - Vert (Malo) */
.theme-circle-button:nth-child(3) .theme-circle {
    border: 3px solid var(--family-green);
    color: var(--family-green-dark);
}

.theme-circle-button:nth-child(3):hover .theme-circle {
    box-shadow: 0 4px 20px rgba(174, 226, 179, 0.4);
}

.theme-circle-button:nth-child(3).active .theme-circle {
    background: var(--family-green);
    color: white;
    box-shadow: 0 6px 25px rgba(174, 226, 179, 0.6);
}

/* Position 4 - Rouge (Julie) */
.theme-circle-button:nth-child(4) .theme-circle {
    border: 3px solid var(--family-red);
    color: var(--family-red-dark);
}

.theme-circle-button:nth-child(4):hover .theme-circle {
    box-shadow: 0 4px 20px rgba(244, 184, 181, 0.4);
}

.theme-circle-button:nth-child(4).active .theme-circle {
    background: var(--family-red);
    color: white;
    box-shadow: 0 6px 25px rgba(244, 184, 181, 0.6);
}

.theme-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.theme-circle-button:hover .theme-label {
    color: #1f2937;
    font-weight: 600;
}

.theme-circle-button.active .theme-label {
    color: #1f2937;
    font-weight: 700;
}

/* ==========================================================================
   ANIMATIONS ET EFFETS
   ========================================================================== */

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

.theme-circle-button.active .theme-circle {
    animation: pulse 3s infinite;
}

/* Effet shimmer pour les boutons en chargement */
.theme-circle-button.loading .theme-circle {
    position: relative;
    overflow: hidden;
}

.theme-circle-button.loading .theme-circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .theme-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .theme-circle {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }
    
    .theme-label {
        font-size: 0.75rem;
    }
    
    .theme-selector-container {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .theme-grid {
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .theme-circle {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
        border-width: 2px !important;
    }
    
    .theme-circle-button {
        gap: 0.5rem;
        padding: 0.75rem 0.25rem;
    }
}

/* ==========================================================================
   ACCESSIBILITÉ
   ========================================================================== */

.theme-circle-button:focus {
    outline: 2px solid var(--family-blue);
    outline-offset: 4px;
}

.theme-circle-button:focus-visible {
    outline: 2px solid var(--family-blue);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .theme-circle-button,
    .theme-circle {
        transition: none;
    }
    
    .theme-circle-button.active .theme-circle {
        animation: none;
    }
    
    .theme-circle-button.loading .theme-circle::after {
        animation: none;
    }
}

/* ==========================================================================
   ÉTATS SPÉCIAUX
   ========================================================================== */

.theme-circle-button.empty {
    opacity: 0.3;
}

.theme-circle-button.empty .theme-circle {
    border-style: dashed;
    background: #f9fafb;
}

.theme-circle-button.empty:hover {
    transform: none;
}

.theme-circle-button.empty .theme-label {
    color: #9ca3af;
    font-style: italic;
}
