/**
 * Styles pour le système d'archives - VERSION FINALE
 * Avec: max-width + espaces côtés, 4 colonnes, responsive, plus d'infos
 */

/* === VARIABLES === */
:root {
    --primary-color: #253d89;
    --primary-hover: #3b5bb8;
    --secondary-color: #64748b;
    --accent-color: #dc2626;
    --success-color: #10b981;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --border-primary: rgba(37, 61, 137, 0.15);
    --bg-light: #f3f4f6;
    --bg-beige: #fef3e2;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* === PAGE WRAPPER === */
.archives-page-wrapper {
    background: var(--bg-beige);
    min-height: 100vh;
    padding-bottom: 50px;
}

/* === HEADER === */
.archives-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.archives-title {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.archives-subtitle {
    font-size: 1.2em;
    opacity: 0.95;
    margin: 0;
}

/* === CONTAINER AVEC MAX-WIDTH ET ESPACES CÔTÉS === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === CARTE BLANCHE AVEC BORDURE ET OMBRE - PAS FULL WIDTH === */
.archives-content-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    max-width: 1360px; /* Pas full width */
    margin: 0 auto 30px auto;
    border: 1px solid var(--border-primary); /* Border de 1px */
}

.archives-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

/* === BARRE DE RECHERCHE INLINE (EN BAS DES FILTRES) === */
.archives-search-bar-inline {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.archives-search-bar-inline .search-box {
    display: flex;
    gap: 10px;
    width: 100%;
}

.archives-search-bar-inline .search-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.3s;
}

.archives-search-bar-inline .search-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 61, 137, 0.1);
}

.archives-search-bar-inline .search-button {
    padding: 14px 28px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
}

.archives-search-bar-inline .search-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 61, 137, 0.3);
}

/* === FILTRES SIDEBAR === */
.archives-filters-sidebar {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 25px;
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.filters-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.filters-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: var(--text-dark);
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.filter-label .dashicons {
    color: var(--primary-color);
    font-size: 18px;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 61, 137, 0.1);
}

.filter-select:disabled {
    background: #f9fafb;
    cursor: not-allowed;
    opacity: 0.6;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.date-separator {
    color: var(--primary-color);
    font-weight: bold;
}

.filter-help {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
}

.filter-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.clear-all-filters {
    width: 100%;
    padding: 12px;
    background: var(--bg-white);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.clear-all-filters:hover {
    background: var(--accent-color);
    color: white;
}

/* === STATISTIQUES === */
.archives-stats {
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.archives-stats h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: var(--text-dark);
}

.archives-stats ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archives-stats li {
    padding: 8px 0;
    color: var(--text-light);
    border-bottom: 1px solid var(--bg-light);
}

.archives-stats li:last-child {
    border-bottom: none;
}

.archives-stats strong {
    color: var(--primary-color);
    font-size: 1.2em;
}

/* === ZONE PRINCIPALE === */
.archives-main-content {
    min-height: 600px;
}

.active-filters-container {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.results-count {
    font-size: 1.1em;
    color: var(--text-dark);
}

.loading-overlay {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === GRILLE 4 COLONNES === */
.archives-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 COLONNES */
    gap: 20px;
}

/* === CARTE D'ARCHIVE AVEC PLUS D'INFOS === */
.archive-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.archive-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.archive-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.archive-card-image {
    position: relative;
    padding-top: 133.33%; /* Ratio 3:4 */
    background: var(--bg-light);
    overflow: hidden;
}

.archive-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.placeholder-image .dashicons {
    font-size: 60px;
    color: var(--primary-color);
    opacity: 0.3;
}

.archive-card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.archive-card-type {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
    align-self: flex-start;
}

.archive-card-title {
    font-size: 0.95em;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-dark);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === PLUS D'INFOS SUR LES CARTES === */
.archive-card-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.meta-author,
.meta-date,
.meta-description {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
}

.meta-author .dashicons,
.meta-date .dashicons {
    font-size: 16px;
    flex-shrink: 0;
}

.meta-description {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
}

.archive-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-details {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.archive-card:hover .view-details {
    transform: translateX(5px);
}

/* === PAGINATION === */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-link {
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 600;
}

.pagination-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-link.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* === RESPONSIVE === */

/* Tablettes (3 colonnes) */
@media (max-width: 1200px) {
    .archives-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .archives-content-card {
        padding: 30px;
    }
}

/* Tablettes portrait (2 colonnes) */
@media (max-width: 1024px) {
    .archives-layout {
        grid-template-columns: 1fr;
    }
    
    .archives-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .archives-filters-sidebar {
        position: static;
        margin-bottom: 25px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .archives-content-card {
        padding: 25px;
        margin: 0 10px 20px 10px;
    }
}

/* Mobile (1 colonne) */
@media (max-width: 768px) {
    .archives-title {
        font-size: 1.8em;
    }
    
    .archives-subtitle {
        font-size: 1em;
    }
    
    .archives-grid {
        grid-template-columns: 1fr;
    }
    
    .archives-search-bar-inline .search-box {
        flex-direction: column;
    }
    
    .archives-search-bar-inline .search-button {
        width: 100%;
        justify-content: center;
    }
    
    .archives-content-card {
        padding: 20px;
        margin: 0 5px 15px 5px;
    }
    
    .archive-card-title {
        font-size: 0.9em;
    }
}

/* Très petit mobile */
@media (max-width: 480px) {
    .archives-header {
        padding: 40px 15px;
    }
    
    .archives-title {
        font-size: 1.5em;
    }
    
    .archives-content-card {
        padding: 15px;
        border-radius: var(--radius-sm);
    }
}

/* === PAGE SINGLE === */
.archive-single-page {
    background: var(--bg-beige);
    min-height: 100vh;
    padding-bottom: 50px;
}

.archive-breadcrumb {
    background: white;
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-primary);
}

.archive-single-container {
    max-width: 1360px; /* Pas full width */
    margin: 0 auto;
    padding: 0 20px;
}

.archive-single-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.archive-main-column {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    border: 1px solid var(--border-primary); /* Border 1px */
}

/* Responsive Single */
@media (max-width: 1024px) {
    .archive-single-layout {
        grid-template-columns: 1fr;
    }
    
    .archive-main-column {
        padding: 25px;
    }
}

.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-primary); /* Border 1px */
    margin-bottom: 20px;
}

/* === MESSAGE PAS DE RÉSULTATS === */
.no-archives-found {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

.no-archives-found p {
    font-size: 1.1em;
    color: var(--text-light);
    margin: 10px 0;
}
/**
 * CSS POUR LES COMPTEURS DE VUES
 * 
 * À ajouter dans : assets/css/archives-style.css
 * OU dans : Apparence → Personnaliser → CSS additionnel
 */

/* ================================================
   COMPTEUR DE VUES - Style Général
   ================================================ */

.archive-views-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.archive-views-count .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #0073aa;
}

.archive-views-count .views-number {
    color: #333;
    font-weight: 600;
}

.archive-views-count .views-text {
    color: #666;
    font-weight: 400;
    font-size: 13px;
}

/* ================================================
   COMPTEUR SUR LES CARTES (Cards)
   ================================================ */

.archive-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.archive-card-footer .footer-left {
    flex: 0 0 auto;
}

.archive-card-footer .footer-right {
    flex: 1;
    text-align: right;
}

/* Compteur sur les cartes - plus compact */
.archive-card .archive-views-count {
    font-size: 13px;
    color: #666;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 10px;
    border-radius: 12px;
}

.archive-card .archive-views-count .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #0073aa;
}

.archive-card .archive-views-count .views-number {
    color: #0073aa;
    font-weight: 700;
}

/* Animation au survol */
.archive-card:hover .archive-views-count {
    background: rgba(0, 115, 170, 0.1);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* ================================================
   COMPTEUR SUR PAGE SINGLE
   ================================================ */

.document-views-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border-left: 3px solid #0073aa;
    border-radius: 5px;
    margin: 15px 0;
}

.document-views-display .archive-views-count {
    font-size: 15px;
    color: #0073aa;
}

.document-views-display .views-number {
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
}

/* ================================================
   DOCUMENTS POPULAIRES (Widget/Shortcode)
   ================================================ */

/* Liste des populaires */
.archives-liste-populaires {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archives-liste-populaires li {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.archives-liste-populaires li:hover {
    background: #f8f9fa;
}

.archives-liste-populaires li a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
}

.archives-liste-populaires li a:hover {
    color: #0073aa;
}

.archives-liste-populaires .archive-views-count {
    margin-left: 10px;
    font-size: 12px;
}

/* Grille des populaires */
.archives-grille-populaires {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.archive-card-populaire {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.archive-card-populaire .card-thumbnail {
    position: relative;
    padding-top: 66.67%; /* Ratio 3:2 */
    background: #f0f0f0;
    overflow: hidden;
}

.archive-card-populaire .card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-card-populaire .card-content {
    padding: 15px;
}

.archive-card-populaire .card-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.4;
}

.archive-card-populaire .card-title a {
    color: #333;
    text-decoration: none;
}

.archive-card-populaire .card-title a:hover {
    color: #0073aa;
}

.archive-card-populaire .card-views {
    display: flex;
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* ================================================
   BADGE DE POPULARITÉ
   ================================================ */

/* Badge "Populaire" sur les documents très consultés */
.popular-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(238, 90, 36, 0.3);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
}

.popular-badge::before {
    content: "🔥";
    font-size: 14px;
}

/* Badge sur les cartes */
.archive-card-image {
    position: relative;
}

.archive-card.is-popular .popular-badge {
    /* Badge visible sur les cartes populaires */
    display: flex;
}

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

@media (max-width: 768px) {
    .archive-card-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .archive-card-footer .footer-right {
        text-align: left;
        width: 100%;
    }
    
    .archives-grille-populaires {
        grid-template-columns: 1fr;
    }
    
    .archive-views-count {
        font-size: 12px;
    }
    
    .document-views-display {
        padding: 8px 12px;
    }
    
    .document-views-display .views-number {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .archive-card .archive-views-count {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .archive-card .archive-views-count .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
}

/* ================================================
   WIDGET ADMIN - Documents Populaires
   ================================================ */

#archives_popular_docs .wp-list-table td {
    vertical-align: middle;
}

#archives_popular_docs .dashicons-visibility {
    vertical-align: middle;
    margin-right: 3px;
}

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

@keyframes viewCountUp {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.archive-views-count.just-viewed {
    animation: viewCountUp 0.3s ease;
}

/* ================================================
   VARIANTES DE COULEURS
   ================================================ */

/* Version verte pour certains contextes */
.archive-views-count.green {
    color: #27ae60;
}

.archive-views-count.green .dashicons {
    color: #27ae60;
}

.archive-views-count.green .views-number {
    color: #27ae60;
}

/* Version rouge pour les très populaires */
.archive-views-count.hot {
    color: #e74c3c;
}

.archive-views-count.hot .dashicons {
    color: #e74c3c;
}

.archive-views-count.hot .views-number {
    color: #e74c3c;
}

/* ================================================
   UTILITAIRES
   ================================================ */

.hide-on-mobile .archive-views-count .views-text {
    display: inline;
}

@media (max-width: 480px) {
    .hide-on-mobile .archive-views-count .views-text {
        display: none;
    }
}

/* Badge numéroté pour le top 3 */
.top-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
    margin-right: 8px;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.top-rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
}

.top-rank-badge.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
}

.top-rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
}
/**
 * CSS POUR STATISTIQUES AVANCÉES
 * 
 * À ajouter dans : assets/css/archives-style.css
 * OU dans : Apparence → Personnaliser → CSS additionnel
 */

/* ================================================
   STATISTIQUES GÉNÉRALES - Widget
   ================================================ */

.archives-stats-widget {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

/* Style Cards (par défaut) */
.archives-stats-widget.style-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.archives-stats-widget.style-inline {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.archives-stats-widget.style-boxes {
    grid-template-columns: repeat(2, 1fr);
}

.archives-stats-widget .stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.archives-stats-widget .stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Couleurs différentes par type */
.archives-stats-widget .stat-item.total-docs {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.archives-stats-widget .stat-item.types-count {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.archives-stats-widget .stat-item.themes-count {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.archives-stats-widget .stat-item.locations-count {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.archives-stats-widget .stat-item.views-count {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.archives-stats-widget .stat-icon {
    font-size: 48px;
    line-height: 1;
    opacity: 0.9;
}

.archives-stats-widget .stat-content {
    flex: 1;
}

.archives-stats-widget .stat-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 5px;
}

.archives-stats-widget .stat-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================
   GRILLE DE TAXONOMIES (Types, Thématiques, etc)
   ================================================ */

.archives-taxonomy-grid {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.archives-taxonomy-grid.columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.archives-taxonomy-grid.columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.archives-taxonomy-grid.columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.archives-taxonomy-grid.columns-5 {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Carte de Taxonomie */
.taxonomy-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.taxonomy-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.taxonomy-card.clickable {
    cursor: pointer;
}

.taxonomy-card .card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Image de la carte (pour types) */
.taxonomy-card .card-image {
    position: relative;
    padding-top: 60%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.taxonomy-card .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.taxonomy-card .card-image .placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    color: rgba(255, 255, 255, 0.8);
}

/* Contenu de la carte */
.taxonomy-card .card-content {
    padding: 20px;
}

.taxonomy-card .card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.taxonomy-card .card-count {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 10px;
}

.taxonomy-card .count-number {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.taxonomy-card .count-label {
    font-size: 14px;
    color: #666;
}

.taxonomy-card .card-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 10px 0 0 0;
}

/* Badge parent (pour thématiques) */
.taxonomy-card .parent-badge {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Icônes pour thématiques et localisations */
.taxonomy-card .theme-icon,
.taxonomy-card .location-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
    opacity: 0.8;
}

/* Compteur d'enfants */
.taxonomy-card .children-count {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.taxonomy-card .children-count small {
    color: #999;
    font-size: 12px;
}

/* ================================================
   STATISTIQUES PAR LANGUE
   ================================================ */

.archives-languages-stats {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 30px 0;
}

.archives-languages-stats .stats-title {
    margin: 0 0 25px 0;
    font-size: 24px;
    color: #333;
}

/* Style Barres */
.language-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.language-bar-item {
    display: grid;
    grid-template-columns: 200px 1fr 150px;
    align-items: center;
    gap: 15px;
}

.language-bar-item .language-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.language-bar-item .flag {
    font-size: 24px;
}

.language-bar-item .bar-container {
    background: #f0f0f0;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
}

.language-bar-item .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 1s ease;
    border-radius: 15px;
}

.language-bar-item .language-count {
    text-align: right;
}

.language-bar-item .percentage {
    color: #666;
    font-size: 14px;
}

/* Style Liste */
.archives-languages-stats.style-list .language-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archives-languages-stats.style-list .language-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.archives-languages-stats.style-list .language-list li:last-child {
    border-bottom: none;
}

.archives-languages-stats.style-list .flag {
    font-size: 24px;
}

/* ================================================
   PAGE DE RECHERCHE COMPLÈTE
   ================================================ */

.archives-search-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* En-tête de page */
.archives-search-page .search-page-header {
    text-align: center;
    margin-bottom: 50px;
}

.archives-search-page .page-title {
    font-size: 42px;
    margin: 0 0 15px 0;
    color: #333;
}

.archives-search-page .page-description {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Sections */
.archives-search-page .section-block {
    margin: 60px 0;
}

.archives-search-page .section-title {
    font-size: 32px;
    margin: 0 0 10px 0;
    color: #333;
}

.archives-search-page .section-description {
    font-size: 16px;
    color: #666;
    margin: 0 0 30px 0;
}

.archives-search-page .stats-section {
    margin-bottom: 50px;
}

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

@media (max-width: 992px) {
    .archives-taxonomy-grid.columns-3,
    .archives-taxonomy-grid.columns-4,
    .archives-taxonomy-grid.columns-5 {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .archives-stats-widget {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .language-bar-item {
        grid-template-columns: 150px 1fr 120px;
    }
}

@media (max-width: 768px) {
    .archives-taxonomy-grid {
        grid-template-columns: 1fr;
    }
    
    .archives-stats-widget {
        grid-template-columns: 1fr;
    }
    
    .archives-search-page .page-title {
        font-size: 32px;
    }
    
    .archives-search-page .section-title {
        font-size: 24px;
    }
    
    .language-bar-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .language-bar-item .language-count {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .archives-stats-widget .stat-icon {
        font-size: 36px;
    }
    
    .archives-stats-widget .stat-number {
        font-size: 24px;
    }
    
    .taxonomy-card .count-number {
        font-size: 20px;
    }
    
    .archives-search-page {
        padding: 20px 15px;
    }
}

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

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

.taxonomy-card {
    animation: fadeIn 0.5s ease;
}

.stat-item {
    animation: fadeIn 0.5s ease;
}

/* Délai d'animation progressif */
.taxonomy-card:nth-child(1) { animation-delay: 0.05s; }
.taxonomy-card:nth-child(2) { animation-delay: 0.1s; }
.taxonomy-card:nth-child(3) { animation-delay: 0.15s; }
.taxonomy-card:nth-child(4) { animation-delay: 0.2s; }
.taxonomy-card:nth-child(5) { animation-delay: 0.25s; }
.taxonomy-card:nth-child(6) { animation-delay: 0.3s; }

/* ================================================
   THÈMES DE COULEURS ALTERNATIFS
   ================================================ */

/* Thème vert */
.archives-search-page.theme-green .taxonomy-card:hover {
    border-color: #27ae60;
}

.archives-search-page.theme-green .count-number {
    color: #27ae60 !important;
}

/* Thème bleu */
.archives-search-page.theme-blue .taxonomy-card:hover {
    border-color: #3498db;
}

.archives-search-page.theme-blue .count-number {
    color: #3498db !important;
}

/* ================================================
   UTILITAIRES
   ================================================ */

.text-center {
    text-align: center;
}

.mb-30 {
    margin-bottom: 30px;
}

.mt-30 {
    margin-top: 30px;
}

/* Badge de nouveauté */
.new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
}

/* Badge populaire */
.popular-taxonomy-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
    z-index: 10;
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    .archives-stats-widget .stat-item {
        break-inside: avoid;
    }
    
    .taxonomy-card {
        break-inside: avoid;
    }
    
    .archives-taxonomy-grid {
        display: block;
    }
    
    .taxonomy-card {
        margin-bottom: 20px;
    }
}
/**
 * CORRECTIONS CSS - RECHERCHE
 * 
 * 1. Barre existante dans archive-archive_doc.php (input plus large)
 * 2. Shortcode auto-complétion (style arrondi sans espace)
 * 
 * À ajouter dans : assets/css/archives-style.css
 * OU dans : Apparence → Personnaliser → CSS additionnel
 */

/* ================================================
   1. BARRE DE RECHERCHE DANS ARCHIVE (Existante)
   Input prend PLUS d'espace que le bouton
   ================================================ */

.archives-search-bar-inline .search-box {
    display: flex;
    gap: 10px;
    width: 100%;
}

.archives-search-bar-inline .search-input {
    flex: 4; /* Input prend 3 parts */
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.3s;
    min-width: 0; /* Important pour éviter overflow */
}

.archives-search-bar-inline .search-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 61, 137, 0.1);
}

.archives-search-bar-inline .search-button {
    flex: 1; /* Bouton prend 1 part */
    flex-shrink: 0; /* Ne rétrécit jamais */
    padding: 14px 28px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    min-width: fit-content; /* S'adapte au contenu */
}

.archives-search-bar-inline .search-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 61, 137, 0.3);
}

/* Mobile : Bouton en bas */
@media (max-width: 768px) {
    .archives-search-bar-inline .search-box {
        flex-direction: column;
    }
    
    .archives-search-bar-inline .search-button {
        width: 100%;
        flex: none;
    }
}

/* ================================================
   2. SHORTCODE AUTO-COMPLÉTION [archives_search_bar]
   Style arrondi SANS espace blanc
   ================================================ */

/* Conteneur principal */
.archives-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.archives-search-form {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch; /* CORRECTION: stretch pour éliminer espace */
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50px; /* Style arrondi original */
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Icône de recherche */
.search-icon {
    font-size: 18px;
    padding: 0 12px 0 20px;
    color: #999;
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Ne rétrécit jamais */
}

/* Champ de saisie */
.archives-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 10px; /* CORRECTION: padding égal */
    font-size: 16px;
    background: transparent;
    color: #333;
    min-width: 0; /* CORRECTION: permet la réduction */
}

.archives-search-input::placeholder {
    color: #999;
}

/* Bouton de soumission */
.search-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px; /* CORRECTION: padding cohérent */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0; /* CORRECTION: empêche la compression */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.search-submit-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}

.search-submit-btn:active {
    transform: scale(0.98);
}

/* Icône dans le bouton (mobile) */
.search-submit-btn .btn-icon {
    display: none;
}

.search-submit-btn .btn-text {
    display: inline;
}

/* ================================================
   DROPDOWN DES RÉSULTATS
   ================================================ */

.archives-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.3s ease;
    border: 1px solid #e0e0e0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-content {
    max-height: 500px;
    overflow-y: auto;
}

/* Scrollbar */
.search-results-content::-webkit-scrollbar {
    width: 6px;
}

.search-results-content::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.search-results-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ================================================
   LISTE DES RÉSULTATS
   ================================================ */

.search-results-list {
    padding: 4px 0;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover,
.result-item.active {
    background: #f8f9fa;
}

/* Image miniature */
.result-thumbnail {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-thumbnail.no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.result-thumbnail .placeholder-icon {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
}

/* Contenu du résultat */
.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.result-title mark {
    background: #fff3cd;
    color: #856404;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 700;
}

/* Métadonnées */
.result-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #666;
}

.result-type {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.result-date,
.result-author {
    color: #999;
    font-size: 11px;
}

/* ================================================
   LIEN "VOIR TOUS LES RÉSULTATS"
   ================================================ */

.search-view-all {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.search-view-all a {
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.search-view-all a:hover {
    color: #5568d3;
}

/* ================================================
   MESSAGES ET ÉTATS
   ================================================ */

.search-loading {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.search-no-results {
    text-align: center;
    padding: 30px 20px;
}

.no-results-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-no-results p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.search-tips {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-top: 8px;
}

/* Lien vers filtres */
.search-filter-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: #667eea;
    color: white !important;
    text-decoration: none;
    border-radius: 50px; /* Arrondi */
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.search-filter-link:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-error {
    text-align: center;
    padding: 30px 20px;
    color: #dc3545;
}

.search-min-chars {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 13px;
}

/* ================================================
   RESPONSIVE - MOBILE
   ================================================ */

@media (max-width: 768px) {
    .archives-search-wrapper {
        max-width: 100%;
    }
    
    /* Version mobile : Bouton icône */
    .search-submit-btn {
        padding: 15px 18px;
        min-width: auto;
    }
    
    .search-submit-btn .btn-text {
        display: none; /* Cache le texte */
    }
    
    .search-submit-btn .btn-icon {
        display: inline; /* Affiche l'icône */
        font-size: 16px;
    }
    
    .result-item {
        padding: 8px 12px;
        gap: 10px;
    }
    
    .result-thumbnail {
        width: 45px;
        height: 45px;
    }
    
    .result-title {
        font-size: 13px;
    }
    
    .archives-search-results {
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .search-icon {
        padding: 0 10px 0 15px;
        font-size: 16px;
    }
    
    .archives-search-input {
        padding: 12px 8px;
        font-size: 15px;
    }
    
    .search-submit-btn {
        padding: 12px 16px;
    }
    
    .result-thumbnail {
        width: 40px;
        height: 40px;
    }
}

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

.archives-search-input:focus {
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

.result-item:focus {
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

.search-submit-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Réduire animations si préférence */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}