/*
 * Améliorations modernes pour MFPRA
 */

:root {
    --primary-color: #0063AC;
    --primary-dark: #004a82;
    --primary-light: #1a7bc4;
    --accent-yellow: #fce329;
    --white: #ffffff;
    --gray: #666;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --transition-base: 0.3s ease;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

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

/* Top Bar */
.top-bar {
    position: relative;
    overflow: hidden;
    /* background-color: var(--primary-color); */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    font-size: 13px;
    color: var(--white);
}

.top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.top-social ul li a,
.top-menu ul li a {
    color: var(--white);
    opacity: 0.9;
    transition: all var(--transition-base);
}

.top-menu ul li a:hover,
.top-social ul li a:hover {
    color: var(--accent-yellow);
    opacity: 1;
}

/* Navigation */
ul.navbar-nav>li {
    position: relative;
    transition: all var(--transition-base);
}

ul.navbar-nav>li::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-yellow);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

ul.navbar-nav>li:hover::before,
ul.navbar-nav>li.active::before {
    width: 80%;
}

.navbar-nav>li>a {
    font-weight: 600;
    text-transform: uppercase;
    padding: 25px 15px;
    color: #333;
}

.navbar-nav>li.active>a,
.navbar-nav>li>a:hover {
    color: var(--primary-color);
    background: transparent;
}

/* Boutons */
.btn {
    position: relative;
    overflow: hidden;
    border-radius: 50px;
    padding: 14px 32px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Cartes Publications */
.modern-news-section {
    padding: 80px 0;
    background: linear-gradient(to bottom, rgba(0, 99, 172, 0.03) 0%, var(--white) 100%);
}

.modern-news-section .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.modern-news-section .row>[class*='col-'] {
    display: flex;
    flex-direction: column;
    padding-left: 15px;
    padding-right: 15px;
}

.latest-post {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid #e7e7e7;
    margin-bottom: 30px;
}

.latest-post:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.latest-post-media {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.latest-post img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.latest-post:hover img {
    transform: scale(1.05);
}

.latest-post .post-body {
    padding: 25px 40px !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    margin-bottom: 20px;
    color: #b0b0b0;
}

.footer .widget-title {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.footer .widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer a {
    color: #b0b0b0;
    transition: all 0.3s ease;
}

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

.copyright {
    background-color: #111;
    padding: 25px 0;
    color: #888;
}

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

/* Bannière */
.banner-area {
    position: relative;
    padding: 100px 0;
    background-size: cover;
    background-position: center;
}

.banner-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.banner-text {
    position: relative;
    z-index: 2;
}

.banner-heading {
    text-align: center;
}

.banner-title {
    color: var(--white);
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.banner-subtitle {
    color: var(--white);
    font-size: 18px;
    opacity: 0.9;
    margin: 0;
}

/* Sidebar */
.sidebar .widget {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.sidebar .widget-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.sidebar .widget-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-yellow);
}

.sidebar .widget ul.arrow li {
    padding: 12px 0;
    border-bottom: 1px solid #e7e7e7;
    transition: all var(--transition-base);
}

.sidebar .widget ul.arrow li:last-child {
    border-bottom: none;
}

.sidebar .widget ul.arrow li a {
    color: #555;
    text-decoration: none;
    transition: all var(--transition-base);
}

.sidebar .widget ul.arrow li:hover a {
    color: var(--primary-color);
    padding-left: 10px;
}

/* Pagination */
.paging {
    margin-top: 40px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 5px;
}

.pagination li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--white);
    color: var(--primary-dark);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.pagination li.active a,
.pagination li a:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-back-link {
    margin-top: 30px;
    text-align: center;
}

/* Page Détail Publication */
.publication-detail-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.publication-article {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.publication-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.publication-header {
    padding: 40px;
    border-bottom: 1px solid #e7e7e7;
}

.publication-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    line-height: 1.3;
}

.publication-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    font-size: 14px;
    color: var(--gray);
}

.publication-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.publication-meta .meta-item i {
    color: var(--primary-color);
}

.publication-content {
    padding: 40px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

.publication-footer {
    padding: 30px 40px;
    border-top: 1px solid #e7e7e7;
    background: #f8f9fa;
}

/* Commentaires */
.comments-section {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.comments-heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e7e7e7;
}

.comment {
    display: flex;
    gap: 20px;
}

.comment-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-dark);
}

.comment-date {
    font-size: 13px;
    color: var(--gray);
}

.comment-form-section {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.form-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.comment-form .form-control {
    border: 2px solid #e7e7e7;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all var(--transition-base);
}

.comment-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 99, 172, 0.1);
    outline: none;
}

/* Cartes Documents */
.document-card {
    display: flex;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid #e7e7e7;
    margin-bottom: 30px;
    height: 100%;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.document-icon {
    width: 100px;
    background: rgba(0, 99, 172, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f0;
}

.document-icon i {
    font-size: 40px;
    color: var(--primary-color);
    transition: transform var(--transition-base);
}

.document-card:hover .document-icon i {
    transform: scale(1.2);
}

.document-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.document-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.document-text {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.document-footer {
    margin-top: auto;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 13px;
    width: auto;
}

.file-size {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}

/* Page de Connexion */
.login-page-wrapper {
    padding: 60px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-top: 20px;
    margin-bottom: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 50px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--gray);
    font-size: 16px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .control-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block;
}

/* Styles personnalisés pour éviter les conflits Bootstrap */
.modern-input-group {
    display: flex;
    width: 100%;
    position: relative;
    border-collapse: separate;
}

.modern-input-addon {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 15px;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.modern-form-control {
    border-radius: 0 8px 8px 0 !important;
    height: 45px !important;
    border: 1px solid #ced4da !important;
    box-shadow: none !important;
    padding-left: 15px !important;
    width: 100% !important;
    display: block;
}

.modern-form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 99, 172, 0.1) !important;
    z-index: 2;
    outline: none;
}

.form-actions {
    margin-top: 30px;
}

.btn-block {
    width: 100%;
    display: block;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.forgot-password {
    margin-bottom: 15px;
}

.forgot-password a {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
}

.forgot-password a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.register-link {
    font-size: 14px;
    color: var(--gray);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background: transparent;
    padding: 5px 15px;
    border-radius: 20px;
    margin-left: 10px;
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-block;
}

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

/* Page de Profil */
.profile-page-wrapper {
    padding: 60px 0;
    background: #f8f9fa;
    min-height: calc(100vh - 200px);
}

.profile-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid #e7e7e7;
}

.profile-header-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 40px 20px;
    text-align: center;
    color: var(--white);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    font-size: 40px;
}

.profile-name {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
}

.profile-role.badge {
    background: var(--accent-yellow);
    color: #333;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    display: inline-block;
}

.profile-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.status-indicator.active {
    background: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.3);
}

.profile-body {
    padding: 40px;
}

.profile-body .section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-list {
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f9f9f9;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--gray);
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #333;
}

.groups-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.group-badge {
    background: #f0f4f8;
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e1e8ed;
}

.profile-actions {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e7e7e7;
}

.mt-30 {
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .banner-title {
        font-size: 32px;
    }

    .latest-post img {
        height: 200px;
    }

    .publication-title {
        font-size: 24px;
    }

    .document-card {
        flex-direction: column;
    }

    .document-icon {
        width: 100%;
        height: 80px;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* --- CORRECTIF DATE PUBLICATION --- */
/* Positionne la date en bas à gauche de l'image sans la masquer */
.latest-post-media .post-item-date {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    right: auto !important;
    background: rgba(0, 99, 172, 0.9) !important;
    /* Bleu primaire semi-transparent */
    color: #ffffff !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    border-radius: 0 6px 0 0 !important;
    /* Coin arrondi en haut à droite */
    font-size: 12px !important;
    font-weight: 600 !important;
    z-index: 10 !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    /* Permet de cliquer sur l'image en dessous */
}

.latest-post-media .post-item-date i {
    font-size: 11px !important;
    margin-right: 0 !important;
}