/* ============================================
   CSS ANAGRAMMES - Style Cartes avec Lettres
   ============================================ */

/* ============================================
   GRILLE PRINCIPALE
   ============================================ */

#grid-wrapper.anagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* ============================================
   HERO SECTION ANAGRAMMES
   ============================================ */

.hero-anagram {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 3rem;
    text-align: center;
}

.hero-anagram h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero-anagram p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

/* ============================================
   GRILLES DU JOUR (FEATURED)
   ============================================ */

.daily-anagram {
    margin-bottom: 3rem;
	padding:3vw;
}

.daily-anagram h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #2d3748;
}
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
/* ============================================
   FILTRES
   ============================================ */

.anagram-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}
.takuzu-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}
/* ============================================
   CARDS ANAGRAMMES
   ============================================ */

.anagram-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.anagram-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ============================================
   PREVIEW ANAGRAMME - LETTRES
   ============================================ */

.card-preview {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
}

.anagram-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.preview-word {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.preview-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: white;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.preview-letter:hover {
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Lettres du deuxi&egrave;me mot (plus discr&egrave;tes) */
.preview-letter.secondary {
    background: #f7fafc;
    color: #64748b;
    font-size: 1.25rem;
    min-width: 35px;
    height: 35px;
}

/* Fl&egrave;che entre les mots */
.preview-arrow {
    font-size: 2rem;
    color: rgba(45, 55, 72, 0.5);
    animation: pulse-arrow 2s ease-in-out infinite;
}

@keyframes pulse-arrow {
    0%, 100% { 
        opacity: 0.5;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
}

/* ============================================
   VARIATIONS PAR DIFFICULTÉ
   ============================================ */

.anagram-card.difficulty-easy .card-preview {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.anagram-card.difficulty-easy .preview-letter {
    border: 2px solid #10b981;
}

.anagram-card.difficulty-medium .card-preview {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.anagram-card.difficulty-medium .preview-letter {
    border: 2px solid #f59e0b;
}

.anagram-card.difficulty-hard .card-preview {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
}

.anagram-card.difficulty-hard .preview-letter {
    border: 2px solid #ef4444;
}

/* ============================================
   VARIATIONS PAR LONGUEUR
   ============================================ */

/* Courtes (3-5 lettres) */
.anagram-card.length-short .preview-letter {
    min-width: 45px;
    height: 45px;
    font-size: 1.75rem;
}

/* Moyennes (6-8 lettres) */
.anagram-card.length-medium .preview-letter {
    min-width: 40px;
    height: 40px;
    font-size: 1.5rem;
}

/* Longues (9+ lettres) */
.anagram-card.length-long .preview-letter {
    min-width: 35px;
    height: 35px;
    font-size: 1.25rem;
}

/* ============================================
   CARD INFO
   ============================================ */

.card-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.difficulty-badge {
    background: #fef3c7;
    color: #92400e;
}

.length-badge {
    background: #dbeafe;
    color: #1e40af;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.card-title a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-title a:hover {
    color: #f5576c;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-play {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f5576c;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-play:hover {
    background: #e0405a;
    transform: scale(1.02);
}

.btn-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    min-width: 48px;
}

.btn-pdf:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

/* ============================================
   FEATURED CARDS
   ============================================ */

.anagram-card.featured {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    color: white;
}

.anagram-card.featured .card-preview {
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
}

.anagram-card.featured .preview-letter {
    background: white;
    color: #7c3aed;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.anagram-card.featured .badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.anagram-card.featured .btn-play {
    background: white;
    color: #7c3aed;
}

.anagram-card.featured .card-title a {
    color: white;
}

.anagram-card.featured .card-meta {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   SEO CONTENT
   ============================================ */

.seo-content-wrapper {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.seo-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.seo-section summary {
    padding: 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.25rem;
    color: #2d3748;
    user-select: none;
}

.seo-section summary:hover {
    background: #f7fafc;
}

.seo-content {
    padding: 0 1.25rem 1.25rem;
    line-height: 1.7;
    color: #4a5568;
}

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

@media (max-width: 768px) {
    .hero-anagram {
        padding: 2rem 1rem;
    }
    
    .hero-anagram h2 {
        font-size: 1.5rem;
    }
    
    #grid-wrapper.anagram-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .anagram-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .card-preview {
        min-height: 160px;
        padding: 1.5rem 1rem;
    }
    
    /* Lettres plus petites sur mobile */
    .preview-letter {
        min-width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }
    
    .preview-letter.secondary {
        min-width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .anagram-card.length-short .preview-letter {
        min-width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
    
    .anagram-card.length-long .preview-letter {
        min-width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .card-info {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .btn-play {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-in {
    animation: fadeInUp 0.3s ease-out;
}

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

.anagram-card {
    animation: fadeInUpInitial 0.5s ease-out;
}

.anagram-card:nth-child(1) { animation-delay: 0.05s; }
.anagram-card:nth-child(2) { animation-delay: 0.1s; }
.anagram-card:nth-child(3) { animation-delay: 0.15s; }
.anagram-card:nth-child(4) { animation-delay: 0.2s; }

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

/* Animation des lettres au hover de la card */
.anagram-card:hover .preview-letter {
    animation: letter-bounce 0.6s ease;
}

.anagram-card:hover .preview-letter:nth-child(1) { animation-delay: 0s; }
.anagram-card:hover .preview-letter:nth-child(2) { animation-delay: 0.05s; }
.anagram-card:hover .preview-letter:nth-child(3) { animation-delay: 0.1s; }
.anagram-card:hover .preview-letter:nth-child(4) { animation-delay: 0.15s; }
.anagram-card:hover .preview-letter:nth-child(5) { animation-delay: 0.2s; }
.anagram-card:hover .preview-letter:nth-child(6) { animation-delay: 0.25s; }

@keyframes letter-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-5deg); }
    75% { transform: translateY(-4px) rotate(5deg); }
}

/* ============================================
   NO RESULTS MESSAGE
   ============================================ */

.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    display: none;
}

.no-results-content {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 3rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-results-content h3 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
    font-weight: 700;
}

.no-results-content p {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.btn-reset-filter {
    background: #f5576c;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-filter:hover {
    background: #e0405a;
    transform: translateY(-2px);
}

/* ============================================
   EFFET "SHUFFLE" DES LETTRES (BONUS)
   ============================================ */

.anagram-card.shuffling .preview-letter {
    animation: shuffle 0.4s ease-in-out;
}

@keyframes shuffle {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    25% { 
        transform: translateY(-20px) rotate(-15deg);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(10px) rotate(15deg);
        opacity: 0.5;
    }
    75% { 
        transform: translateY(-10px) rotate(-10deg);
        opacity: 0.7;
    }
}
