/*!
 * Argon Dashboard Design System - Version Épurée "Douceur Santé"
 * Pour Centre Hospitalier CMS JJ-BAZIN
 */

:root {
    --primary: #6C7FE0;
    --primary-light: #97A4EA;
    --primary-dark: #4F5FC4;
    --primary-rgb: 108, 127, 224;
    --secondary: #F7F8FA;
    --success: #3EBFA3;
    --success-light: #7DD8C3;
    --info: #4FB3D9;
    --info-light: #8DD0E8;
    --warning: #F2A65A;
    --warning-light: #F6C088;
    --danger: #E8677E;
    --danger-light: #F0A0AF;
    --default: #2B3245;
    --dark: #23262F;
    --gray-100: #F7F8FA;
    --gray-200: #ECEEF2;
    --gray-300: #DFE2E8;
    --gray-400: #C9CEDA;
    --gray-500: #A8AFBF;
    --gray-600: #7C8494;
    --gray-700: #5C6377;
    --gray-800: #363B4A;
    --gray-900: #23262F;
    --white: #ffffff;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.875rem;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ========== GRILLE (row / col-*) ==========
   Le site utilise des classes de type Bootstrap (row, col-md-6, etc.)
   sans que Bootstrap ne soit jamais chargé. Cette grille minimale leur
   donne un vrai comportement responsive, sans dépendre d'une librairie
   externe complète. */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.row > [class*="col-"] {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.col-12 {
    width: 100%;
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
}

@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 992px) {
    .col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
    .offset-lg-2 { margin-left: 16.6667%; }
}

@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: 1px 0 0 rgba(17, 24, 39, 0.04);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar .logo {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 10px;
}

.sidebar .logo img {
    max-width: 70px;
    height: auto;
    margin-bottom: 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.sidebar .logo img:hover {
    transform: scale(1.03);
}

.sidebar .logo h6 {
    color: white;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.nav-menu {
    list-style: none;
    padding: 10px 15px;
}

.nav-item {
    margin: 3px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: all 0.25s ease;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    position: relative;
    letter-spacing: 0.3px;
}

.nav-link i {
    margin-right: 15px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: all 0.25s ease;
}

.nav-link span {
    transition: all 0.25s ease;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(3px);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 600;
}

.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 260px;
    z-index: 1050;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.1);
    cursor: pointer;
    display: none;
    transition: all 0.25s ease;
    font-size: 1.2rem;
    color: var(--gray-700);
}

.sidebar-toggle:hover {
    background: var(--primary);
    color: white;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Sidebar masquée via le bouton du header (fonctionne sur toutes les tailles d'écran) */
body.sidebar-hidden .sidebar {
    transform: translateX(-100%);
}

body.sidebar-hidden .main-content {
    margin-left: 0;
}

/* Fond assombri derrière la sidebar ouverte sur mobile + bouton de fermeture
   toujours visible AU-DESSUS de la sidebar (corrige le bug où le bouton
   d'ouverture se retrouvait caché derrière une fois le menu affiché) */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 26, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1010;
    transition: background 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 991.98px) {
    .sidebar-close-btn {
        display: flex;
    }
}

/* ========== NAVBAR HORIZONTAL ========== */
.navbar-horizontal {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-brand img {
    height: 45px;
    width: auto;
    border-radius: 10px;
}

.navbar-brand h4 {
    color: var(--gray-800);
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.navbar-brand h4 span {
    color: var(--primary);
}

/* ========== PAGE TITLE & BREADCRUMB ========== */
.page-title {
    padding: 25px 30px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 30px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    border-radius: 3px;
    background: var(--primary);
}

.page-title h2 {
    color: var(--gray-800);
    font-weight: 700;
    margin: 0;
    font-size: 1.5rem;
}

.page-title h2 i {
    margin-right: 10px;
    color: var(--primary);
}

.breadcrumb {
    background: transparent;
    padding: 8px 0 0;
    margin: 0;
    font-size: 0.8rem;
}

.breadcrumb-item {
    color: var(--gray-600);
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

.breadcrumb-item.active {
    color: var(--gray-600);
}

/* ========== CARDS ========== */
.card {
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    margin-bottom: 30px;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    background: white;
    position: relative;
}

.card:hover {
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
    border-color: var(--gray-300);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 25px;
}

.card-header:first-child {
    border-radius: 16px 16px 0 0;
}

.card-header h3, .card-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-header h3 i, .card-header h5 i {
    margin-right: 8px;
}

.card-body {
    padding: 25px;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--gray-200);
    padding: 20px 25px;
}

/* Border Left Cards */
.border-left-primary {
    border-left: 4px solid var(--primary);
}

.border-left-success {
    border-left: 4px solid var(--success);
}

.border-left-info {
    border-left: 4px solid var(--info);
}

.border-left-warning {
    border-left: 4px solid var(--warning);
}

/* ========== STATS CARDS ========== */
.card-stats {
    position: relative;
    padding-right: 25px;
}

.card-stats .card-body {
    padding: 20px 25px;
}

.card-stats .icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-shape-primary {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.icon-shape-success {
    background: rgba(62, 191, 163, 0.12);
    color: var(--success);
}

.icon-shape-info {
    background: rgba(79, 179, 217, 0.12);
    color: var(--info);
}

.icon-shape-warning {
    background: rgba(242, 166, 90, 0.12);
    color: var(--warning);
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.25s ease;
    border: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #34a58c;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #3a9cc0;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #e2934a;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* ========== VIDEO HEADER ========== */
.header-video {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 80px 0;
    color: white;
    overflow: hidden;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
}

.director-video {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.director-video:hover {
    transform: scale(1.01);
}

.welcome-text {
    position: relative;
    z-index: 1;
    padding-left: 30px;
}

.welcome-text h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.25;
}

.welcome-text p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
    font-weight: 300;
}

/* ========== GALLERY ========== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    background: white;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.caption {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.caption h5 {
    color: var(--gray-800);
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.caption p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* ========== TABLE ========== */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom thead th {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
}

.table-custom tbody td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease;
}

.table-custom tbody tr:hover {
    background: var(--gray-100);
}

/* ========== MEMBER CARD ========== */
.member-card {
    text-align: center;
    padding: 25px 20px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.member-card:hover::before {
    transform: scaleX(1);
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.member-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid var(--primary-light);
    padding: 3px;
    transition: all 0.25s ease;
}

.member-card:hover .member-photo {
    border-color: var(--primary);
}

.member-name {
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
    font-size: 1rem;
}

.member-role {
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========== ARTICLE CARDS ========== */
.article-card {
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.article-card .card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card:hover .card-img-top {
    transform: scale(1.03);
}

.article-meta {
    font-size: 0.85rem;
}

.article-meta .badge {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== BADGES ========== */
.badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-info {
    background: var(--info);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* ========== PAGINATION ========== */
.pagination {
    margin-top: 30px;
}

.page-link {
    color: var(--primary);
    border: none;
    margin: 0 5px;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.page-link:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
}

.page-item.disabled .page-link {
    color: var(--gray-400);
    background: var(--gray-100);
}

/* ========== SIDEBAR BLOG ========== */
.sidebar-blog .list-unstyled li {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.25s ease;
}

.sidebar-blog .list-unstyled li:last-child {
    border-bottom: none;
}

.sidebar-blog .list-unstyled li a {
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-blog .list-unstyled li a:hover {
    color: var(--primary);
    padding-left: 8px;
}

.sidebar-blog .media {
    padding: 15px;
    border-radius: 10px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.sidebar-blog .media:hover {
    background: var(--gray-100);
}

.sidebar-blog .media img {
    border-radius: 8px;
    object-fit: cover;
}

/* ========== FOOTER ========== */
.footer {
    background: white;
    padding: 25px 30px;
    margin-top: 50px;
    border-top: 1px solid var(--gray-200);
}

.footer p {
    margin: 0;
    font-size: 0.875rem;
}

.footer a {
    color: var(--gray-600);
    font-size: 1.1rem;
    transition: color 0.25s ease;
}

.footer a:hover {
    color: var(--primary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        margin-left: 0;
    }

    .welcome-text {
        padding-left: 0;
        margin-top: 30px;
    }

    .welcome-text h1 {
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    .welcome-text h1 {
        font-size: 1.8rem;
    }

    .card-header {
        padding: 15px 20px;
    }

    .card-body {
        padding: 20px;
    }

    .gallery-item img {
        height: 200px;
    }

    .table-custom {
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .page-title {
        padding: 20px;
    }

    .page-title h2 {
        font-size: 1.3rem;
    }
}

/* Utility Classes */
.shadow-hover:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rounded-xl {
    border-radius: 16px !important;
}

.z-index-1 {
    z-index: 1;
}