/* =============================================================================
   AMÉLIORATIONS SUBTILES - Design blanc/vert sobre
   ============================================================================= */

/* Variables pour un design sobre */
:root {
    --primary-green: #2E7D32;
    --light-green: #4CAF50;
    --pale-green: #E8F5E9;
    --border-green: #A5D6A7;
    
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

/* =============================================================================
   HEADER ÉPURÉ
   ============================================================================= */
header {
    border-bottom: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background: white;
}

/* Barre institutionnelle du haut */
.banner-top {
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
}

/* Navbar */
.navbar {
    background: white !important;
    padding: 0.5rem 1rem;
}

.navbar-brand {
    color: #333 !important;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: var(--primary-green) !important;
}

.navbar-brand img {
    height: 28px !important;
    width: auto;
}

/* Navigation links - style sobre */
.navbar-nav {
    gap: 0.25rem;
}

.navbar-nav .nav-link {
    color: #555 !important;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem !important;
    border-radius: 0;
    margin: 0;
    position: relative;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-green) !important;
    background: transparent;
    border-bottom-color: var(--border-green);
}

.navbar-nav .nav-link.active {
    color: var(--primary-green) !important;
    background: transparent !important;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-green);
}

/* Supprime le margin-bottom de la navbar */
.navbar.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* =============================================================================
   SIDEBAR AVEC CARTES MODERNES - Style épuré
   ============================================================================= */

/* Carte de base */
.sidebar-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: all 0.25s ease;
    border: 1px solid #e9ecef;
}

.sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #d0d0d0;
}

/* Header de carte - style léger */
.sidebar-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

.sidebar-card__header i {
    font-size: 0.85rem;
    color: var(--primary-green);
}

/* Header danger - juste l'icône et le texte */
.sidebar-card__header--danger {
    color: #721c24;
}

.sidebar-card__header--danger i {
    color: #dc3545;
}

/* Bordure latérale colorée au lieu d'aplat */
.sidebar-card--alert {
    border-left: 3px solid #dc3545;
}

.sidebar-card--actu {
    border-left: 3px solid var(--primary-green);
}

.sidebar-card--rules {
    border-left: 3px solid #6c757d;
}

.sidebar-card--info {
    border-left: 3px solid #17a2b8;
    background-color: #f8f9fa;
}

.sidebar-card--info .sidebar-card__header {
    background-color: #e9ecef;
}

.sidebar-card--info .sidebar-card__text {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Contenu de carte */
.sidebar-card__content {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.sidebar-card__content:hover {
    text-decoration: none;
}

/* Image dans la carte */
.sidebar-card__image {
    position: relative;
    overflow: hidden;
}

.sidebar-card__image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.sidebar-card:hover .sidebar-card__image img {
    transform: scale(1.02);
}

/* Corps de carte */
.sidebar-card__body {
    padding: 1rem 1.1rem 1.1rem;
}

.sidebar-card__title {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    line-height: 1.35;
}

.sidebar-card__text {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

.sidebar-card__text strong {
    color: #333;
}

.sidebar-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-green);
    transition: all 0.2s ease;
}

.sidebar-card__link i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.sidebar-card:hover .sidebar-card__link {
    color: var(--light-green);
}

.sidebar-card:hover .sidebar-card__link i {
    transform: translateX(3px);
}

/* Liste dans la carte (règles d'usage) */
.sidebar-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-card__list li {
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-card__list li:last-child {
    border-bottom: none;
}

.sidebar-card__list a {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    text-decoration: none;
    color: #555;
    transition: all 0.2s ease;
    font-size: 0.82rem;
    line-height: 1.4;
}

.sidebar-card__list a:hover {
    background: #f8f9fa;
    color: var(--primary-green);
}

.sidebar-card__list a i {
    color: #999;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    transition: color 0.2s;
}

.sidebar-card__list a:hover i {
    color: var(--primary-green);
}

/* Variante alerte - corps */
.sidebar-card--alert .sidebar-card__body {
    padding: 0.9rem 1rem;
}

/* Ancien style - fallback pour compatibilité */
.bloc-communication, 
.bloc-important, 
#regle-usage {
    border-radius: 12px !important;
    box-shadow: var(--shadow-subtle) !important;
    transition: var(--transition);
    border: 1px solid #e9ecef !important;
    position: relative;
    overflow: hidden;
}

.bloc-communication::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--light-green);
}

.bloc-communication:hover,
.bloc-important:hover,
#regle-usage:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover) !important;
}

.bloc-important {
    border-left: 4px solid #dc3545 !important;
}

.bloc-important::before {
    background: #dc3545 !important;
}

/* Amélioration des liens dans la sidebar */
.bloc-communication a,
.bloc-important a,
#regle-usage a {
    color: var(--primary-green) !important;
    transition: var(--transition);
}

.bloc-communication a:hover,
.bloc-important a:hover,
#regle-usage a:hover {
    color: var(--light-green) !important;
}

/* =============================================================================
   NAVIGATION DES CATÉGORIES - Style discret
   ============================================================================= */
.categories-nav {
    background: transparent;
    border-radius: 0;
    padding: 8px 0;
    box-shadow: none;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.nav-tabs {
    border-bottom: none !important;
}

.nav-tabs .nav-link {
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
    padding: 8px 16px !important;
    margin: 0 4px 4px 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 400;
    color: #495057 !important;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-tabs .nav-link:hover {
    background-color: #f8f9fa;
    color: #212529 !important;
    border-color: #adb5bd !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.nav-tabs .nav-link.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.nav-tabs .nav-link .check-icon {
    color: white;
    margin-right: 4px;
}

/* Animation pour la sélection */
.nav-tabs .nav-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   CARTES D'APPLICATIONS
   ============================================================================= */
.block-app_1 {
    border-radius: 10px !important;
    box-shadow: var(--shadow-subtle) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef !important;
    margin-bottom: 20px !important;
    background-color: #f8f9fa !important;
}

.block-app_1:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover) !important;
    border-color: #e9ecef !important;
}

/* Tout le bloc en gris clair */
.block-app_1 .card-header,
.block-app_1 .card-body,
.block-app_1 .content-app {
    background-color: #f8f9fa !important;
    border: none !important;
    box-shadow: none !important;
}

/* Désactiver l'effet hover sur content-app pour éviter le double effet */
.block-app_1 .content-app:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: #f8f9fa !important;
}

.block-app_1 .card-header {
    border-radius: 10px 10px 0 0 !important;
    margin: -1px -1px 0 -1px !important;
    padding: 15px 20px !important;
}

.block-app_1 .card-body {
    border-radius: 0 0 10px 10px !important;
    padding: 15px 20px !important;
}

.block-app_1 .content-app {
    border-radius: 8px !important;
    padding: 12px 15px !important;
}

/* =============================================================================
   FOOTER AMÉLIORÉ
   ============================================================================= */
.site-footer {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid var(--primary-green);
    padding: 2.5rem 0 0 0;
    margin-top: 3rem;
}

/* Titres des catégories (pages apps et recherche) */
.category-section .category-title,
.apps-category-section .category-title {
    font-size: 1.28rem;
    font-weight: 700;
    color: #2f3f52;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #dbe1ea;
    padding-bottom: 0.4rem;
    margin-bottom: 1.1rem;
    position: relative;
    padding-left: 0.6rem;
}

.category-section .category-title::before,
.apps-category-section .category-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2rem;
    bottom: 0.2rem;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, #4fa3ff 0%, #2d77c7 100%);
}

.site-footer .footer-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.site-footer .footer-brand img {
    height: 80px;
    width: auto;
}

.site-footer .footer-info {
    text-align: center;
}

.site-footer .footer-credit {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #495057;
}

.site-footer .footer-credit strong {
    color: var(--primary-green);
}

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

.site-footer .footer-links a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition);
}

.site-footer .footer-links a:hover {
    color: var(--light-green);
    text-decoration: underline;
}

.site-footer .footer-links .separator {
    color: #adb5bd;
    margin: 0 0.75rem;
}

.site-footer .footer-contact {
    text-align: right;
}

.site-footer .contact-label {
    margin: 0 0 0.25rem 0;
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.site-footer .contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.site-footer .contact-email:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.2);
}

.site-footer .footer-bottom {
    padding: 1rem 0;
    text-align: center;
}

.site-footer .footer-bottom p {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Responsive footer */
@media (max-width: 991.98px) {
    .site-footer .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .site-footer .footer-brand {
        display: flex;
        justify-content: center;
    }
    
    .site-footer .footer-contact {
        text-align: center;
    }
}

/* Ancien footer (fallback) */
footer:not(.site-footer) {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-top: 3px solid var(--primary-green) !important;
}

footer:not(.site-footer) a {
    color: var(--primary-green) !important;
    transition: var(--transition);
}

footer:not(.site-footer) a:hover {
    color: var(--light-green) !important;
}

/* =============================================================================
   ANIMATIONS SUBTILES
   ============================================================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bloc-communication,
.bloc-important,
#regle-usage {
    animation: fadeInUp 0.4s ease-out;
}

.bloc-communication { animation-delay: 0.1s; }
.bloc-important { animation-delay: 0.2s; }
#regle-usage { animation-delay: 0.3s; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
    .categories-nav {
        padding: 10px 15px;
    }
    
    .nav-tabs .nav-link {
        padding: 6px 12px !important;
        font-size: 13px;
    }
    
    /* Styles pour le dropdown mobile avec checkboxes */
    .mobile-filters {
        margin-bottom: 1.5rem;
    }
    
    .mobile-filters .dropdown-toggle {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 8px;
        border: 1px solid #e0e0e0;
        background-color: #ffffff;
        color: #495057;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
    }
    
    .mobile-filters .dropdown-toggle:hover,
    .mobile-filters .dropdown-toggle:focus {
        border-color: #adb5bd;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    }
    
    .mobile-filters .dropdown-menu {
        max-height: 400px;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        padding: 0.5rem 0;
        border: 1px solid #e0e0e0;
    }
    
    .mobile-filters .dropdown-item-wrapper {
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .mobile-filters .form-check {
        padding: 10px 16px;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        transition: background-color 0.2s ease;
    }
    
    .mobile-filters .form-check:hover {
        background-color: #f8f9fa;
    }
    
    .mobile-filters .form-check-input {
        width: 20px;
        height: 20px;
        margin: 0;
        flex-shrink: 0;
        border: 2px solid #adb5bd;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-filters .form-check-input:hover {
        border-color: #6c757d;
    }
    
    .mobile-filters .form-check-input:checked {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }
    
    .mobile-filters .form-check-label {
        margin: 0;
        cursor: pointer;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #495057;
        font-size: 15px;
    }
    
    .mobile-filters .badge {
        font-size: 12px;
        padding: 4px 8px;
        font-weight: 500;
    }
}

/* =============================================================================
   ESPACEMENT CARTES APP
   ============================================================================= */
.block-app_1 .header-bloc-texte {
    margin-bottom: 0 !important;
    min-height: auto;
    align-items: center !important;
}

.block-app_1 .app-description {
    margin-bottom: 0 !important;
    margin-top: 2px;
}

.block-app_1 .app-name {
    line-height: 1.4;
}

/* Boutons aide/suggestion plus compacts */
.block-app_1 .app-help-btn,
.block-app_1 .app-bai-btn {
    padding: 2px 6px !important;
    font-size: 12px;
    margin-left: 4px !important;
}
