/* ================================
   SÉLECTEUR TYPE DE CONTENU
   ================================ */

.content-type-selector {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    border-bottom: none;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.content-type-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px 0;
    padding: 8px 0 0 0;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    position: sticky;
    top: var(--senami-tabs-top, 120px);
    z-index: 85;
    background: var(--gray-50, #f9fafb);
}

body.dark .content-type-bar {
    border-bottom-color: var(--gray-700);
    background: #0a1f1a;
}

.biz-register-cta,
.serp-action-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin: 0 0 6px 0;
    padding: 9px 16px;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.serp-action-cta i {
    font-size: 0.9rem;
    opacity: 0.95;
}

.serp-action-cta--biz,
.biz-register-cta {
    background: linear-gradient(180deg, #187868 0%, #0e7463 100%);
    color: #fff !important;
    border-color: #0c6456;
}

.serp-action-cta--biz:hover,
.biz-register-cta:hover {
    background: linear-gradient(180deg, #2b8a78 0%, #007a62 100%);
    box-shadow: 0 4px 14px rgba(0, 152, 121, 0.28);
    transform: translateY(-1px);
}

.serp-action-cta--job {
    background: linear-gradient(180deg, #6d5efc 0%, #5b4cdb 100%);
    color: #fff !important;
    border-color: #4f3fcf;
}

.serp-action-cta--job:hover {
    background: linear-gradient(180deg, #7b6cff 0%, #5240d4 100%);
    box-shadow: 0 4px 14px rgba(91, 76, 219, 0.3);
    transform: translateY(-1px);
}

.serp-action-cta:active,
.biz-register-cta:active {
    transform: translateY(0) scale(0.98);
}

.serp-action-cta[hidden],
.biz-register-cta[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .content-type-bar {
        display: block;
        overflow: visible;
        margin: 0 0 8px;
        padding: 0;
    }
    .content-type-selector {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        gap: 0;
    }
    .content-type-btn {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        white-space: normal;
        min-width: 0;
        padding: 8px 2px 6px;
        font-size: 0.68rem;
        line-height: 1.15;
        gap: 2px;
    }
}

@media (max-width: 640px) {
    .content-type-bar {
        align-items: flex-end;
    }
    .serp-action-cta,
    .biz-register-cta {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
}

.content-type-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
}

body.dark .content-type-btn {
    color: var(--gray-400);
}

.content-type-btn i {
    font-size: 1rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
}

.content-type-btn:hover {
    color: var(--emerald);
}

body.dark .content-type-btn:hover {
    color: #00d9a3;
}

.content-type-btn:hover i {
    transform: scale(1.1);
    opacity: 1;
}

.content-type-btn.active {
    color: var(--emerald);
    border-bottom-color: var(--emerald);
    font-weight: 500;
}

body.dark .content-type-btn.active {
    color: #00d9a3;
    border-bottom-color: #00d9a3;
}

.content-type-btn.active i {
    transform: scale(1.05);
    opacity: 1;
}

/* Animation ultra fluide au clic */
.content-type-btn:active {
    transform: scale(0.95);
}

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

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

/* ================================
   PRÉSENTATION IMAGES
   ================================ */

.results-grid-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.image-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1.5px solid var(--gray-200, #e5e7eb);
    display: flex;
    flex-direction: column;
}

.image-card > a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

body.dark .image-card {
    background: var(--gray-800, #1f2937);
    border-color: var(--gray-700, #374151);
}

.image-card:hover {
    border-color: var(--emerald, #0e7463);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

body.dark .image-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Wrapper image avec ratio fixe */
.image-card-thumb-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 66%;
    background: var(--gray-100, #f3f4f6);
    overflow: hidden;
    flex-shrink: 0;
}

.image-card-open {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 1;
}

.image-card-download {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.94);
    color: var(--gray-800, #1f2937);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.image-card:hover .image-card-download,
.image-card-download:focus {
    opacity: 1;
}

.image-card-download:hover {
    background: var(--emerald, #0e7463);
    color: #fff;
}

@media (hover: none) {
    .image-card-download { opacity: 1; }
}

body.dark .image-card-thumb-wrap {
    background: var(--gray-700, #374151);
}

.image-card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay léger (sans zoom) */
.image-card-thumb-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 55%,
        rgba(0, 0, 0, 0.28) 100%
    );
    opacity: 0.85;
    pointer-events: none;
}

.image-card-zoom {
    display: none !important;
}

/* Badge source en haut à gauche */
.image-card-source-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    padding: 3px 8px 3px 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
    opacity: 0;
    transition: opacity 0.25s ease;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark .image-card-source-badge {
    background: rgba(31,41,55,0.92);
    color: var(--gray-200, #e5e7eb);
}

.image-card:hover .image-card-source-badge {
    opacity: 1;
}

/* Pied de carte */
.image-card-overlay {
    background: white;
    padding: 12px 14px 13px;
    border-top: 1.5px solid var(--gray-100, #f0f1f3);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.dark .image-card-overlay {
    background: var(--gray-800, #1f2937);
    border-top-color: var(--gray-700, #374151);
}

.image-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

body.dark .image-card-title {
    color: var(--gray-100, #f3f4f6);
}

.image-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
}

.image-card-source {
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark .image-card-source {
    color: var(--gray-400, #9ca3af);
}

/* Placeholder sans image */
.image-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--gray-400, #9ca3af);
    background: var(--gray-50, #f9fafb);
    font-size: 0.8rem;
}

body.dark .image-card-placeholder {
    background: var(--gray-700, #374151);
}

/* Shimmer skeleton loading */
.image-card-thumb:not(.loaded) {
    background: linear-gradient(
        110deg,
        var(--gray-200, #e5e7eb) 8%,
        var(--gray-100, #f3f4f6) 18%,
        var(--gray-200, #e5e7eb) 33%
    );
    background-size: 200% 100%;
    animation: shimmerFast 0.8s ease-in-out infinite;
}

.image-card-thumb.loaded {
    animation: none;
    background: none;
}


/* ================================
   PRÉSENTATION VIDÉOS
   ================================ */

.results-grid-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .results-grid-videos { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .results-grid-videos {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 8px;
        width: 100%;
        min-width: 0;
    }
    .video-card {
        min-width: 0;
        max-width: 100%;
    }
    .video-card:hover {
        transform: none;
    }
    .video-platform-badge {
        opacity: 1;
        max-width: calc(100% - 20px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .video-card-body {
        padding: 12px 12px 14px;
        min-width: 0;
    }
    .video-card-title {
        -webkit-line-clamp: 3;
        overflow-wrap: anywhere;
    }
    .video-card-meta {
        min-width: 0;
    }
    .video-card-domain {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .video-play-overlay {
        width: 46px;
        height: 46px;
    }
}

.video-card {
    background: white;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}

body.dark .video-card {
    background: var(--gray-800, #1f2937);
    border-color: var(--gray-700, #374151);
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.13);
    border-color: var(--emerald, #0e7463);
}

body.dark .video-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

/* Thumbnail 16:9 */
.video-card-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: var(--gray-900, #111827);
    overflow: hidden;
    flex-shrink: 0;
}

.video-card-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.video-card:hover .video-card-thumbnail {
    transform: scale(1.06);
}

/* Dégradé sombre bas de thumbnail */
.video-card-thumbnail-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 35%,
        rgba(0,0,0,0.55) 100%
    );
    pointer-events: none;
    transition: opacity 0.28s ease;
    opacity: 0.6;
}

.video-card:hover .video-card-thumbnail-wrapper::after {
    opacity: 0.9;
}

/* Bouton play centré */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-900, #111827);
    font-size: 1.1rem;
    transition:
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.2s ease,
        box-shadow 0.25s ease;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    padding-left: 4px; /* optique triangle play */
}

.video-card:hover .video-play-overlay {
    background: var(--emerald, #0e7463);
    color: white;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 8px 28px rgba(0, 152, 121, 0.5);
}

/* Badge plateforme */
.video-platform-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    background: rgba(0,0,0,0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .video-platform-badge {
    opacity: 1;
}

/* Corps */
.video-card-body {
    padding: 14px 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.video-card-title a {
    color: inherit;
    text-decoration: none;
}

.video-card-title a:hover {
    color: var(--emerald, #0e7463);
}

body.dark .video-card-title {
    color: white;
}

/* Ligne meta : favicon + domaine + date */
.video-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.79rem;
    color: var(--gray-500, #6b7280);
    flex-wrap: wrap;
}

.video-card-favicon {
    border-radius: 2px;
    opacity: 0.85;
    flex-shrink: 0;
}

.video-card-domain {
    font-weight: 600;
    color: var(--gray-600, #4b5563);
}

body.dark .video-card-domain {
    color: var(--gray-400, #9ca3af);
}

.video-card-dot {
    color: var(--gray-300, #d1d5db);
}


/* ================================
   PRÉSENTATION DOCUMENTS - STYLE INSTITUTIONNEL
   ================================ */

/* ================================
   DOCUMENTS – GRILLE MODERNE
   ================================ */

.results-grid-docs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .results-grid-docs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .results-grid-docs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .results-grid-docs { grid-template-columns: 1fr; gap: 12px; }
}

/* Liste documents (présentation lisible) */
.results-list-docs {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.results-empty-docs {
    color: var(--gray-500, #6b7280);
    padding: 32px 12px;
    text-align: center;
    font-size: 0.95rem;
}

.doc-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px 18px;
    align-items: start;
    background: white;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    border-radius: 14px;
    padding: 16px 18px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    animation: cardEntrance 0.35s ease both;
}

.doc-row:hover {
    border-color: var(--doc-accent, var(--emerald, #0e7463));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.dark .doc-row {
    background: var(--gray-800, #1f2937);
    border-color: var(--gray-700, #374151);
}

.doc-row-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--doc-bg, #f9fafb);
    border: 1px solid var(--doc-border, #e5e7eb);
    color: var(--doc-accent, #6b7280);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
}

.doc-row-icon i {
    font-size: 1.25rem;
}

.doc-row-ext {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.doc-row-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-row-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--gray-900, #111827);
}

.doc-row-title a {
    color: inherit;
    text-decoration: none;
}

.doc-row-title a:hover {
    color: var(--doc-accent, var(--emerald, #0e7463));
}

body.dark .doc-row-title {
    color: white;
}

.doc-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray-500, #6b7280);
}

.doc-row-type {
    font-weight: 600;
    color: var(--doc-accent, #0e7463);
}

.doc-row-snippet {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--gray-700, #374151);
    white-space: normal;
    overflow: visible;
}

body.dark .doc-row-snippet {
    color: var(--gray-300, #d1d5db);
}

.doc-row-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

@media (max-width: 720px) {
    .doc-row {
        grid-template-columns: auto 1fr;
    }
    .doc-row-actions {
        grid-column: 1 / -1;
        flex-direction: row;
    }
}

/* Carte document (legacy / autres vues) */
.doc-card {
    background: white;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.28s ease,
        border-color 0.28s ease;
    cursor: pointer;
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--doc-accent, var(--emerald, #0e7463));
}

body.dark .doc-card {
    background: var(--gray-800, #1f2937);
    border-color: var(--gray-700, #374151);
}

body.dark .doc-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* En-tête coloré */
.doc-card-header {
    background: var(--doc-bg, #f9fafb);
    border-bottom: 2px solid var(--doc-border, #e5e7eb);
    padding: 18px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.dark .doc-card-header {
    border-bottom-color: var(--gray-700, #374151);
    background: var(--gray-700, #374151);
}

.doc-card-icon {
    width: 46px;
    height: 46px;
    background: var(--doc-accent, var(--emerald, #0e7463));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--doc-accent, #0e7463) 40%, transparent);
    flex-shrink: 0;
}

.doc-card-ext-badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--doc-accent, var(--emerald, #0e7463));
    background: white;
    border: 1.5px solid var(--doc-border, #e5e7eb);
    border-radius: 6px;
    padding: 3px 8px;
    text-transform: uppercase;
    white-space: nowrap;
}

body.dark .doc-card-ext-badge {
    background: var(--gray-800, #1f2937);
    border-color: var(--gray-600, #4b5563);
}

/* Corps de la carte */
.doc-card-body {
    padding: 14px 20px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-card-title {
    font-size: 0.97rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--gray-900, #111827);
    margin: 0;
    overflow: visible;
    white-space: normal;
}

.doc-card-title a {
    color: inherit;
    text-decoration: none;
}

.doc-card-title a:hover {
    color: var(--doc-accent, var(--emerald, #0e7463));
}

body.dark .doc-card-title {
    color: white;
}

.doc-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.79rem;
    color: var(--gray-500, #6b7280);
    flex-wrap: wrap;
}

.doc-card-favicon {
    border-radius: 2px;
    flex-shrink: 0;
    opacity: 0.85;
}

.doc-card-domain {
    font-weight: 600;
    color: var(--gray-600, #4b5563);
}

body.dark .doc-card-domain {
    color: var(--gray-400, #9ca3af);
}

.doc-card-dot {
    color: var(--gray-300, #d1d5db);
}

.doc-card-snippet {
    font-size: 0.83rem;
    color: var(--gray-600, #4b5563);
    line-height: 1.55;
    margin: 0;
    flex: 1;
    overflow: visible;
    white-space: normal;
}

body.dark .doc-card-snippet {
    color: var(--gray-400, #9ca3af);
}

/* Pied – actions */
.doc-card-actions {
    padding: 10px 16px;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    display: flex;
    gap: 8px;
    align-items: center;
}

body.dark .doc-card-actions {
    border-top-color: var(--gray-700, #374151);
}

.doc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.81rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.doc-btn-primary {
    background: var(--doc-accent, var(--emerald, #0e7463));
    color: white;
    flex: 1;
}

.doc-btn-primary:hover {
    filter: brightness(0.88);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--doc-accent, #0e7463) 40%, transparent);
}

.doc-btn-secondary {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-600, #4b5563);
    border: 1.5px solid var(--gray-200, #e5e7eb);
    padding: 7px 12px;
    flex-shrink: 0;
}

.doc-btn-secondary:hover {
    background: var(--gray-200, #e5e7eb);
    color: var(--gray-700, #374151);
}

body.dark .doc-btn-secondary {
    background: var(--gray-700, #374151);
    border-color: var(--gray-600, #4b5563);
    color: var(--gray-300, #d1d5db);
}

body.dark .doc-btn-secondary:hover {
    background: var(--gray-600, #4b5563);
}


/* Icône type de document */
.doc-icon {
    width: 60px;
    height: 76px;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

body.dark .doc-icon {
    background: var(--gray-700);
    border-color: var(--gray-600);
}

.doc-icon-type {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.doc-icon-ext {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
}

body.dark .doc-icon-ext {
    color: var(--gray-400);
}

/* Couleurs par type */
.doc-icon.pdf {
    background: #fee;
    border-color: #fcc;
}

.doc-icon.pdf .doc-icon-type {
    color: #dc2626;
}

.doc-icon.docx {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.doc-icon.docx .doc-icon-type {
    color: #2563eb;
}

.doc-icon.xlsx {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.doc-icon.xlsx .doc-icon-type {
    color: #16a34a;
}

.doc-icon.pptx {
    background: #fff7ed;
    border-color: #fed7aa;
}

.doc-icon.pptx .doc-icon-type {
    color: #ea580c;
}

/* Contenu du document */
.doc-content {
    flex: 1;
    min-width: 0;
}

.doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.doc-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark .doc-title {
    color: white;
}

.doc-verified {
    padding: 4px 10px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

body.dark .doc-verified {
    background: rgba(22, 163, 74, 0.2);
}

.doc-description {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark .doc-description {
    color: var(--gray-300);
}

/* Métadonnées du document */
.doc-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-600);
}

body.dark .doc-metadata {
    border-top-color: var(--gray-700);
    color: var(--gray-400);
}

.doc-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-meta-item i {
    color: var(--emerald);
    font-size: 0.9rem;
}

.doc-meta-label {
    font-weight: 600;
    color: var(--gray-700);
}

body.dark .doc-meta-label {
    color: var(--gray-300);
}

/* Actions du document */
.doc-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.doc-action-btn {
    padding: 8px 16px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-700);
    transition: all 0.2s;
}

body.dark .doc-action-btn {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-300);
}

.doc-action-btn:hover {
    background: var(--emerald);
    color: white;
    border-color: var(--emerald);
    transform: translateY(-1px);
}

.doc-action-btn.primary {
    background: var(--emerald);
    color: white;
    border-color: var(--emerald);
}

.doc-action-btn.primary:hover {
    background: var(--emerald-dark);
}

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

@media (max-width: 768px) {
    .results-grid-images {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .image-card-thumb {
        height: 150px;
    }
    
    .results-grid-videos {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .results-grid-docs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ================================
   ANIMATIONS ULTRA-FLUIDES
   ================================ */

/* Animation d'apparition en cascade pour les images */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Animation d'apparition latérale pour les vidéos */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation d'apparition avec rotation légère pour les documents */
@keyframes fadeInRotate {
    from {
        opacity: 0;
        transform: translateY(20px) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

/* Application des animations - IMAGES */
.results-grid-images {
    animation: fadeIn 0.4s ease-out;
}

.image-card {
    opacity: 0;
    animation: fadeInScale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Délais en cascade pour les images */
/* Délais ULTRA RAPIDES en cascade pour les images */
.image-card:nth-child(1) { animation-delay: 0s; }
.image-card:nth-child(2) { animation-delay: 0.02s; }
.image-card:nth-child(3) { animation-delay: 0.04s; }
.image-card:nth-child(4) { animation-delay: 0.06s; }
.image-card:nth-child(5) { animation-delay: 0.08s; }
.image-card:nth-child(6) { animation-delay: 0.1s; }
.image-card:nth-child(7) { animation-delay: 0.12s; }
.image-card:nth-child(8) { animation-delay: 0.14s; }
.image-card:nth-child(9) { animation-delay: 0.16s; }
.image-card:nth-child(10) { animation-delay: 0.18s; }
.image-card:nth-child(11) { animation-delay: 0.2s; }
.image-card:nth-child(12) { animation-delay: 0.22s; }

/* Animation plus rapide pour les images */
.image-card {
    opacity: 0;
    animation: fadeInScale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.results-grid-images {
    animation: fadeIn 0.25s ease-out;
}

/* Application des animations - VIDÉOS */
.results-grid-videos {
    animation: fadeIn 0.4s ease-out;
}

.video-card {
    opacity: 0;
    animation: slideInLeft 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Délais en cascade pour les vidéos */
.video-card:nth-child(1) { animation-delay: 0.05s; }
.video-card:nth-child(2) { animation-delay: 0.1s; }
.video-card:nth-child(3) { animation-delay: 0.15s; }
.video-card:nth-child(4) { animation-delay: 0.2s; }
.video-card:nth-child(5) { animation-delay: 0.25s; }
.video-card:nth-child(6) { animation-delay: 0.3s; }
.video-card:nth-child(7) { animation-delay: 0.35s; }
.video-card:nth-child(8) { animation-delay: 0.4s; }

/* Animation du bouton play au survol */
.video-card:hover .video-play-overlay {
    animation: pulse 0.6s ease-in-out infinite;
}

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

/* Application des animations - DOCUMENTS */
.results-list-docs {
    animation: fadeIn 0.4s ease-out;
}

.doc-card {
    opacity: 0;
    animation: fadeInRotate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Délais en cascade pour les documents */
.doc-card:nth-child(1) { animation-delay: 0.05s; }
.doc-card:nth-child(2) { animation-delay: 0.1s; }
.doc-card:nth-child(3) { animation-delay: 0.15s; }
.doc-card:nth-child(4) { animation-delay: 0.2s; }
.doc-card:nth-child(5) { animation-delay: 0.25s; }
.doc-card:nth-child(6) { animation-delay: 0.3s; }
.doc-card:nth-child(7) { animation-delay: 0.35s; }
.doc-card:nth-child(8) { animation-delay: 0.4s; }

/* Animation de l'icône document au survol */
.doc-card:hover .doc-icon {
    animation: bounce 0.6s ease;
}

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

/* ================================
   ANIMATIONS SUPPLÉMENTAIRES - MICRO-INTERACTIONS
   ================================ */

/* Image hover - Effet de zoom fluide */
.image-card-thumb {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-card:hover .image-card-thumb {
    transform: scale(1.08);
}

/* Overlay image - Glissement fluide */
.image-card-overlay {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badge dimensions - Apparition en fondu */
.image-card-badge {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.image-card:hover .image-card-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Vidéo thumbnail - Effet de profondeur au survol */
.video-card-thumbnail {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.3s ease;
}

.video-card:hover .video-card-thumbnail {
    transform: scale(1.08);
    filter: brightness(1.1);
}

/* Bouton play - Animation d'entrée */
.video-play-overlay {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Badges vidéo - Glissement au survol */
.video-duration,
.video-platform {
    transition: all 0.3s ease;
}

.video-card:hover .video-duration {
    transform: translateY(-2px);
}

.video-card:hover .video-platform {
    transform: translateY(-2px);
}

/* Badge Africa - Pulsation subtile */
.video-card-africa {
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* Document icon - Rotation au survol */
.doc-icon-type {
    transition: none;
}

.doc-result:hover .doc-icon-type {
    transform: none;
}

.doc-card:hover .doc-icon-type {
    transform: rotateY(360deg);
}

/* Document actions - Apparition progressive */
.doc-action-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.doc-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.doc-action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.doc-action-btn:active {
    transform: scale(0.95);
}

/* Badge vérifié - Animation d'attention */
.doc-verified {
    animation: verifiedGlow 3s ease-in-out infinite;
}

@keyframes verifiedGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
    }
}

/* ================================
   ANIMATION LIGHTBOX IMAGE
   ================================ */

/* Lightbox - Apparition dramatique */
.image-lightbox {
    animation: fadeIn 0.3s ease-out;
}

.image-lightbox.active .image-lightbox-content {
    animation: zoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Image lightbox - Effet de focus */
.image-lightbox-img {
    animation: imageFocus 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes imageFocus {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* Info lightbox - Glissement du bas */
.image-lightbox-info {
    animation: slideUp 0.5s ease-out 0.2s both;
}

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

/* Bouton close - Rotation au survol */
.image-lightbox-close {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-lightbox-close:hover {
    transform: rotate(180deg) scale(1.1);
}

/* ================================
   OPTIMISATION PERFORMANCE
   ================================ */

/* Utiliser GPU acceleration pour les transformations */
.image-card,
.video-card,
.doc-card,
.image-card-thumb,
.video-card-thumbnail,
.doc-icon-type {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Limiter le will-change après l'animation */
.image-card,
.video-card,
.doc-card {
    animation-fill-mode: forwards;
}

/* Désactiver les animations pour ceux qui préfèrent */
@media (prefers-reduced-motion: reduce) {
    .image-card,
    .video-card,
    .doc-card,
    .image-lightbox-content,
    .video-play-overlay,
    .doc-icon-type {
        animation: none !important;
        transition: none !important;
    }
    
    .image-card,
    .video-card,
    .doc-card {
        opacity: 1 !important;
    }
}

/* ================================
   ANIMATIONS POUR MODE LOW-DATA
   ================================ */

/* Désactiver les animations gourmandes en mode low-data */
body.low-data .image-card,
body.low-data .video-card,
body.low-data .doc-card {
    animation-duration: 0.2s !important;
}

body.low-data .image-card-thumb,
body.low-data .video-card-thumbnail {
    transition: transform 0.2s !important;
}

body.low-data .video-card-africa,
body.low-data .doc-verified {
    animation: none !important;
}

/* ================================
   RESPONSIVE - ANIMATIONS ADAPTÉES
   ================================ */

@media (max-width: 768px) {
    /* Délais réduits sur mobile pour plus de réactivité */
    .image-card:nth-child(n) { 
        animation-delay: 0.03s !important; 
    }
    
    .video-card:nth-child(n) { 
        animation-delay: 0.03s !important; 
    }
    
    .doc-card:nth-child(n) { 
        animation-delay: 0.03s !important; 
    }
    
    /* Animations plus courtes sur mobile */
        .image-card,
        .video-card,
        .doc-card,
        .doc-result {
            animation-duration: 0.3s !important;
        }
}

/* ================================
   EFFET DE CHARGEMENT PROGRESSIF
   ================================ */

/* Skeleton loading pour les images avant chargement */
.image-card-thumb[loading="lazy"] {
    background: linear-gradient(
        90deg,
        var(--gray-200) 0%,
        var(--gray-100) 50%,
        var(--gray-200) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Effet de chargement terminé */
.image-card-thumb.loaded {
    animation: none;
    background: none;
}

/* ================================
   TRANSITIONS FLUIDES ENTRE FILTRES
   ================================ */

/* Conteneurs principaux */
.results-grid-images,
.results-grid-videos,
.results-list-docs {
    transform-origin: top center;
}

/* Animation de sortie (quand on change de filtre) */
.results-list.fade-out {
    animation: fadeOut 0.2s ease-out forwards;
}

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

/* Effet de survol global plus fluide */
.image-card,
.video-card,
.doc-card,
.doc-result {
    transition: 
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

/* Empêcher les animations pendant le défilement rapide */
.scrolling .image-card,
.scrolling .video-card,
.scrolling .doc-card,
.scrolling .doc-result {
    animation: none !important;
    transition: none !important;
}

/* ================================
   SKELETON LOADING ULTRA RAPIDE
   ================================ */

.image-card-thumb:not(.loaded) {
    background: linear-gradient(
        110deg,
        var(--gray-200) 8%,
        var(--gray-100) 18%,
        var(--gray-200) 33%
    );
    background-size: 200% 100%;
    animation: shimmerFast 0.8s ease-in-out infinite;
}

@keyframes shimmerFast {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Transition instantanée quand l'image est chargée */
.image-card-thumb.loaded {
    animation: none;
    background: none;
    transition: none;
}

/* GPU acceleration pour chargement plus fluide */
.image-card-thumb {
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimisation du rendu des images */
.results-grid-images {
    contain: layout style paint;
    content-visibility: auto;
}

.image-card {
    contain: layout style paint;
    content-visibility: auto;
}

/* ================================
   MOBILE - CHARGEMENT INSTANTANÉ
   ================================ */

@media (max-width: 768px) {
    /* Pas de délai sur mobile - tout apparaît immédiatement */
    .image-card:nth-child(n) { 
        animation-delay: 0s !important;
        animation-duration: 0.25s !important;
    }
    
    .results-grid-images {
        animation-duration: 0.15s !important;
    }
    
    /* Désactiver les animations complexes sur mobile */
    .image-card-overlay {
        transition-duration: 0.2s !important;
    }
    
    .image-card-thumb {
        transition-duration: 0.25s !important;
    }
}

/* Pour les appareils vraiment lents */
@media (max-width: 480px) {
    .image-card {
        animation: none !important;
        opacity: 1 !important;
    }
    
    .results-grid-images {
        animation: fadeIn 0.15s ease-out;
    }
}

/* ================================
   IMAGES - GRILLE RESPONSIVE
   ================================ */

.results-grid-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 16px;
    margin-top: 20px;
}

/* Carte image minimaliste */
.image-result {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.dark .image-result {
    background: var(--gray-800);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.image-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 152, 121, 0.15);
}

/* Conteneur image avec aspect ratio */
.image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gray-100);
    overflow: hidden;
}

body.dark .image-container {
    background: var(--gray-700);
}

/* Image responsive */
.image-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-result:hover .image-thumb {
    transform: scale(1.05);
}

/* Badge dimensions (top-right, discret) */
.image-dimensions {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

/* Badge vérifié (top-left) */
.badge-verified {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: var(--emerald);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Info au hover (bottom overlay) */
.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    transform: translateY(100%);
    transition: transform 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-result:hover .image-info {
    transform: translateY(0);
}

.image-source {
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.source-icon {
    font-size: 0.7rem;
    opacity: 0.8;
}

.image-country {
    font-size: 1rem;
}

/* Low-data mode */
body.low-data .image-thumb {
    display: none;
}

body.low-data .image-container::before {
    content: '📷';
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    opacity: 0.3;
}

/* Mobile */
@media (max-width: 768px) {
    .results-grid-images {
        grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
        gap: 12px;
    }
    
    .image-container {
        aspect-ratio: 1;
    }
    
    .image-dimensions {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}

/* ================================
   VIDÉOS - STYLE YOUTUBE
   ================================ */

.results-grid-videos {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 20px;
}

/* Carte vidéo */
.video-result {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.dark .video-result {
    background: var(--gray-800);
}

.video-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 152, 121, 0.15);
}

/* Thumbnail avec ratio 16:9 */
.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--gray-900);
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-result:hover .video-thumbnail img {
    transform: scale(1.05);
}

/* Bouton play central */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 152, 121, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.video-result:hover .video-play-btn {
    background: var(--emerald);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 3px; /* Centrage optique */
}

/* Badge durée (bottom-right) */
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
}

/* Badge plateforme (top-left) */
.video-platform {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-platform.youtube {
    background: rgba(255, 0, 0, 0.9);
}

.video-platform svg {
    width: 10px;
    height: 10px;
}

/* Métadonnées */
.video-meta {
    padding: 12px;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 8px 0;
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark .video-title {
    color: white;
}

.video-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray-600);
}

body.dark .video-details {
    color: var(--gray-400);
}

/* Source avec avatar */
.video-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.source-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--emerald);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Stats vidéo */
.video-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.video-country {
    margin-left: 4px;
}

/* Badge contenu africain */
.badge-africa {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 12px;
}

/* Mobile */
@media (max-width: 768px) {
    .results-grid-videos {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .video-play-btn {
        width: 48px;
        height: 48px;
    }
    
    .video-play-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ================================
   DOCUMENTS - INTERFACE PROFESSIONNELLE
   ================================ */

.results-list-docs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* Carte document */
.doc-result {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 16px;
    align-items: start;
    transition: all 0.2s ease;
    cursor: pointer;
}

body.dark .doc-result {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

.doc-result:hover {
    border-color: var(--emerald);
    box-shadow: 0 2px 8px rgba(0, 152, 121, 0.1);
    transform: translateX(4px);
}

/* Icône fichier */
.doc-icon {
    width: 64px;
    height: 80px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
}

body.dark .doc-icon {
    border-color: var(--gray-600);
}

/* Coin plié (détail visuel) */
.doc-icon::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, transparent 50%, var(--gray-200) 50%);
    border-top-right-radius: 8px;
}

.doc-icon-type {
    font-size: 2.2rem;
    width: 100%;
    text-align: center;
    transition: none !important;
    display: inline-block;
}

.doc-icon.pdf .doc-icon-type {
    color: #dc2626;
}

.doc-icon.docx .doc-icon-type {
    color: #2563eb;
}

.doc-icon.xlsx .doc-icon-type {
    color: #16a34a;
}

.doc-icon.pptx .doc-icon-type {
    color: #ea580c;
}

.doc-icon-graphic {
    width: 32px;
    height: 32px;
    opacity: 0.8;
}

.doc-ext {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
}

/* Couleurs par type */
.doc-icon.pdf {
    background: #fef2f2;
    border-color: #fecaca;
}

.doc-icon.pdf .doc-ext {
    color: #dc2626;
}

.doc-icon.docx {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.doc-icon.docx .doc-ext {
    color: #2563eb;
}

.doc-icon.xlsx {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.doc-icon.xlsx .doc-ext {
    color: #16a34a;
}

/* Contenu */
.doc-content {
    min-width: 0; /* Fix overflow */
}

.doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.doc-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--gray-900);
}

body.dark .doc-title {
    color: white;
}

/* Badge officiel */
.badge-official {
    padding: 4px 10px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

body.dark .badge-official {
    background: rgba(22, 163, 74, 0.2);
}

/* Description */
.doc-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--gray-700);
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark .doc-description {
    color: var(--gray-300);
}

/* Métadonnées et actions en ligne */
.doc-info-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

.doc-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--gray-600);
    flex: 1;
}

body.dark .doc-metadata {
    color: var(--gray-400);
}

.doc-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Source */
.doc-source {
    font-size: 0.8rem;
    color: var(--emerald);
    font-weight: 500;
    margin: 0;
}

/* Actions */
.doc-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.doc-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.doc-btn i {
    font-size: 0.75rem;
}

.doc-btn.primary {
    background: var(--emerald);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 152, 121, 0.15);
}

.doc-btn.primary:hover {
    background: var(--emerald-dark);
    box-shadow: 0 2px 6px rgba(0, 152, 121, 0.25);
    transform: translateY(-1px);
}

.doc-btn.primary:active {
    transform: translateY(0);
}

.doc-btn.secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

body.dark .doc-btn.secondary {
    background: var(--gray-700);
    color: var(--gray-300);
    border-color: var(--gray-600);
}

.doc-btn.secondary:hover {
    background: var(--gray-150);
    border-color: var(--gray-300);
}

body.dark .doc-btn.secondary:hover {
    background: var(--gray-600);
    border-color: var(--gray-500);
}

/* Mobile */
@media (max-width: 768px) {
    .doc-result {
        grid-template-columns: 56px 1fr;
        gap: 12px;
    }
    
    .doc-icon {
        width: 56px;
        height: 70px;
    }
    
    .doc-actions {
        grid-column: 1 / -1;
        flex-direction: row;
    }
    
    .doc-btn {
        flex: 1;
    }
}

/* ================================
   BADGES SYSTÈME
   ================================ */

/* Badge pays (utilisable partout) */
.badge-country {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

body.dark .badge-country {
    background: var(--gray-700);
}

/* Badge vérifié (système) */
.badge-verified-system {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--emerald);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
}

/* États de chargement */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 0%,
        var(--gray-100) 50%,
        var(--gray-200) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

/* Desktop large */
@media (min-width: 1440px) {
    .results-grid-images {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .results-grid-videos {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .results-grid-images {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .results-grid-videos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 640px) {
    .results-grid-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .results-grid-videos {
        grid-template-columns: 1fr;
    }
    
    .doc-result {
        padding: 12px;
    }
}

/* Optimisation rendu navigateur */
.image-result,
.video-result,
.doc-result {
    contain: layout style paint;
    content-visibility: auto;
}

/* ================================
   MODE LOW-DATA
   ================================ */

body.low-data .image-thumb,
body.low-data .video-thumbnail img {
    display: none;
}

body.low-data .image-container::before,
body.low-data .video-thumbnail::before {
    content: attr(data-type);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    opacity: 0.4;
}

body.low-data .image-container::before {
    content: '📷';
}

body.low-data .video-thumbnail::before {
    content: '🎥';
}

/* Désactiver animations lourdes */
body.low-data * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
}

/* ================================
   VIDÉOS - STYLE YOUTUBE (5 par ligne)
   ================================ */

.results-grid-videos {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 1600px) {
    .results-grid-videos {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .results-grid-videos {
        grid-template-columns: repeat(3, 1fr);
    }
}