/* ====================================
   PAGE DOMAINES D'ÉTUDES - STYLES COMPLETS
   ==================================== */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #27ae60;
    --green-accent: #2ecc71;
}

/* Reset et base */
.page-domaines-wrapper {
    background: #f8fafc;
}

/* Hero Section amélioré */
.domaines-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #08b12d 100%);
    color: white;
    padding: 120px 0 90px;
    margin-bottom: 40px;
    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);
    transform: translateX(5px);
}

.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 */
.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;
}

/* Statistiques améliorées */
.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 35px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 25px;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-top: 6px solid var(--secondary-color);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    border-radius: 0 0 0 100%;
    opacity: 0.05;
    transition: all 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-top-color: var(--green-accent);
}

.stat-card:hover::before {
    transform: scale(1.2);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(46, 204, 113, 0.4);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    line-height: 1;
}

.stat-label {
    color: #666;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* Barre de recherche améliorée */
.search-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border-left: 6px solid var(--green-accent);
}

.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    border-radius: 0 0 0 100%;
    opacity: 0.05;
    transition: all 0.4s ease;
}

.search-section:hover::before {
    transform: scale(1.1);
}

.search-title {
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 15px;
}

.search-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--green-accent));
    border-radius: 2px;
}

.search-container {
    position: relative;
    display: flex;
    gap: 15px;
}

.search-input {
    flex: 1;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 1.1rem;
    border: 2px solid transparent;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

.search-btn {
    border-radius: 50px;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
    color: white;
}

/* Toolbar recherche compacte */
.domaines-toolbar {
    position: sticky;
    top: var(--header-offset, 90px);
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-search {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.toolbar-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1rem;
}

.toolbar-search .search-input {
    padding-left: 44px;
    padding-right: 42px;
    border-radius: 999px;
    height: 46px;
    font-size: 1rem;
}

.btn-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #eef2f7;
    color: #6b7280;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-clear-search:hover {
    background: #e2e8f0;
    color: #111827;
}

.btn-clear-search.show {
    display: inline-flex;
}

.toolbar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.results-pill {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.12) 0%, rgba(46, 204, 113, 0.12) 100%);
    color: var(--primary-color);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(52, 152, 219, 0.18);
    white-space: nowrap;
}

/* Filtres améliorés */
.filter-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
    border-left: 6px solid var(--green-accent);
    z-index: 5;
}

.filters-toggle {
    display: none;
    align-items: center;
    gap: 6px;
}

.filters-body {
    margin-top: 18px;
}

@media (max-width: 768px) {
    .filters-toggle {
        display: inline-flex;
    }

    .filters-body {
        margin-top: 12px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.2s ease;
    }

    .filter-section.filters-open .filters-body {
        max-height: 1200px;
        opacity: 1;
        overflow: visible;
    }
}

.filter-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    border-radius: 0 0 0 100%;
    opacity: 0.05;
    transition: all 0.4s ease;
}

.filter-section:hover::before {
    transform: scale(1.1);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.filter-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
    position: relative;
    padding-bottom: 15px;
}

.filter-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--green-accent));
    border-radius: 2px;
}

.form-check {
    padding: 12px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-check:hover {
    background: rgba(52, 152, 219, 0.05);
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--green-accent);
    border-color: var(--green-accent);
    box-shadow: 0 0 0 0.2rem rgba(46, 204, 113, 0.25);
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: #555;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.form-check-input:checked + .form-check-label {
    color: var(--green-accent);
    font-weight: 600;
}

/* Chips catégories */
.chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.chip {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    color: #374151;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.chip span i {
    color: inherit;
}

.chip input:checked + span {
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.25);
}

/* Ligne chips + niveaux */
.filters-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Dropdown niveaux */
.levels-row {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.levels-label {
    font-weight: 700;
    color: var(--primary-color);
}

.levels-dropdown {
    position: relative;
}

.levels-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.levels-toggle:hover {
    border-color: rgba(46, 204, 113, 0.4);
    box-shadow: 0 8px 22px rgba(46, 204, 113, 0.18);
}

.levels-summary {
    font-weight: 600;
    color: #6b7280;
}

.levels-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 260px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 10px;
    display: none;
    max-height: 240px;
    overflow: auto;
    z-index: 60;
}

.levels-menu.open {
    display: block;
}

.level-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s ease;
}

.level-option:hover {
    background: rgba(46, 204, 113, 0.08);
}

.level-option input {
    width: 18px;
    height: 18px;
}

/* Compteur de résultats */
.results-counter {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
    padding: 15px 30px;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Cartes de domaines améliorées */
.domaine-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 6px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.domaine-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    border-radius: 0 0 0 100%;
    opacity: 0.05;
    transition: all 0.4s ease;
}

.domaine-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--green-accent));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.domaine-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-top-color: var(--green-accent);
}

.domaine-card:hover::before {
    transform: scale(1.2);
}

.domaine-card:hover::after {
    transform: scaleX(1);
}

.domaine-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.domaine-card:hover .domaine-icon {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 12px 35px rgba(46, 204, 113, 0.4);
}

.domaine-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 15px;
    z-index: 1;
}

.domaine-title strong {
    font-weight: 800;
}

.domaine-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--green-accent));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.domaine-card:hover .domaine-title::after {
    width: 60px;
}

.domaine-category {
    display: inline-block;
    padding: 6px 15px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 15px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    z-index: 1;
    position: relative;
}

.domaine-description {
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    flex-grow: 1;
    font-size: 1rem;
    z-index: 1;
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.domaine-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    z-index: 1;
    position: relative;
}

.level-badge {
    padding: 6px 14px;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.domaine-levels .level-badge {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.25);
    color: #1f6f45;
    font-weight: 600;
}

.domaine-card:hover .level-badge {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.domaine-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.domaine-link:hover {
    color: var(--green-accent);
    gap: 12px;
}

/* Message aucun résultat */
#no-results .alert {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
    border: none;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-left: 6px solid var(--secondary-color);
}

#no-results .alert h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 15px;
}

#no-results .alert p {
    color: #555;
    font-size: 1.1rem;
    margin: 0;
}

/* Bouton retour en haut */
.btn-back-top-domaines {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--secondary-color), var(--green-accent));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.btn-back-top-domaines.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.btn-back-top-domaines:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .domaines-hero {
        padding: 100px 0 70px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .search-section,
    .filter-section {
        padding: 30px 20px;
    }

    .domaines-toolbar {
        top: var(--header-offset, 80px);
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }

    .toolbar-meta {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .chips-group {
        gap: 10px;
    }

    .filters-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .levels-row {
        flex-direction: column;
        align-items: stretch;
    }

    .levels-dropdown,
    .levels-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .levels-menu {
        width: 100%;
        left: 0;
    }

    .domaine-card {
        padding: 25px 20px;
    }

    .btn-back-top-domaines {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .domaines-hero {
        padding: 80px 0 50px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .search-title,
    .filter-title {
        font-size: 1.3rem;
    }

    .toolbar-search .search-input {
        height: 44px;
        font-size: 0.95rem;
    }

    .results-pill {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}


/* Bouton orientation dans le hero */
.orientation-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-top: 25px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.orientation-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.orientation-btn i {
    font-size: 1.1rem;
}
