/* ============================================================
   DESIGN NAVIGATION - SPÉCIAL METISMENU (JOOMLA 6)
   ============================================================ */

/* --- 1. BARRE DE NAVIGATION (HEADER) --- */
.container-header {
    background-color: #1a237e !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

/* --- 2. LIENS PRINCIPAUX (NIVEAU 1) --- */
.metismenu-item > a {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    text-transform: uppercase;
    padding: 0.8rem 1.2rem !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.metismenu-item.active > a, 
.metismenu-item > a:hover {
    color: #ffca28 !important;
    border-bottom: 3px solid #ffca28;
}

/* --- 3. GESTION DU SURVOL SUR DESKTOP (Min 992px) --- */
@media (min-width: 992px) {
    /* On positionne le parent en relatif pour que le menu enfant se cale dessous */
    .metismenu-item {
        position: relative;
    }

    /* On force l'affichage du sous-menu (mm-collapse) au survol */
    .metismenu-item:hover > .mm-collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: absolute; /* Flotte au-dessus du contenu */
        top: 100%;
        left: 0;
        background: #ffffff !important;
        min-width: 260px;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        border-top: 4px solid #ffca28;
        padding: 10px 0;
        animation: fadeInMenu 0.3s ease;
    }

    /* LE PONT INVISIBLE : Zone de 20px pour éviter la fermeture au mouvement */
    .metismenu-item:hover > .mm-collapse::before {
        content: "";
        position: absolute;
        top: -20px;
        left: 0;
        right: 0;
        height: 20px;
        display: block;
    }

    /* Cache le bouton (+) de MetisMenu sur Desktop car inutile au survol */
    .metismenu-item .mm-toggler {
        display: none !important;
    }
}

/* --- 4. STYLE DES LIENS DANS LE SOUS-MENU --- */
.mm-collapse .metismenu-item a {
    color: #1a237e !important;
    padding: 0.7rem 1.5rem !important;
    border-bottom: 1px solid #f1f1f1 !important;
    display: block !important;
    text-transform: none !important;
    font-weight: 400;
    width: 100%;
    border-left: 0px solid transparent;
}

.mm-collapse .metismenu-item:last-child a {
    border-bottom: none !important;
}

.mm-collapse .metismenu-item a:hover {
    background-color: #f8f9fa !important;
    color: #8b0000 !important;
    padding-left: 2rem !important;
    border-left: 4px solid #8b0000;
}

/* --- 5. ANIMATION ET ADAPTATION MOBILE --- */
@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .metismenu-item > a {
        border-bottom: none !important;
    }
    /* Sur mobile, on laisse MetisMenu gérer le clic normalement */
    .mm-collapse {
        position: static;
        box-shadow: none;
    }
}



/* ============================================================
   3. CADRE SACRÉ (PHOTO DU VÉNÉRABLE)
   ============================================================ */
.portrait-frame, .portrait-wrapper {
    margin: 20px auto;
    border: 2px solid #fff5e6; /* Nacre */
    outline: 5px solid #bf9b30; /* Or riche */
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5), 0 10px 30px rgba(0,0,0,0.4);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.5s ease;
}

.portrait-frame:hover {
    outline-color: #ffd700;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.7), 0 15px 40px rgba(0,0,0,0.5);
    transform: translateY(-5px);
}

.portrait-frame img {
    transition: transform 0.6s ease;
}

.portrait-frame:hover img {
    transform: scale(1.05);
}

/* ============================================================
   4. AJUSTEMENTS RESPONSIVE (MOBILE)
   ============================================================ */
/* --- 6. ADAPTATION MOBILE (Tablettes et Smartphones) --- */
@media (max-width: 991px) {
    /* Style des liens du menu mobile */
    .navbar-nav .nav-link {
        border-bottom: none !important; /* Supprime la ligne horizontale du desktop */
        border-left: 4px solid transparent; /* Prépare la ligne verticale à gauche */
        padding: 0.8rem 1rem !important;
        transition: all 0.3s ease;
    }

    /* Indicateur visuel pour la page active en mobile */
    .navbar-nav .active > .nav-link,
    .navbar-nav .nav-link:hover {
        border-left: 4px solid #ffca28 !important; /* Ligne jaune à gauche */
        background-color: rgba(255, 255, 255, 0.05); /* Léger fond pour le clic */
    }

    /* Ajustement des images de carrousel pour petit écran */
    #carouselMigration img, 
    #carouselHome img {
        height: 250px !important;
        object-fit: cover; /* Évite de déformer l'image malgré la hauteur forcée */
    }
}

/*Survol sur une image, effet zoom */
/* Seules les images à l'intérieur d'un lien 'hover-zoom' bougeront */
.hover-zoom-sb:hover img {
    transform: scale(1.05); /* Agrandissement de 5% */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); /* Ajoute une ombre pour donner du relief */
}

.hover-zoom-sb img {
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Pour que le mouvement soit fluide */
}

/* Conteneur principal pour Thong Tin */
.thong-tin-box {
    background-color: #e9eff5; /* Fond gris très clair */
    border: 1px solid #b8c9d9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

/* En-tête avec dégradé bleu */
.thong-tin-header {
    background: linear-gradient(to bottom, #0056b3, #00aaff, #0056b3);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid #b8c9d9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Style de la liste */
.thong-tin-list {
    list-style: none;
    padding: 15px;
    margin: 0;
}

.thong-tin-list li {
    position: relative;
    padding-left: 0 !important;
    margin-bottom: 4px; /* Réduit de 12px à 4px */
    line-height: 1.2;    /* Resserre l'interligne du texte s'il passe sur 2 lignes */
}

/* Création des puces bleues personnalisées */
.thong-tin-list li::before {
    content: none !important; 
}

/* Style des liens */
.thong-tin-list li a {
    color: #4a7ebb;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.thong-tin-list li a:hover {
    color: #2a4d7d;
    text-decoration: underline;
}

/* ============================================================
   DESIGN HARMONISÉ COLONNE DROITE (SIDEBAR)
   ============================================================ */

/* Conteneur identique à Thong Tin */
.sidebar-nav-block {
    background-color: #e9eff5; /* Fond gris bleu clair */
    border: 1px solid #b8c9d9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.05);
}

/* En-tête avec dégradé bleu identique */
.sidebar-nav-header {
    background: linear-gradient(to bottom, #9dc2e5 0%, #70a1d7 100%);
    color: #000;
    text-align: center;
    padding: 12px 5px;
    font-size: 18px; /* Un peu plus petit pour les blocs secondaires */
    font-weight: bold;
    border-bottom: 1px solid #b8c9d9;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.5);
    text-transform: uppercase;
}

/* Liste de liens */
.sidebar-nav-list {
    list-style: none;
    padding: 10px 15px;
    margin: 0;
}

.sidebar-nav-list li {
    position: relative;
    padding-left: 0 !important;
    padding-top: 4px;    /* Réduit de 8px à 4px */
    padding-bottom: 4px; /* Réduit de 8px à 4px */
    border-bottom: 1px solid rgba(184, 201, 217, 0.3);
    line-height: 1.3;
}

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

/* Puce point bleu identique */
/* --- VERSION SANS PUCE --- */
.sidebar-nav-list li::before {
    content: none !important; /* Enlève physiquement la puce */
}

/* Style des liens */
.sidebar-nav-list li a {
    color: #4a7ebb;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sidebar-nav-list li a:hover {
    color: #8b0000; /* Rouge au survol pour attirer l'attention */
    text-decoration: underline;
}

/* Optionnel : Style spécial pour Amazon (en orange) */
.sidebar-nav-list li a.link-amazon:hover {
    color: #ff9900;
}


/* Bloc de compteur de visite */
/* Style harmonisé pour le compteur JO Visitor Counter */
.mod_jovisitorcounter { 
    background-color: #e9eff5 !important; /* Même fond gris clair que Thông Tin */
    border: 1px solid #b8c9d9 !important;
    border-radius: 10px;
    padding: 0 !important; /* On enlève le padding pour que le header touche les bords */
    overflow: hidden;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}

/* On crée un bandeau de titre pour le compteur comme pour Thông Tin */
.mod_jovisitorcounter::before {
    content: "Statistiques";
    display: block;
    background: linear-gradient(to bottom, #0056b3, #00aaff, #0056b3);
    color: white;
    text-align: center;
    padding: 10px 5px;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid #b8c9d9;
	box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Style des lignes de statistiques à l'intérieur */
.mod_jovisitorcounter .jo-visitor-counter-item, 
.mod_jovisitorcounter ul, 
.mod_jovisitorcounter li {
    list-style: none;
    padding: 4px 15px !important;
    margin: 0;
    color: #4a7ebb;
    font-weight: bold;
    border-bottom: 1px solid #dee2e6;
}

/* On enlève la bordure sur la dernière ligne */
.mod_jovisitorcounter li:last-child {
    border-bottom: none;
}


/*Style pour afficher des livres */
<style>
  /* Conteneur global */
  .collection-container {
    max-width: 1020px;
    margin: 20px auto !important;
    display: flex !important;
    flex-direction: column !important; /* Aligne les éléments verticalement */
    align-items: center !important;    /* Centre horizontalement tous les enfants directs */
    justify-content: center !important;
    text-align: center !important;
  }

  /* Rectangle Titre */
  .main-title-box {
    /* --- Gardez vos styles de design (couleurs, bordures, etc.) --- */
    background: linear-gradient(to bottom, #4a322d, #63463e, #4a322d);
    color: #f1d3a1; 
    padding: 15px 30px;
    border: 2px solid #8d7561;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);

    /* --- LES 3 LIGNES POUR LE CENTRAGE DIRECT --- */
    display: table !important;      /* Se comporte comme un bloc mais s'ajuste au texte */
    margin-left: auto !important;   /* Pousse à gauche */
    margin-right: auto !important;  /* Pousse à droite */
    
    /* Optionnel : pour l'espacement avec les livres */
    margin-bottom: 50px;
}

  /* Grille réactive */
  .books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    padding: 20px;
    perspective: 1500px;
  }

  /* Conteneur individuel du livre */
  .book-item {
   width: 170px;  /* Taille réelle de votre image */
   height: 270px; /* Taille réelle de votre image */
   margin: 0 auto;
   text-decoration: none;
   display: block;
   position: relative;
  }

  /* La carte qui pivote */
  .book-card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    transform-origin: left center;
  }

  /* Effet d'ouverture au survol */
  .book-item:hover .book-card {
    transform: rotateY(-135deg);
  }

  /* Faces du livre */
  .book-front, .book-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
  }

  /* Couverture (Avant) */
  .book-front {
    background: #800000;
    z-index: 2;
  }

  .book-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast; /* Améliore la netteté sur certains navigateurs */
    border-radius: 3px 8px 8px 3px;
    display: block;
  }

  /* Intérieur */
  .book-back {
    background: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    padding: 15px;
    box-sizing: border-box;
    background-image: linear-gradient(90deg, #e0e0e0 0%, #ffffff 15%);
  }

  .book-back span {
    color: #800000;
    font-weight: bold;
    font-size: 0.9rem;
  }

  /* Ombre portée */
  .book-item::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 5%;
    width: 90%;
    height: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    filter: blur(5px);
    z-index: -1;
  }
</style>

/*                                                           */
/* Conteneur principal pour présenter Phat Quand Dai Tu Dien */
/*                                                           */
.dictionary-container {
    font-family: 'Times New Roman', Times, serif;
    color: #333300;
    line-height: 1.6;
    max-width: 1000px;
    margin: 0 auto;
}

/* Images responsives */
.img-center {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    height: auto;
}

/* Titre principal */
.main-title {
    font-size: 18pt;
    color: #993300;
    text-decoration: underline;
    background-color: #ffffff;
    font-weight: bold;
}

/* Texte de description */
.description-text {
    font-size: 14pt;
    text-align: justify;
    margin-bottom: 25px;
}

.first-letter {
    font-size: 24pt;
    font-weight: bold;
}

/* Section Alphabet */
.alphabet-title {
    text-align: center;
    font-size: 14pt;
    color: #800000;
    margin-top: 30px;
}

.alphabet-grid {
    text-align: center;
    font-size: 18pt;
    font-weight: bold;
    word-spacing: 15px;
    margin: 20px 0;
}

.alphabet-grid a {
    text-decoration: none;
    transition: opacity 0.3s;
}

.alphabet-grid a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.link-brown { color: #800000; }
.link-red { color: #ff0000; }

/* Note de bas de page */
.missing-letters {
    text-align: center;
    color: #000080;
    font-size: 12pt;
    margin-top: 20px;
}

.footer-note {
    text-align: center;
    font-size: 12px;
    color: #000000;
}

/* On crée un affichage flash afin d'alerter les lecteurs */
.thong-tin-list li.info-highlight {
    background: #fff3cd;
    border: 2px solid #c62828;
    border-radius: 8px;
    padding: 8px 10px !important;
    margin-top: 8px;
    box-shadow: 0 0 10px rgba(198, 40, 40, 0.15);
}

.thong-tin-list li.info-highlight a {
    color: #8b0000 !important;
    font-weight: 700;
    display: block;
}

.thong-tin-list li.info-highlight a:hover {
    color: #b71c1c !important;
    text-decoration: underline;
}

.blink-badge {
    display: inline-block;
    background: #c62828;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 6px;
    animation: blinkSoft 1.4s infinite;
}

@keyframes blinkSoft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .blink-badge {
        animation: none;
    }
}

/* -------------------------------------------------------- */
/* Ce CSS est utilisé pour publier article in an 16 tap cuoi */
/* -------------------------------------------------------- */
.thong-bao-box {
    background: #e9eff5;
    border: 1px solid #b8c9d9;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
    font-family: Arial, sans-serif;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.08);
    max-width: 1000px;
}

.thong-bao-header {
    background: linear-gradient(to bottom, #0056b3, #00aaff, #0056b3);
    color: #fff;
    text-align: center;
    padding: 12px 10px;
    font-size: 1.15rem;
    font-weight: bold;
    border-bottom: 1px solid #b8c9d9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-transform: uppercase;
}

.thong-bao-content {
    padding: 18px 20px;
    color: #1f2d3d;
    line-height: 1.7;
    font-size: 1rem;
}

.thong-bao-content p {
    margin-bottom: 14px;
}

.thong-bao-content strong {
    color: #8b0000;
}

.thong-bao-highlight {
    background: #fff8dc;
    border-left: 5px solid #c62828;
    padding: 14px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-weight: 600;
    color: #5a3b00;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.thong-bao-action {
    text-align: center;
    margin-top: 18px;
}

.thong-bao-btn {
    display: inline-block;
    background: #800020;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: bold;
    padding: 12px 22px;
    border-radius: 999px;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(128,0,32,0.2);
}

.thong-bao-btn:hover {
    background: #a00028;
    color: #ffd700 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(128,0,32,0.28);
}

@media (max-width: 768px) {
    .thong-bao-content {
        padding: 14px 14px;
        font-size: 0.98rem;
    }

    .thong-bao-header {
        font-size: 1rem;
        padding: 10px 8px;
    }

    .thong-bao-btn {
        width: 100%;
        max-width: 100%;
        padding: 12px 16px;
    }
}
