/**
 * Layout Fixe pour la Page Créateurs
 * Sidebar fixe + Grille avec défilement interne
 */

/* === LAYOUT PRINCIPAL FIXE === */
body.page-creators {
    overflow: hidden !important;
    height: 100vh !important;
    max-height: 100vh !important;
}

/* === PAGE HEADER COMPACT === */
body.page-creators .page-header {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    padding: 0.75rem 0 !important;
    margin-bottom: 0 !important;
    min-height: auto !important;
    max-height: 80px !important;
}

body.page-creators .page-header .page-title {
    font-size: 1.25rem !important;
    margin-bottom: 0.15rem !important;
}

body.page-creators .page-header .page-subtitle {
    font-size: 0.8rem !important;
    margin-bottom: 0 !important;
}

body.page-creators .main-content,
body.page-creators main {
    height: calc(100vh - 80px) !important;
    max-height: calc(100vh - 80px) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

body.page-creators .section {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 1rem 0 !important;
}

body.page-creators .section > .container {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* === LAYOUT GRILLE AVEC SIDEBAR === */
body.page-creators .creators-layout {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 1.5rem !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}

/* === SIDEBAR FIXE AVEC SCROLL === */
body.page-creators .creators-sidebar {
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.5) transparent;
}

body.page-creators .creators-sidebar::-webkit-scrollbar {
    width: 6px;
}

body.page-creators .creators-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

body.page-creators .creators-sidebar::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 3px;
}

body.page-creators .creators-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

/* === HEADER SIDEBAR === */
body.page-creators .creators-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

body.page-creators .creators-sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

body.page-creators .filters-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #6b7280;
}

/* === CONTENEUR PRINCIPAL CRÉATEURS FIXE === */
body.page-creators .creators-main {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Conteneur scrollable pour grille + pagination */
body.page-creators .creators-scroll-container {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.5) transparent;
    position: relative !important;
}

body.page-creators .creators-scroll-container::-webkit-scrollbar {
    width: 8px;
}

body.page-creators .creators-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

body.page-creators .creators-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 4px;
}

body.page-creators .creators-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.7);
}

/* === TOOLBAR FIXE === */
body.page-creators .creators-toolbar {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid #e5e7eb;
}

body.page-creators .creators-count {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

body.page-creators .creators-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.page-creators .sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.875rem;
    cursor: pointer;
}

/* === GRILLE DE CRÉATEURS === */
body.page-creators .creator-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr) !important;
    overflow: visible !important;
    padding: 0.5rem;
    padding-bottom: 1rem;
    gap: 1.5rem;
}

/* === CACHER LE FOOTER === */
body.page-creators .footer,
body.page-creators footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* === PAGINATION === */
body.page-creators .pagination-wrapper {
    flex-shrink: 0 !important;
    margin-top: 1rem !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid #e5e7eb !important;
}

body.page-creators .pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
}

body.page-creators .pagination .page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0.5rem 0.75rem !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    color: #374151 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

body.page-creators .pagination .page-link:hover {
    background: #f3f4f6 !important;
    border-color: #d4af37 !important;
    color: #d4af37 !important;
}

body.page-creators .pagination .page-link.active {
    background: linear-gradient(135deg, #d4af37, #b8941f) !important;
    border-color: #d4af37 !important;
    color: #ffffff !important;
    cursor: default !important;
}

/* === MODE SOMBRE === */
html[data-theme="dark"] body.page-creators .creators-sidebar {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] body.page-creators .creators-sidebar-header {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] body.page-creators .creators-sidebar-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body.page-creators .creators-toolbar {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] body.page-creators .creators-count {
    color: #94a3b8 !important;
}

html[data-theme="dark"] body.page-creators .sort-select {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.page-creators .pagination .page-link {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.page-creators .pagination .page-link:hover {
    background: rgba(212, 175, 55, 0.15) !important;
    border-color: #d4af37 !important;
    color: #d4af37 !important;
}

html[data-theme="dark"] body.page-creators .pagination .page-link.active {
    background: linear-gradient(135deg, #d4af37, #b8941f) !important;
    border-color: #d4af37 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body.page-creators .pagination-wrapper {
    border-top-color: #334155 !important;
}

/* === FILTRES MODE JOUR === */
body.page-creators .filter-section .form-input,
body.page-creators .filter-section .form-select,
body.page-creators .filter-section .filter-select {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    color: #1f2937 !important;
    width: 100% !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.page-creators .filter-section .form-input:focus,
body.page-creators .filter-section .form-select:focus,
body.page-creators .filter-section .filter-select:focus {
    outline: none !important;
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
}

body.page-creators .filter-section .form-input::placeholder {
    color: #9ca3af !important;
}

body.page-creators .filter-title {
    color: #374151 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
}

body.page-creators .filter-section {
    margin-bottom: 1.25rem !important;
}

/* === BOUTONS DE FILTRES === */
body.page-creators .creators-sidebar .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 0.875rem 1.25rem !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0.75rem !important;
}

body.page-creators .creators-sidebar .btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8941f) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3) !important;
}

body.page-creators .creators-sidebar .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4) !important;
}

body.page-creators .creators-sidebar .btn-secondary {
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    color: #374151 !important;
}

body.page-creators .creators-sidebar .btn-secondary:hover {
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
}

/* Boutons mode sombre */
html[data-theme="dark"] body.page-creators .creators-sidebar .btn-secondary {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.page-creators .creators-sidebar .btn-secondary:hover {
    background: #475569 !important;
    border-color: #64748b !important;
}

/* === FILTRES MODE SOMBRE === */
html[data-theme="dark"] body.page-creators .filter-section .form-input,
html[data-theme="dark"] body.page-creators .filter-section .form-select,
html[data-theme="dark"] body.page-creators .filter-section .filter-select {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.page-creators .filter-section .form-input:focus,
html[data-theme="dark"] body.page-creators .filter-section .form-select:focus,
html[data-theme="dark"] body.page-creators .filter-section .filter-select:focus {
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25) !important;
}

html[data-theme="dark"] body.page-creators .filter-section .form-input::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] body.page-creators .filter-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body.page-creators .filter-section .form-select option {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* === EXCEPTION POUR PAGE DÉTAIL CRÉATEUR === */
/* La page détail n'a pas besoin de layout fixe et doit pouvoir défiler normalement */
body.page-creators.page-creators-detail,
body.page-creators:has(.creator-header) {
    overflow: auto !important;
    height: auto !important;
    max-height: none !important;
}

body.page-creators.page-creators-detail .main-content,
body.page-creators.page-creators-detail main,
body.page-creators:has(.creator-header) .main-content,
body.page-creators:has(.creator-header) main {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

body.page-creators.page-creators-detail .section,
body.page-creators:has(.creator-header) .section {
    flex: none !important;
    min-height: auto !important;
    overflow: visible !important;
    padding: 2rem 0 !important;
}

body.page-creators.page-creators-detail .section > .container,
body.page-creators:has(.creator-header) .section > .container {
    height: auto !important;
    max-height: none !important;
    display: block !important;
}

body.page-creators.page-creators-detail .footer,
body.page-creators.page-creators-detail footer,
body.page-creators:has(.creator-header) .footer,
body.page-creators:has(.creator-header) footer {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
}
@media (max-width: 1024px) {
    body.page-creators .creators-layout {
        grid-template-columns: 280px 1fr;
        gap: 1rem;
    }
}

/* === RESPONSIVE - MOBILE === */
@media (max-width: 768px) {
    body.page-creators {
        overflow: auto !important;
        height: auto !important;
        max-height: none !important;
    }
    
    body.page-creators .main-content,
    body.page-creators main {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    body.page-creators .section {
        overflow: visible !important;
        flex: none !important;
        padding: 1rem 0 !important;
    }
    
    body.page-creators .section > .container {
        height: auto !important;
        max-height: none !important;
        display: block !important;
        padding: 0 1rem !important;
    }
    
    body.page-creators .creators-layout {
        height: auto !important;
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    /* Bouton toggle filtres mobile */
    body.page-creators .mobile-filters-toggle {
        display: flex !important;
        order: 1 !important;
        margin-bottom: 1rem !important;
        position: relative !important;
        z-index: 100 !important;
        pointer-events: auto !important;
        width: 100% !important;
        cursor: pointer !important;
    }
    
    body.page-creators .creators-sidebar {
        position: fixed !important;
        top: 80px !important;
        left: 0 !important;
        height: calc(100dvh - 80px) !important;
        max-height: calc(100dvh - 80px) !important;
        width: min(340px, 88vw) !important;
        transform: translateX(-105%) !important;
        transition: transform 0.3s ease !important;
        z-index: 1000 !important;
        border-radius: 0 14px 14px 0 !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25) !important;
        background: white !important;
    }
    
    body.page-creators .creators-sidebar.active {
        transform: translateX(0) !important;
    }
    
    body.page-creators .filters-close {
        display: block !important;
    }
    
    body.page-creators .creators-main {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
        order: 2 !important;
    }
    
    body.page-creators .creators-scroll-container {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }
    
    body.page-creators .creator-grid {
        overflow: visible !important;
        max-height: none !important;
        padding: 0.5rem !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    body.page-creators .footer,
    body.page-creators footer {
        display: none !important;
        visibility: hidden !important;
    }
    
    body.page-creators .creators-toolbar {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    body.page-creators .pagination-wrapper {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
    }
    
    /* Mode sombre mobile */
    html[data-theme="dark"] body.page-creators .creators-sidebar {
        background: #1e293b !important;
    }
}

/* === RESPONSIVE - PETIT MOBILE === */
@media (max-width: 480px) {
    body.page-creators .creator-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    body.page-creators .creator-card-body {
        padding: 0.5rem !important;
    }
    
    body.page-creators .creator-name {
        font-size: 0.8rem !important;
    }
    
    body.page-creators .creator-specialty {
        font-size: 0.7rem !important;
    }
    
    body.page-creators .creator-location {
        font-size: 0.65rem !important;
    }
}
