/* ==================================================
   EXAM SUBJECTS INDEX — Thème orange
   ================================================== */

:root {
    --exam-orange:       #F97316;
    --exam-orange-dark:  #EA580C;
    --exam-orange-light: rgba(249, 115, 22, 0.10);
    --exam-orange-border:rgba(249, 115, 22, 0.25);
    --exam-green:        #16a34a;
    --exam-green-light:  rgba(22, 163, 74, 0.10);
    --exam-radius:       14px;
    --exam-shadow:       0 4px 20px rgba(15, 23, 42, 0.07);
    --exam-shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.13);
}

/* ===== HERO ===== */
.exam-hero-section {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 35%, #f97316 70%, #fb923c 100%);
    padding: 2.5rem 0 2rem;
    position: relative;
    overflow: hidden;
}

.exam-hero-section::before {
    content: '';
    position: absolute;
    top: -100px; right: -80px;
    width: 320px; height: 320px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 50%;
    pointer-events: none;
}

.exam-hero-section::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -60px;
    width: 220px; height: 220px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

/* Breadcrumb hero */
.exam-breadcrumb {
    background: none;
    padding: 0; margin: 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
}

.exam-bc-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex; align-items: center;
    transition: color 0.2s;
}

.exam-bc-link:hover { color: #fff; }

.exam-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

.exam-bc-active {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex; align-items: center;
}

/* Badges hero */
.exam-hero-type-badge {
    display: inline-flex; align-items: center;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.exam-hero-level-badge {
    display: inline-flex; align-items: center;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Hero contenu */
.exam-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    position: relative; z-index: 1;
}

.exam-hero-subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    position: relative; z-index: 1;
}

.exam-hero-subtitle strong { color: #fff; }

.exam-hero-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative; z-index: 1;
}

.exam-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    min-width: 76px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.exam-hero-stat:hover { background: rgba(255, 255, 255, 0.25); }

.exam-hero-stat .stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.exam-hero-stat .stat-lbl {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-top: 0.1rem;
}

.exam-hero-img {
    max-height: 220px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    position: relative; z-index: 1;
}

/* ===== ZONE PRINCIPALE ===== */
.exam-content-area {
    background: #f8fafc;
    padding: 2rem 0 3rem;
    min-height: 60vh;
}

/* ===== SECTION RÉCENTS ===== */
.exam-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.75rem;
    display: flex; align-items: center;
}

/* ===== MINI CARDS (récents) ===== */
.exam-card-mini {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    transition: transform 0.22s, box-shadow 0.22s;
    position: relative;
    display: flex; flex-direction: column;
}

.exam-card-mini:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.11);
    border-color: var(--exam-orange-border);
}

.exam-card-mini-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f8fafc;
}

.exam-card-mini-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}

.exam-card-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    padding: 0.75rem;
}

.exam-card-placeholder img {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.exam-card-mini-body {
    padding: 0.6rem 0.75rem;
    flex: 1;
}

.exam-card-mini-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-card-mini-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.4rem;
}

/* ===== FILTER PANEL ===== */
.exam-filter-panel {
    background: #fff;
    border-radius: var(--exam-radius);
    box-shadow: var(--exam-shadow);
    overflow: hidden;
    position: sticky;
    top: 20px;
    border: 1px solid #e5e7eb;
}

.exam-filter-header {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: #fff;
    padding: 0.875rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex; align-items: center;
}

.exam-filter-body {
    padding: 1rem 1.25rem 1.25rem;
}

.exam-filter-field {
    margin-bottom: 0.85rem;
}

.exam-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
    display: block;
}

.exam-current-type-badge {
    display: flex; align-items: center;
    background: var(--exam-orange-light);
    color: var(--exam-orange-dark);
    border: 1px solid var(--exam-orange-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Focus ring orange pour les champs de filtre */
.exam-filter-panel .form-control:focus,
.exam-filter-panel .form-select:focus {
    border-color: var(--exam-orange);
    box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.18);
}

/* ===== CHAPEAU TYPE D'EXAMEN ===== */
.exam-type-chapeau {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid var(--exam-orange);
    border-radius: var(--exam-radius);
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.08);
    position: relative;
    overflow: hidden;
}

.exam-type-chapeau::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 180px; height: 100%;
    background: linear-gradient(to left, rgba(249, 115, 22, 0.05), transparent);
    pointer-events: none;
}

.exam-type-chapeau-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #ea580c, #f97316);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    font-size: 1.5rem;
    color: #fff;
}

.exam-type-chapeau-content {
    flex: 1;
    min-width: 0;
}

.exam-type-chapeau-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--exam-orange);
    margin-bottom: 0.1rem;
}

.exam-type-chapeau-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.exam-type-chapeau-sub {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.exam-type-chapeau-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.exam-chapeau-stat {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.3rem 0.65rem;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.exam-chapeau-stat-green {
    color: var(--exam-green);
    background: var(--exam-green-light);
    border-color: rgba(22, 163, 74, 0.2);
}

/* ===== BARRE DE CONTRÔLES ===== */
.exam-controls-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: #fff;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
    border: 1px solid #e5e7eb;
}

.exam-results-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--exam-orange-dark);
    background: var(--exam-orange-light);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--exam-orange-border);
    white-space: nowrap;
}

.exam-sort-select {
    min-width: 130px;
}

.exam-chip {
    display: inline-flex; align-items: center;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.exam-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
}

.exam-chip-clear {
    display: inline-flex; align-items: center;
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    padding: 0.25rem 0;
}

.exam-chip-clear:hover { color: #dc2626; text-decoration: none; }

/* Boutons vue grille/liste */
.exam-view-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    transition: all 0.2s;
    padding: 0.35rem 0.75rem;
}

.exam-view-btn.active,
.exam-view-btn:hover {
    background: var(--exam-orange);
    color: #fff;
    border-color: var(--exam-orange);
}

/* ===== CARTES PRINCIPALES ===== */
.exam-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--exam-radius);
    box-shadow: var(--exam-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    position: relative;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--exam-shadow-hover);
    border-color: var(--exam-orange-border);
}

.exam-card-img-link {
    display: block;
    overflow: hidden;
}

.exam-card-img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.exam-card:hover .exam-card-img {
    transform: scale(1.04);
}

.exam-card-img-placeholder {
    width: 100%;
    height: 155px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    padding: 1rem;
    transition: background 0.3s;
}

.exam-card:hover .exam-card-img-placeholder {
    background: linear-gradient(135deg, #ffedd5, #fde68a);
}

.exam-card-img-placeholder img {
    max-height: 110px;
    width: auto;
    object-fit: contain;
}

.exam-card-body {
    padding: 0.875rem 1rem 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.exam-card-meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.exam-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.exam-type-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--exam-orange);
}

.exam-views {
    font-size: 0.75rem;
    color: #94a3b8;
}

.exam-card-actions {
    padding: 0.6rem 1rem;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
}

/* ===== BADGES ===== */
.exam-year-badge {
    display: inline-flex; align-items: center;
    background: var(--exam-orange);
    color: #fff;
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.exam-year-badge-lg {
    display: inline-flex; align-items: center;
    background: var(--exam-orange);
    color: #fff;
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.exam-subject-badge {
    display: inline-flex; align-items: center;
    background: #f1f5f9;
    color: #334155;
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.exam-correction-badge {
    display: inline-flex; align-items: center;
    color: var(--exam-green);
    font-size: 0.95rem;
}

.exam-correction-badge-sm {
    display: inline-flex; align-items: center;
    background: var(--exam-green-light);
    color: var(--exam-green);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.exam-inedit-badge {
    display: inline-flex; align-items: center;
    background: linear-gradient(135deg, #ffb703, #fb8500);
    color: #111827;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    animation: ineditBadgePulse 1.5s ease-in-out infinite;
}

/* Petits badges mini-cards */
.exam-badge-year {
    display: inline-flex; align-items: center;
    background: var(--exam-orange);
    color: #fff;
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.exam-badge-ok {
    display: inline-flex; align-items: center;
    color: var(--exam-green);
    font-size: 0.85rem;
}

.exam-badge-inedit-sm {
    background: linear-gradient(135deg, #ffb703, #fb8500);
    color: #111827;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ===== CARTE INÉDIT ===== */
.exam-card-inedit {
    border-color: rgba(255, 183, 3, 0.5) !important;
    box-shadow: 0 4px 20px rgba(251, 133, 0, 0.14) !important;
}

.inedit-ribbon {
    position: absolute;
    top: 12px;
    right: 0;
    background: linear-gradient(135deg, #ffb703, #fb8500);
    color: #111827;
    padding: 0.2rem 0.85rem 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px 0 0 4px;
    z-index: 3;
    display: flex; align-items: center; gap: 0.3rem;
    box-shadow: -2px 2px 8px rgba(251, 133, 0, 0.3);
}

/* ===== VUE LISTE ===== */
.exam-list-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--exam-orange);
    border-radius: var(--exam-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--exam-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-left-color 0.2s;
}

.exam-list-item:hover {
    transform: translateX(4px);
    box-shadow: var(--exam-shadow-hover);
    border-left-color: var(--exam-orange-dark);
}

/* ===== BOUTON ORANGE ===== */
.exam-btn-primary {
    background: var(--exam-orange);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.exam-btn-primary:hover {
    background: var(--exam-orange-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* ===== ÉTAT VIDE ===== */
.exam-empty-state {
    background: #fff;
    border-radius: var(--exam-radius);
    box-shadow: var(--exam-shadow);
    border: 1px solid #e5e7eb;
    padding: 3rem 2rem;
    text-align: center;
}

.exam-empty-icon {
    width: 72px; height: 72px;
    background: var(--exam-orange-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
    color: var(--exam-orange);
    border: 2px solid var(--exam-orange-border);
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    color: var(--exam-orange);
    border-color: #e5e7eb;
}

.pagination .page-item.active .page-link {
    background: var(--exam-orange);
    border-color: var(--exam-orange);
    color: #fff;
}

.pagination .page-link:hover {
    color: var(--exam-orange-dark);
    background: var(--exam-orange-light);
    border-color: var(--exam-orange-border);
}

/* ===== ANIMATIONS ===== */
@keyframes ineditBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 133, 0, 0.4); }
    50%       { box-shadow: 0 0 0 5px rgba(251, 133, 0, 0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .exam-hero-title { font-size: 1.75rem; }
    .exam-hero-stats { gap: 0.6rem; }
    .exam-hero-stat { padding: 0.5rem 0.75rem; min-width: unset; }
    .exam-hero-stat .stat-val { font-size: 1.2rem; }

    .exam-type-chapeau { flex-wrap: wrap; gap: 0.75rem; }
    .exam-type-chapeau-stats { flex-direction: row; align-items: center; }
    .exam-type-chapeau-title { font-size: 1.1rem; }

    .exam-controls-bar { flex-direction: column; align-items: flex-start; gap: 0.6rem; }

    .exam-list-item { padding: 0.75rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .exam-inedit-badge { animation: none; }
    .exam-card:hover,
    .exam-list-item:hover,
    .exam-card-mini:hover { transform: none; }
}
