/* ═══════════════════════════════════════════════════
   AuraSav — Feuille de styles catégories (categories.css)
   Dépend de home.css pour les variables et composants partagés
   ═══════════════════════════════════════════════════ */

/* ══ NAVBAR : lien actif ══ */
.nav-link-custom.active {
    color: var(--blue-600) !important;
    background: var(--blue-50);
    font-weight: 700;
}

/* ══ BREADCRUMB ══ */
.cat-breadcrumb-wrap { animation: fadeDown 0.5s ease both; }
.cat-breadcrumb {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 100px;
    padding: 0.35rem 1rem;
    display: inline-flex;
    font-size: 0.8rem;
}
.cat-breadcrumb .breadcrumb-item a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color 0.2s;
}
.cat-breadcrumb .breadcrumb-item a:hover { color: #fff; }
.cat-breadcrumb .breadcrumb-item.active { color: rgba(255,255,255,0.45); }
.cat-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.25); }

/* ══ HERO CATÉGORIES ══ */
.cat-hero-section {
    min-height: 72vh;
    background: linear-gradient(160deg, var(--blue-900) 0%, var(--blue-800) 50%, #112c6e 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 5rem 0 3rem;
}

/* Grille de fond */
.cat-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* Orbes décoratifs */
.cat-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.18;
    pointer-events: none;
}
.orb-a {
    width: 500px; height: 500px;
    background: var(--blue-500);
    top: -150px; right: -80px;
}
.orb-b {
    width: 300px; height: 300px;
    background: #6366f1;
    bottom: -60px; left: 5%;
}

/* ─── Recherche hero ─── */
.cat-hero-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-lg);
    padding: 0.6rem 1.2rem;
    margin-top: 2rem;
    transition: border-color 0.3s, background 0.3s;
    animation: fadeUp 0.7s 0.35s ease both;
}
.cat-hero-search:focus-within {
    border-color: rgba(59,130,246,0.6);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}
.cat-hero-search i { color: rgba(255,255,255,0.5); font-size: 1rem; flex-shrink: 0; }
.cat-hero-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95rem;
    font-family: var(--font-body);
}
.cat-hero-search input::placeholder { color: rgba(255,255,255,0.38); }
.cat-hero-search button {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
    display: flex; align-items: center;
}
.cat-hero-search button:hover { color: rgba(255,255,255,0.85); }

/* ─── Cards flottantes hero ─── */
.cat-hero-floats {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding-left: 1rem;
    animation: fadeLeft 0.8s 0.2s ease both;
}
.cat-float-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 1rem 1.3rem;
    color: #fff;
    transition: all 0.3s;
    animation: slideInRight 0.6s ease both;
}
.cat-float-card.delay-0 { animation-delay: 0.3s; }
.cat-float-card.delay-1 { animation-delay: 0.45s; }
.cat-float-card.delay-2 { animation-delay: 0.6s; }
.cat-float-card:hover {
    background: rgba(255,255,255,0.12);
    transform: translateX(-4px);
    border-color: rgba(255,255,255,0.2);
}
.cat-float-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff;
    flex-shrink: 0;
}
.cat-float-info { flex: 1; }
.cat-float-name { font-weight: 700; font-size: 0.9rem; color: #fff; }
.cat-float-count { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 0.1rem; }
.cat-float-badge {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(16,185,129,0.2);
    border: 1px solid rgba(16,185,129,0.4);
    color: #34d399;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; flex-shrink: 0;
}

/* ─── Compteurs globaux hero ─── */
.cat-hero-counters {
    display: flex;
    gap: 0;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    animation: fadeUp 0.7s 0.5s ease both;
}
.cat-counter-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 1rem 1.5rem;
}
.cat-counter-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0; top: 15%; height: 70%;
    width: 1px;
    background: rgba(255,255,255,0.1);
}
.cat-counter-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1rem;
}
.cat-counter-icon.blue   { background: rgba(59,130,246,0.18); color: var(--blue-300); }
.cat-counter-icon.green  { background: rgba(16,185,129,0.18); color: #34d399; }
.cat-counter-icon.amber  { background: rgba(245,158,11,0.18);  color: #fbbf24; }
.cat-counter-num {
    font-family: var(--font-display);
    font-size: 1.8rem; font-weight: 800;
    color: #fff; line-height: 1; letter-spacing: -1px;
}
.cat-counter-lbl {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    margin-top: 0.3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ══ TOOLBAR ══ */
.cat-grid-section { padding: 4rem 0; background: var(--gray-50); }
.cat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0.9rem 1.2rem;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
}
.cat-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}
.cat-toolbar-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.cat-result-count {
    font-size: 0.82rem;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.cat-result-count strong { color: var(--gray-800); font-weight: 700; }

/* Champ de recherche dans la toolbar */
.cat-toolbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.85rem;
    flex: 1;
    max-width: 320px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cat-toolbar-search:focus-within {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: var(--white);
}
.cat-toolbar-search > i {
    color: var(--gray-400);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.cat-toolbar-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--gray-800);
    font-family: var(--font-body);
    min-width: 0;
}
.cat-toolbar-search input::placeholder { color: var(--gray-400); }
.cat-toolbar-search button {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    transition: color 0.2s;
}
.cat-toolbar-search button:hover { color: var(--gray-700); }

/* Sélect de tri */
.cat-sort-wrap {
    display: flex; align-items: center; gap: 0.4rem;
}
.cat-sort-label { font-size: 0.82rem; color: var(--gray-500); font-weight: 500; white-space: nowrap; }
.cat-sort-select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
    color: var(--gray-700);
    background: var(--gray-50);
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}
.cat-sort-select:focus { border-color: var(--blue-400); }

/* Toggle vue grille/liste */
.cat-view-toggle {
    display: flex; gap: 0.25rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.cat-view-btn {
    width: 30px; height: 30px;
    border: none; border-radius: 6px;
    background: transparent; color: var(--gray-400);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; cursor: pointer; transition: all 0.2s;
}
.cat-view-btn.active { background: var(--white); color: var(--blue-600); box-shadow: var(--shadow-sm); }
.cat-view-btn:hover:not(.active) { color: var(--gray-600); }

/* ══ CARDS CATÉGORIES ══ */
.cat-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: all 0.3s;
    position: relative;
    padding: 0;
}
.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

/* Badge vérifié en haut à droite */
.cat-card-verif-pill {
    position: absolute;
    top: 0.6rem; right: 0.6rem;
    background: rgba(16,185,129,0.12);
    color: #059669;
    border: 1px solid rgba(16,185,129,0.3);
    font-size: 0.62rem; font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 100px;
    display: flex; align-items: center; gap: 0.25rem;
    z-index: 2;
}

/* Corps de la card — style centré comme index.php */
.cat-card-body {
    flex: 1;
    padding: 1.6rem 1.2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Icône — identique à home.css .cat-icon-wrap mais avec couleur dynamique */
.cat-icon-wrap {
    width: 60px; height: 60px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--cat-color, var(--blue-400)) 12%, white);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
}
.cat-icon-wrap i {
    font-size: 1.6rem;
    color: var(--cat-color, var(--blue-600));
    transition: all 0.3s;
}
/* Fallback pour navigateurs sans color-mix */
@supports not (background: color-mix(in srgb, red, blue)) {
    .cat-icon-wrap { background: var(--blue-50); }
    .cat-icon-wrap i { color: var(--blue-600); }
}
.cat-card:hover .cat-icon-wrap {
    background: var(--cat-color, var(--blue-600));
}
.cat-card:hover .cat-icon-wrap i { color: #fff; }

.cat-card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--gray-800);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}
.cat-card-count {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}
.cat-card-rating {
    display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.78rem; color: var(--gray-600); font-weight: 600;
    margin-bottom: 0.6rem;
}
.cat-card-rating i { color: #f59e0b; font-size: 0.75rem; }

/* Barre de progression vérification */
.cat-card-progress {
    display: flex; align-items: center; gap: 0.5rem;
    width: 100%; margin-top: auto; padding-top: 0.6rem;
}
.cat-progress-track {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
}
.cat-progress-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1s ease;
}
.cat-progress-label {
    font-size: 0.68rem;
    color: var(--gray-400);
    white-space: nowrap;
    font-weight: 500;
}

/* Footer card */
.cat-card-footer {
    padding: 0.65rem 1.2rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.cat-card-footer span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blue-600);
    display: flex; align-items: center; gap: 0.3rem;
    transition: gap 0.2s;
}
.cat-card:hover .cat-card-footer { border-top-color: var(--blue-100); }
.cat-card:hover .cat-card-footer span { gap: 0.55rem; }
.cat-card:hover { border-color: var(--blue-200); }

/* ── Vue Liste ── */
.view-list .col-6 { width: 100% !important; flex: 0 0 100%; }
.view-list .cat-card { flex-direction: row; align-items: center; }
.view-list .cat-card-body {
    flex: 1;
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 0.8rem 1.2rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.view-list .cat-icon-wrap { margin: 0; flex-shrink: 0; width: 48px; height: 48px; }
.view-list .cat-icon-wrap i { font-size: 1.3rem; }
.view-list .cat-card-name { margin-bottom: 0; min-width: 120px; flex-shrink: 0; }
.view-list .cat-card-count { margin-bottom: 0; }
.view-list .cat-card-rating { margin-bottom: 0; }
.view-list .cat-card-progress { margin-top: 0; padding-top: 0; min-width: 120px; flex: 1; }
.view-list .cat-card-footer { border-top: none; border-left: 1px solid var(--gray-100); padding: 1rem 1.2rem; }
.view-list .cat-card-verif-pill { position: static; margin-left: auto; flex-shrink: 0; }

/* ── Message aucun résultat ── */
.cat-no-result {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--gray-400);
}
.cat-no-result i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: 0.3; }
.cat-no-result p { font-size: 1rem; margin-bottom: 1.5rem; }

/* ── Item masqué par filtre ── */
.cat-item.hidden {
    display: none !important;
}

/* ══ ANIMATIONS SUPPLÉMENTAIRES ══ */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ══ RESPONSIVE ══ */
@media (max-width: 991.98px) {
    .cat-hero-section { min-height: auto; padding: 4rem 0 3rem; }
    .cat-hero-floats { padding-left: 0; }
}
@media (max-width: 767.98px) {
    .cat-hero-counters { gap: 0; }
    .cat-counter-item { padding: 0.75rem 0.5rem; }
    .cat-counter-num { font-size: 1.3rem; }
    .cat-sort-label { display: none; }
    .view-list .cat-card-body { gap: 0.5rem; }
    .view-list .cat-card { flex-direction: row; }
}
@media (max-width: 575.98px) {
    .cat-hero-section { padding: 3rem 0 2rem; }
    .cat-toolbar { flex-direction: column; align-items: flex-start; }
    .cat-toolbar-right { width: 100%; justify-content: space-between; }
    /* En mobile : forcer 2 colonnes même en vue liste */
    .view-list .col-6 { width: 50% !important; flex: 0 0 50%; }
    .view-list .cat-card { flex-direction: column; }
    .view-list .cat-card-header { width: 100%; height: 70px; }
    .view-list .cat-card-body { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
    .view-list .cat-card-footer { border-left: none; border-top: 1px solid var(--gray-100); }
}