/* ====================================
   PAGE DOMAINES D'ÉTUDES — REFONTE
   ==================================== */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --green-accent: #2ecc71;
    --success-color: #27ae60;
    --dom-sidebar-w: 340px;
}

.page-domaines-wrapper {
    background: #f8fafc;
    min-height: 100vh;
}

/* ── HERO (identique à niveaux-etudes) ──────────────────────────────── */
.domaines-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #08b12d 100%);
    color: white;
    padding: 110px 0 80px;
    position: relative;
    overflow: hidden;
}

.domaines-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23000000" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,192C1248,192,1344,128,1392,96L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
    opacity: 0.3;
}

.domaines-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50%       { transform: translateX(100%); }
}

.domaines-hero .container {
    position: relative;
    z-index: 2;
}

/* Breadcrumb */
.domaines-hero .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.domaines-hero .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}
.domaines-hero .breadcrumb-item a:hover  { color: var(--green-accent); }
.domaines-hero .breadcrumb-item.active   { color: white; font-weight: 600; }
.domaines-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.6); }

/* Titres */
.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.3rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.2);
    opacity: 0.95;
    margin-bottom: 30px;
}

/* Bouton orientation */
.orientation-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.7);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background .25s, color .25s;
}
.orientation-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

/* ── LAYOUT ─────────────────────────────────────────────────────────── */
.domaines-layout {
    display: flex;
    min-height: calc(100vh - 200px);
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────── */
.domaines-sidebar {
    width: var(--dom-sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 12px rgba(0,0,0,.06);
    z-index: 10;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Recherche */
.sidebar-search-wrap {
    padding: 14px 12px 10px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.sidebar-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-search-box > i {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 0.88rem;
    pointer-events: none;
}

.sidebar-search-input {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    padding: 8px 36px 8px 34px;
    font-size: 0.88rem;
    outline: none;
    background: #f8fafc;
    transition: border-color .2s, background .2s;
    color: #1e293b;
}
.sidebar-search-input:focus {
    border-color: var(--secondary-color);
    background: #fff;
}
.sidebar-search-input::placeholder { color: #94a3b8; }

.sidebar-search-clear {
    position: absolute;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.65rem;
    transition: background .15s;
}
.sidebar-search-clear:hover { background: #cbd5e1; }

/* Filtres catégories */
.sidebar-cat-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all .18s;
    line-height: 1;
}
.cat-btn i { font-size: 0.77rem; }
.cat-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: #eff6ff;
}
.cat-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Liste des domaines */
.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
}

.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-track { background: transparent; }
.sidebar-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.sidebar-list::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.sidebar-group { margin-bottom: 6px; }

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
}

.sidebar-group-count {
    margin-left: auto;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px 9px 10px;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 0 10px 10px 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    margin-bottom: 2px;
}
.sidebar-item:hover { background: #f8fafc; }

/* Item actif — plus visible */
.sidebar-item--active {
    background: #f0fdf4 !important;
    border-left-color: #169a36 !important;
    box-shadow: inset 0 0 0 1px rgba(22, 154, 54, 0.12);
}
.sidebar-item--active .sidebar-item-label {
    color: #0f5132;
    font-weight: 700;
}

.sidebar-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-item-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    flex: 1;
    line-height: 1.3;
    text-align: left;
}

.sidebar-item-arrow { font-size: 0.72rem; }

.sidebar-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}
.sidebar-empty i { font-size: 2rem; display: block; margin-bottom: 10px; }
.sidebar-empty p { margin: 0; font-size: 0.88rem; }

.sidebar-footer {
    border-top: 1px solid #f1f5f9;
    padding: 10px 16px;
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
    flex-shrink: 0;
}

/* ── PANNEAU DÉTAIL ──────────────────────────────────────────────────── */
.domaines-detail {
    flex: 1;
    overflow-y: auto;
    padding: 52px 64px;
    background: #f8fafc;
}

.domaines-detail::-webkit-scrollbar { width: 6px; }
.domaines-detail::-webkit-scrollbar-track { background: transparent; }
.domaines-detail::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

@keyframes detailFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.detail-fade-in { animation: detailFadeIn .3s ease forwards; }

.detail-content { max-width: 700px; }

/* Bouton partage — top-right du panneau */
.detail-top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.detail-share-btn {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: #64748b;
    transition: all .18s;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.detail-share-btn:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-color: #cbd5e1;
}

/* Image domaine */
.detail-image-wrap {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
}
.detail-domain-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* En-tête */
.detail-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-big-icon {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.detail-header-text { flex: 1; }

.detail-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid;
    margin-bottom: 10px;
    letter-spacing: .02em;
}

.detail-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

/* Méta (durée + niveaux) */
.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.detail-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.detail-level-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid;
}

/* Accroche */
.detail-accroche {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 28px;
    font-size: 0.96rem;
    font-weight: 500;
    font-style: italic;
    color: #334155;
    line-height: 1.7;
    border-left: 4px solid #169a36;
    background: #f0fdf4;
}
.detail-accroche i { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; color: #169a36; }

/* Sections */
.detail-section { margin-bottom: 28px; }

.detail-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
}

.detail-description {
    color: #475569;
    line-height: 1.9;
    font-size: 0.94rem;
    margin: 0;
}

/* ── DÉBOUCHÉS (grille enrichie) ─────────────────────────────────────── */
.debouches-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.debouche-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .15s, box-shadow .15s;
}
.debouche-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.debouche-card--link {
    cursor: pointer;
    border-color: #e2e8f0;
}
.debouche-card--link:hover {
    border-color: #169a36;
    box-shadow: 0 6px 20px rgba(22,154,54,.15);
}
.debouche-link-hint {
    font-size: .75rem;
    color: #169a36;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
}

.debouche-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.debouche-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #475569;
    flex-shrink: 0;
}

.debouche-titre {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

/* Badges salaire */
.salary-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.salary-excellent { background: #dcfce7; color: #15803d; }
.salary-bon       { background: #dbeafe; color: #1d4ed8; }
.salary-correct   { background: #fef3c7; color: #b45309; }

/* ── CTA ─────────────────────────────────────────────────────────────── */
.detail-cta-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #e2e8f0;
}

.detail-cta-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: center;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Bouton principal — gradient vert du site */
.detail-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #169a36, #2ecc71) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 999px;
    padding: 14px 30px;
    font-size: 1rem;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s, opacity .2s;
    box-shadow: 0 4px 15px rgba(46,204,113,0.35);
}
.detail-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46,204,113,0.45);
    color: #fff !important;
    opacity: .93;
}

/* ── TOAST PARTAGE ───────────────────────────────────────────────────── */
#domainShareToast { background: #169a36; }

/* ── SWIPE ANIMATIONS (mobile) ───────────────────────────────────────── */
@keyframes swipeOutLeft  { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-70%); opacity: 0; } }
@keyframes swipeOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(70%);  opacity: 0; } }
@keyframes swipeInRight  { from { transform: translateX(70%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes swipeInLeft   { from { transform: translateX(-70%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.swipe-out-left  { animation: swipeOutLeft  .22s ease forwards; overflow: hidden; }
.swipe-out-right { animation: swipeOutRight .22s ease forwards; overflow: hidden; }
.swipe-in-right  { animation: swipeInRight  .26s ease forwards; }
.swipe-in-left   { animation: swipeInLeft   .26s ease forwards; }

/* ── MODAL MOBILE ─────────────────────────────────────────────────────── */
.domaines-modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #08b12d 100%);
    color: #fff;
}
.domaines-modal-header .modal-title { font-weight: 700; }
.domaines-modal-header .btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

#domainModalBody { overflow-y: auto; }
#domainModalBody .debouches-grid { grid-template-columns: 1fr; }
#domainModalBody .detail-title { font-size: 1.5rem; }
#domainModalBody .detail-top-actions { margin-bottom: 8px; }

/* ── TABLETTE (768–991px) ────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 991.98px) {
    :root { --dom-sidebar-w: 270px; }
    .domaines-detail { padding: 32px 36px; }
    .detail-title { font-size: 1.6rem; }
    .debouches-grid { grid-template-columns: 1fr; }
    .detail-big-icon { width: 60px; height: 60px; font-size: 1.7rem; }
    .domaines-hero { padding: 80px 0 60px; }
}

/* ── MOBILE (<768px) ──────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .domaines-hero { padding: 60px 0 44px; }
    .hero-title { font-size: 1.75rem; }
    .hero-subtitle { font-size: 1rem; }

    .domaines-layout { flex-direction: column; }

    .domaines-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0,0,0,.06);
    }

    .sidebar-list { max-height: 52vh; }
    .domaines-detail { display: none; }

    .sidebar-cat-filters { gap: 5px; padding: 8px 10px; }
    .cat-btn { font-size: 0.72rem; padding: 4px 9px; }
}
