/**
 * Template Enseignes Lauréates - UI/UX Moderne
 * Palette: Jaune #FFD800, Bleu #0B1224, Blanc #FFF
 * Compatible Blocksy Theme
 */

/* === RESET & BASE === */
.qslm-laureates-page {
    background: #f8f9fa;
    min-height: 100vh;
}

/* === HERO SECTION (NON STICKY) === */
.qslm-page-hero {
    background: #0B1224;
    color: #fff;
    padding: 3rem 0 2rem;
    text-align: center;
}

.qslm-hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.qslm-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.qslm-subtitle {
    font-size: 1.1rem;
    color: #FFD800;
    margin: 0;
    font-weight: 500;
}

/* === BARRE DE RECHERCHE (STICKY) === */
.qslm-search-section {
    background: #fff;
    border-bottom: 3px solid #FFD800;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.qslm-search-section.scrolled {
    padding: 0.875rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.qslm-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Formulaire de recherche */
.qslm-search-form {
    max-width: 800px;
    margin: 0 auto 1rem;
}

.qslm-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.qslm-search-icon {
    position: absolute;
    left: 35px;
    color: #6b7280;
    pointer-events: none;
    z-index: 2;
    width: 20px;
    height: 20px;
}

.qslm-search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 70px;
    font-size: 1.1rem;
    border: 3px solid transparent;
    border-radius: 50px;
    background: #fff;
    color: #0B1224;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qslm-search-input:focus {
    outline: none;
    border-color: #FFD800;
    box-shadow: 0 6px 24px rgba(255, 216, 0, 0.3);
    transform: translateY(-1px);
}

.qslm-search-input::placeholder {
    color: #9ca3af;
}

/* Meta section (compteur + filtres) */
.qslm-search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Compteur de résultats */
.qslm-results-count {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: #0B1224;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
}

/* Filtres actifs */
.qslm-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qslm-filters-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
}

.qslm-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qslm-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: #f3f4f6;
    color: #4b5563;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.825rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.qslm-filter-tag:hover {
    background: #FFD800;
    color: #0B1224;
    border-color: #FFD800;
}

.qslm-filter-tag svg {
    width: 14px;
    height: 14px;
}

.qslm-remove-filter {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

.qslm-remove-filter:hover {
    color: #ef4444;
    transform: scale(1.2);
}

/* État de chargement */
.qslm-search-section.loading .qslm-search-input-wrapper::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    width: 20px;
    height: 20px;
    border: 3px solid #e5e7eb;
    border-top-color: #FFD800;
    border-radius: 50%;
    animation: qslm-spin 0.6s linear infinite;
}

@keyframes qslm-spin {
    to { transform: rotate(360deg); }
}

/* === CONTENU PRINCIPAL === */
.qslm-main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* === SIDEBAR === */
.qslm-sidebar {
    position: relative;
}

.qslm-sidebar-sticky {
    position: sticky;
    top: calc(var(--qslm-search-height, 200px) + 2rem);
}

.qslm-widget {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.qslm-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.qslm-widget-highlight {
    background: linear-gradient(135deg, #FFD800 0%, #ffd000 100%);
    border: none;
    color: #0B1224;
}

.qslm-widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0B1224;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #FFD800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qslm-widget-highlight .qslm-widget-title {
    border-bottom-color: rgba(0, 0, 0, 0.2);
}

/* Liste des catégories */
.qslm-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.qslm-categories-list li {
    margin-bottom: 0.5rem;
}

.qslm-categories-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.qslm-categories-list a:hover {
    background: #f3f4f6;
    color: #0B1224;
    transform: translateX(4px);
}

.qslm-categories-list li.active a {
    background: #0B1224;
    color: #FFD800;
    font-weight: 700;
}

.qslm-cat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: #FFD800;
    color: #0B1224;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
}

.qslm-categories-list li.active .qslm-cat-badge {
    background: #FFD800;
    color: #0B1224;
}

/* Widget Top Enseigne */
.qslm-top-card {
    margin: 0;
}

.qslm-top-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.qslm-top-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.1);
}

.qslm-top-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.qslm-top-card a:hover .qslm-top-thumb img {
    transform: scale(1.05);
}

.qslm-top-content {
    text-align: center;
}

.qslm-top-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0B1224;
    margin: 0 0 0.75rem;
}

.qslm-top-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.qslm-score-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0B1224;
}

.qslm-score-max {
    font-size: 1.2rem;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 600;
}

/* === CARROUSEL LAURÉATS À L'HONNEUR === */
.qslm-featured-carousel {
    position: relative;
    overflow: hidden;
}

.qslm-featured-track {
    position: relative;
    width: 100%;
    min-height: 200px; /* Hauteur minimale pour éviter le collapse */
}

.qslm-top-card {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateX(100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 !important; /* Forcer la suppression des marges */
}

.qslm-top-card.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateX(0);
    z-index: 1;
    margin: 0 !important;
}

/* Animation d'entrée/sortie */
.qslm-top-card:not(.active) {
    transform: translateX(-100%);
}

/* Dots de navigation */
.qslm-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.qslm-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(11, 18, 36, 0.3);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
}

.qslm-dot:hover {
    border-color: rgba(11, 18, 36, 0.6);
    transform: scale(1.2);
}

.qslm-dot.active {
    background: #0B1224;
    border-color: #0B1224;
    width: 24px;
    border-radius: 5px;
}

/* Animation de progression pour le dot actif */
.qslm-dot.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 5px;
    border: 2px solid rgba(11, 18, 36, 0.2);
    animation: dotProgress 5s linear;
}

@keyframes dotProgress {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Accessibilité - Focus visible */
.qslm-dot:focus-visible {
    outline: 2px solid #0B1224;
    outline-offset: 3px;
}

/* Support tactile - Zone de touch plus grande */
@media (hover: none) {
    .qslm-dot {
        width: 14px;
        height: 14px;
        padding: 6px;
    }
    
    .qslm-dot.active {
        width: 28px;
    }
}

/* === ZONE DES RÉSULTATS === */
.qslm-results-area {
    min-width: 0;
}

#qslm-results-container {
    transition: opacity 0.3s ease;
}

#qslm-results-container.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Grille des enseignes */
.qslm-enseignes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Carte d'enseigne */
.qslm-enseigne-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.qslm-enseigne-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #FFD800;
}

.qslm-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.qslm-card-logo {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 3px solid #FFD800;
}

.qslm-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.qslm-enseigne-card:hover .qslm-card-logo img {
    transform: scale(1.05);
}

.qslm-card-content {
    padding: 1.5rem;
    position: relative;
}

.qslm-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0B1224;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.qslm-card-category {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.qslm-card-score {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.qslm-score-circle {
    position: relative;
    width: 70px;
    height: 70px;
    filter: drop-shadow(0 4px 8px rgba(11, 18, 36, 0.15));
}

.qslm-score-svg {
    transition: transform 0.3s ease;
}

.qslm-enseigne-card:hover .qslm-score-svg {
    transform: scale(1.1);
}

.qslm-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.qslm-score-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0B1224;
    text-shadow: 0 2px 4px rgba(11, 18, 36, 0.1);
}

.qslm-card-year {
    text-align: center;
    padding: 0.5rem;
    background: linear-gradient(135deg, #FFD800 0%, #ffd000 100%);
    color: #0B1224;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* === PAGINATION === */
.qslm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    padding: 2rem 0;
}

.qslm-pagination a,
.qslm-pagination span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #fff;
    color: #4b5563;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
}

.qslm-pagination a:hover {
    background: #0B1224;
    color: #FFD800;
    border-color: #0B1224;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qslm-pagination .current {
    background: #FFD800;
    color: #0B1224;
    border-color: #FFD800;
    font-weight: 700;
}

.qslm-pagination svg {
    width: 16px;
    height: 16px;
}

/* === PAS DE RÉSULTATS === */
.qslm-no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.qslm-no-results svg {
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.qslm-no-results h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0B1224;
    margin: 0 0 0.75rem;
}

.qslm-no-results p {
    color: #6b7280;
    font-size: 1.1rem;
    margin: 0 0 2rem;
    line-height: 1.6;
}

.qslm-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: #FFD800;
    color: #0B1224;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 216, 0, 0.3);
}

.qslm-reset-btn:hover {
    background: #0B1224;
    color: #FFD800;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* === RESPONSIVE === */

/* Tablette */
@media (max-width: 1024px) {
    .qslm-main-content {
        grid-template-columns: 240px 1fr;
        gap: 2rem;
        padding: 2rem 1.5rem;
    }
    
    .qslm-enseignes-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.5rem;
    }
}

/* Tablette portrait */
@media (max-width: 900px) {
    .qslm-main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .qslm-sidebar-sticky {
        position: static;
    }
    
    .qslm-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .qslm-widget {
        margin-bottom: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .qslm-page-hero {
        padding: 2rem 0 1.5rem;
    }
    
    .qslm-hero-container {
        padding: 0 1rem;
    }
    
    .qslm-search-section {
        padding: 1rem 0;
    }
    
    .qslm-search-container {
        padding: 0 1rem;
    }
    
    .qslm-main-title {
        font-size: 1.75rem;
    }
    
    .qslm-subtitle {
        font-size: 0.95rem;
    }
    
    .qslm-search-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .qslm-search-input {
        font-size: 16px; /* Évite le zoom iOS */
        padding: 0.875rem 1.25rem 0.875rem 3rem;
    }
    
    .qslm-search-icon {
        left: 1rem;
    }
    
    .qslm-main-content {
        padding: 1.5rem 1rem;
    }
    
    .qslm-sidebar {
        grid-template-columns: 1fr;
    }
    
    .qslm-enseignes-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .qslm-enseigne-card:hover {
        transform: translateY(-4px);
    }
}

/* Petit mobile */
@media (max-width: 480px) {
    .qslm-main-title {
        font-size: 1.5rem;
    }
    
    .qslm-widget {
        padding: 1.25rem;
    }
    
    .qslm-card-content {
        padding: 1.25rem;
    }
    
    .qslm-pagination a,
    .qslm-pagination span {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
}

/* === ANIMATIONS === */
@keyframes qslm-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qslm-enseigne-card {
    animation: qslm-fade-in 0.5s ease-out backwards;
}

.qslm-enseigne-card:nth-child(1) { animation-delay: 0.05s; }
.qslm-enseigne-card:nth-child(2) { animation-delay: 0.1s; }
.qslm-enseigne-card:nth-child(3) { animation-delay: 0.15s; }
.qslm-enseigne-card:nth-child(4) { animation-delay: 0.2s; }
.qslm-enseigne-card:nth-child(5) { animation-delay: 0.25s; }
.qslm-enseigne-card:nth-child(6) { animation-delay: 0.3s; }

/* === ACCESSIBILITÉ === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour accessibilité */
.qslm-search-input:focus-visible,
.qslm-categories-list a:focus-visible,
.qslm-card-link:focus-visible,
.qslm-pagination a:focus-visible {
    outline: 3px solid #FFD800;
    outline-offset: 2px;
}
