/* ========================================
   STYLE SOUFI - Élégance verte islamique
   Palette : Vert émeraude, Or, Ivoire
   ======================================== */

/* ==== Import des polices ==== */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Scheherazade+New:wght@400;700&display=swap');

/* ==== Variables de couleurs ==== */
:root {
    --gold: #c9a84c;
    --gold-light: #e0c878;
    --gold-dark: #a8862e;
    --ivory: #f5f0e1;
    --ivory-light: #faf7ef;
    --green-dark: #0a1f0a;
    --green-deep: #0d2818;
    --green-forest: #1a3c2a;
    --green-emerald: #2d5a3d;
    --green-medium: #3d7a52;
    --green-light: #5a9e6f;
    --green-pale: #8fbc9f;
    --text-light: #e8f0e8;
    --text-muted: #a8c8a8;
    --border-gold: rgba(201, 168, 76, 0.3);
    --border-green: rgba(90, 158, 111, 0.3);
    --shadow-gold: rgba(201, 168, 76, 0.15);
    --shadow-green: rgba(45, 90, 61, 0.3);
}

/* ==== Corps général ==== */
body {
    background: linear-gradient(180deg, var(--green-dark) 0%, var(--green-deep) 50%, var(--green-dark) 100%);
    min-height: 100vh;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    color: var(--text-light);
    position: relative;
}

/* Motif géométrique subtil en arrière-plan */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(90, 158, 111, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(201, 168, 76, 0.03) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='rgba(90,158,111,0.08)' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ==== Conteneur principal ==== */
.sufi-container {
    position: relative;
    z-index: 1;
    background: rgba(13, 40, 24, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 40px;
    margin: 30px auto;
    max-width: 1200px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 60px var(--shadow-green);
}

/* ==== En-tête avec ornement ==== */
.sufi-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.sufi-header::before,
.sufi-header::after {
    content: '❖';
    color: var(--gold);
    font-size: 1.5rem;
    display: block;
    margin: 15px 0;
}

/* ==== Titres ==== */
.main-title {
    font-family: 'Amiri', 'Times New Roman', serif;
    color: var(--gold-light);
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.4);
}

.section-title {
    font-family: 'Amiri', 'Times New Roman', serif;
    color: var(--gold);
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin: 40px 0 20px;
    letter-spacing: 1px;
}

.subtitle {
    font-family: 'Scheherazade New', 'Amiri', serif;
    color: var(--green-pale);
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 30px;
}

/* ==== Versets coraniques ==== */
.quranic-verse {
    background: linear-gradient(135deg, rgba(26, 60, 42, 0.8), rgba(45, 90, 61, 0.6));
    border: 1px solid var(--border-gold);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    position: relative;
    text-align: center;
}

.quranic-verse::after {
    content: '﴿';
    color: var(--gold);
    font-size: 2rem;
    display: block;
    margin-bottom: 15px;
}

.quranic-verse::before {
    content: '﴾';
    color: var(--gold);
    font-size: 2rem;
    display: block;
    margin-top: 15px;
}

/* Version RTL (arabe) - symboles inversés */
[dir="rtl"] .quranic-verse::after {
    content: '﴾';
}

[dir="rtl"] .quranic-verse::before {
    content: '﴿';
}

.verse-text {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.4rem;
    line-height: 2;
    color: var(--ivory);
    letter-spacing: 0.5px;
}

/* ==== Textes de prière ==== */
.prayer-section {
    margin: 50px 0;
    position: relative;
}

.prayer-card {
    background: linear-gradient(135deg, rgba(20, 45, 30, 0.9), rgba(30, 65, 45, 0.8));
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 35px;
    position: relative;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.prayer-card::before {
    content: '★';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green-deep);
    color: var(--gold);
    padding: 0 10px;
    font-size: 1.5rem;
}

.prayer-text {
    font-family: 'Amiri', 'Georgia', serif;
    color: var(--ivory);
    font-size: 1.2rem;
    line-height: 2;
    text-align: justify;
    letter-spacing: 0.3px;
}

.prayer-text p {
    margin-bottom: 25px;
    text-indent: 30px;
}

.prayer-text p:first-child {
    text-indent: 0;
}

.prayer-reference {
    text-align: right;
    color: var(--green-pale);
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* ==== Textes spirituels ==== */
.spiritual-text {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.9;
    text-align: justify;
    margin: 30px 0;
}

.spiritual-text p {
    margin-bottom: 25px;
}

.spiritual-text em {
    color: var(--gold-light);
    font-style: italic;
}

/* ==== Citations ==== */
blockquote {
    border-left: 3px solid var(--green-light);
    margin: 30px 0;
    padding: 20px 30px;
    background: rgba(90, 158, 111, 0.1);
    border-radius: 0 10px 10px 0;
    font-style: italic;
}

blockquote p {
    margin: 0;
    color: var(--green-pale);
}

/* ==== Navigation ==== */
.figure-name {
    color: var(--gold-light) !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Amiri', serif;
    letter-spacing: 0.5px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 40px 0;
    padding: 25px;
    background: rgba(90, 158, 111, 0.08);
    border: 1px solid var(--border-green);
    border-radius: 12px;
}

.footer-nav a {
    color: var(--green-pale);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s;
    position: relative;
    font-family: 'Amiri', serif;
    letter-spacing: 0.5px;
}

.footer-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--green-light);
    transition: width 0.3s;
}

.footer-nav a:hover {
    color: #ffffff;
    background: rgba(90, 158, 111, 0.15);
}

.footer-nav a:hover::after {
    width: 60%;
}

.footer-nav .nav-separator {
    color: var(--gold-dark);
    opacity: 0.5;
}

/* ==== Images ==== */
.image-container {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.image-frame {
    display: inline-block;
    position: relative;
    padding: 10px;
    background: rgba(90, 158, 111, 0.1);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.image-frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-green);
    background: rgba(90, 158, 111, 0.2);
    border-color: var(--green-light);
}

.image-frame img {
    display: block;
    border-radius: 5px;
    max-width: 100%;
    height: auto;
}

.image-caption {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    margin-top: 15px;
    letter-spacing: 1px;
}

/* ==== Séparateurs ornementaux ==== */
.ornament-divider {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.ornament-divider::before,
.ornament-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green-light));
}

.ornament-divider::before {
    left: 0;
}

.ornament-divider::after {
    right: 0;
    transform: scaleX(-1);
}

.ornament-symbol {
    color: var(--gold);
    font-size: 1.8rem;
    position: relative;
    z-index: 1;
}

/* ==== Boutons ==== */
.btn-sufi {
    background: transparent;
    border: 1px solid var(--green-light);
    color: var(--green-pale);
    padding: 12px 30px;
    border-radius: 25px;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}

.btn-sufi::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(90, 158, 111, 0.2), transparent);
    transition: left 0.5s;
}

.btn-sufi:hover {
    background: rgba(90, 158, 111, 0.1);
    box-shadow: 0 0 20px var(--shadow-green);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-sufi:hover::before {
    left: 100%;
}

/* ==== Navbar ==== */
.navbar-sufi {
    background: rgba(10, 31, 10, 0.95) !important;
    border-bottom: 1px solid var(--border-green);
    backdrop-filter: blur(10px);
}

.navbar-sufi .navbar-brand {
    color: var(--green-pale) !important;
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.navbar-sufi .nav-link {
    color: var(--text-light) !important;
    transition: all 0.3s;
    font-family: 'Amiri', serif;
    letter-spacing: 0.5px;
    position: relative;
}

.navbar-sufi .nav-item:has(.nav-link.active), .nav-item:has(.dropdown-item.active) {
    background-color:green;
    border-radius:5px;
}

.nav-item{
    padding:0px 4px;
}

/* ==== Cartes ==== */
.card-sufi {
    background: rgba(26, 60, 42, 0.7);
    border: 1px solid var(--border-green);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    transition: all 0.3s;
}

.card-sufi:hover {
    background: rgba(26, 60, 42, 0.9);
    box-shadow: 0 5px 20px var(--shadow-green);
    transform: translateY(-3px);
}

/* ==== Footer ==== */
.footer-sufi {
    background: rgba(10, 31, 10, 0.95) !important;
    border-top: 1px solid var(--border-green);
    color: var(--text-muted);
    padding: 20px 0;
    font-family: 'Amiri', serif;
}

/* ==== Animations ==== */
@keyframes greenPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(90, 158, 111, 0.3);
    }
    50% {
        text-shadow: 0 0 30px rgba(90, 158, 111, 0.7);
    }
}

.green-pulse {
    animation: greenPulse 3s ease-in-out infinite;
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.subtle-float {
    animation: subtleFloat 4s ease-in-out infinite;
}

/* ==== Scrollbar personnalisée ==== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--green-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--green-forest);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--green-medium);
}

/* ==== Media Queries ==== */
@media (max-width: 768px) {
    .sufi-container {
        padding: 10px;
        margin: 20px 0px;
        border-radius: 15px;
    }

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

    .section-title {
        font-size: 1.5rem;
    }

    .prayer-text {
        font-size: 1.1rem;
    }

    .verse-text {
        font-size: 1.2rem;
    }

    .footer-nav {
        align-items: center;
    }

    .ornament-divider::before,
    .ornament-divider::after {
        width: 25%;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .prayer-card {
        padding: 20px;
    }

    .image-frame {
        padding: 5px;
    }
}

/* ==== Styles spécifiques au sommaire ==== */
.sommaire-list {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.sommaire-item {
    margin: 20px 0;
    text-align: left;
    transition: all 0.3s ease;
}

.sommaire-link {
    color: var(--green-pale);
    text-decoration: none;
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.sommaire-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: var(--green-light);
    transition: width 0.3s ease;
}

.sommaire-link:hover {
    color: #ffffff;
    background: rgba(90, 158, 111, 0.1);
    padding-left: 30px;
    text-shadow: 0 0 10px rgba(90, 158, 111, 0.5);
}

.sommaire-link:hover::before {
    width: 15px;
}

.sommaire-link img {
    transition: transform 0.3s ease;
}

.sommaire-link:hover img {
    transform: rotate(180deg);
    filter: brightness(0) invert(1);
}

/* Animation d'apparition des éléments du sommaire */
.sommaire-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.sommaire-item:nth-child(1) {
    animation-delay: 0.1s;
}
.sommaire-item:nth-child(2) {
    animation-delay: 0.2s;
}
.sommaire-item:nth-child(3) {
    animation-delay: 0.3s;
}
.sommaire-item:nth-child(4) {
    animation-delay: 0.4s;
}
.sommaire-item:nth-child(5) {
    animation-delay: 0.5s;
}
.sommaire-item:nth-child(6) {
    animation-delay: 0.6s;
}
.sommaire-item:nth-child(7) {
    animation-delay: 0.7s;
}
.sommaire-item:nth-child(8) {
    animation-delay: 0.8s;
}

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

/* ==== Styles spécifiques à l'introduction ==== */
.hadith-qodsi {
    background: linear-gradient(135deg, rgba(90, 158, 111, 0.15), rgba(201, 168, 76, 0.1));
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    text-align: center;
}

.hadith-text {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.3rem;
    color: var(--gold-light);
    font-style: italic;
    margin: 0;
}

.hadith-source {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

.verse-scroll {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    padding: 10px;
}

.content-section {
    margin: 50px 0;
}

.note-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    padding-left: 20px;
    border-left: 2px solid var(--green-light);
}

.schools-list {
    margin: 30px auto;
    max-width: 700px;
    padding: 20px;
}

.school-item {
    background: rgba(90, 158, 111, 0.08);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    padding: 15px 20px;
    margin: 15px 0;
    color: var(--text-light);
    transition: all 0.3s;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
}

.school-item:hover {
    background: rgba(90, 158, 111, 0.15);
    transform: translateX(10px);
    border-color: var(--green-light);
}

.school-icon {
    color: var(--gold);
    margin-right: 10px;
}

.verse-reference {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 15px;
    font-size: 0.9rem;
}

.final-quote {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.1), rgba(90, 158, 111, 0.1));
    border: 1px solid var(--border-gold);
    border-radius: 15px;
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
}

.final-quote p {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    color: var(--gold-light);
    font-style: italic;
    line-height: 1.8;
    text-align: center;
}

/* Responsive pour l'introduction */
@media (max-width: 768px) {
    .hadith-qodsi {
        padding: 20px;
        margin: 15px;
    }

    .hadith-text {
        font-size: 1.1rem;
    }

    .school-item {
        padding: 12px 15px;
        font-size: 1rem;
    }

    .final-quote {
        padding: 25px;
        margin: 0 15px;
    }

    .final-quote p {
        font-size: 1.1rem;
    }
}

/* ==== Styles pour la galerie ==== */
.gallery-section {
    margin: 50px 0;
}

.gallery-main {
    text-align: center;
    margin: 30px 0;
}

.gallery-main img {
    max-width: 400px;
    height: auto;
    border: 3px solid var(--border-green);
    border-radius: 10px;
    box-shadow: 0 5px 20px var(--shadow-green);
    transition: all 0.3s;
}

.gallery-caption {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    margin-top: 10px;
    font-size: 1.1rem;
}

.gallery-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: rgba(90, 158, 111, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-green);
}

.gallery-thumb {
    display: inline-block;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s;
}

.gallery-thumb:hover {
    border-color: var(--green-light);
    transform: scale(1.1);
}

.gallery-thumb.active {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--shadow-gold);
}

.gallery-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-main img {
        max-width: 300px;
    }

    .gallery-thumb img {
        width: 50px;
        height: 50px;
    }
}

/* ==== Styles spécifiques aux Soufis Marocains ==== */
.sufi-card {
    margin: 40px 0;
    padding: 20px;
    background: rgba(90, 158, 111, 0.05);
    border: 1px solid var(--border-green);
    border-radius: 15px;
    transition: all 0.3s;
}

.sufi-card:hover {
    background: rgba(90, 158, 111, 0.1);
    box-shadow: 0 5px 20px var(--shadow-green);
}

.sufi-card-content {
    margin-bottom: 20px;
}

.sufi-intro {
    font-family: 'Lucida Handwriting', 'Amiri', serif;
    color: var(--green-pale);
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    margin: 0;
}

.other-sufis {
    margin: 50px 0;
}

.other-sufis-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
}

.sufi-name-item {
    background: rgba(90, 158, 111, 0.08);
    border: 1px solid var(--border-green);
    border-radius: 25px;
    padding: 10px 20px;
    color: var(--text-light);
    font-family: 'Amiri', serif;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: center;
}

.sufi-name-item:hover {
    background: rgba(90, 158, 111, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-green);
    border-color: var(--green-light);
}

.video-container {
    margin: 30px 0;
}

/* Correction iframe vidéo mobile */
.video-frame iframe {
    max-width: 100%;
    width: 100%;
}

.video-container .image-frame {
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .sufi-card {
        padding: 15px;
        margin: 30px 0;
    }

    .sufi-intro {
        font-size: 1rem;
    }

    .other-sufis-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .sufi-name-item {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .other-sufis-list {
        grid-template-columns: 1fr;
    }

    .sufi-card {
        padding: 10px;
    }
}

/* ==== Styles spécifiques aux Soufis d'Orient ==== */
.floral-ornaments {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.floral-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.floral-icon {
    width: 41px;
    height: 37px;
    transition: all 0.3s;
}

.floral-icon.large {
    width: 56px;
    height: 57px;
}

.floral-icon:hover {
    transform: scale(1.2) rotate(15deg);
    filter: brightness(1.5);
}

/* Responsive */
@media (max-width: 768px) {
    .floral-ornaments {
        gap: 5px;
        margin: 20px 0;
    }

    .floral-row {
        gap: 10px;
    }

    .floral-icon {
        width: 30px;
        height: 27px;
    }

    .floral-icon.large {
        width: 40px;
        height: 41px;
    }
}

/* ==== Styles spécifiques aux poèmes ==== */
.poem-section {
    margin: 50px 0;
    text-align: center;
}

.poem-title {
    font-family: 'Amiri', 'Scheherazade New', serif;
    color: var(--gold-light);
    font-size: 2rem;
    font-weight: 700;
    font-style: italic;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 15px rgba(201, 168, 76, 0.4);
    letter-spacing: 1px;
}

.poem-title.poem-pink {
    color: var(--gold-light);
    text-shadow: 0 0 15px rgba(201, 168, 76, 0.4);
}

.poem-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 20px;
    text-align: center;
}

/* ============================================
   TAILLE UNIFORME POUR TOUS LES POEMES
   ============================================ */
.poem-text {
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.5rem;
    line-height: 2;
    margin: 20px 0;
    text-align: center;
}

.poem-text p {
    font-size: 1.5rem;
    line-height: 2;
    margin-bottom: 10px;
}

/* Citations individuelles (Ibn Ata Allah) - même taille que les poèmes */
.poem-text.citation-green,
.poem-text.citation-gold {
    font-size: 1.5rem;
    line-height: 2;
}

.poem-text.citation-green p,
.poem-text.citation-gold p {
    font-size: 1.5rem;
    line-height: 2;
}

/* Couleurs des poèmes */
.poem-green {
    color: var(--green-pale);
}

.poem-pink {
    color: #ff69b4;
}

.poem-pink-text {
    color: #ff69b4;
}

.poem-cyan {
    color: #00ffff;
}

.poem-author {
    text-align: right;
    margin-top: 20px;
    padding-right: 30px;
    font-style: italic;
    font-size: 1.1rem;
}

.poem-author .nav-link-sufi {
    color: #99ffff !important;
    font-weight: bold;
}

/* ==== Citations individuelles (Ibn Ata Allah) ==== */
.citation-green {
    margin-bottom: 30px;
    padding: 15px;
    border-right: 3px solid var(--green-light);
    background: rgba(90, 158, 111, 0.05);
    border-radius: 0 10px 10px 0;
}

.citation-gold {
    margin-bottom: 30px;
    padding: 15px;
    border-right: 3px solid var(--gold);
    background: rgba(201, 168, 76, 0.05);
    border-radius: 0 10px 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .poem-text,
    .poem-text p,
    .poem-text.citation-green,
    .poem-text.citation-gold,
    .poem-text.citation-green p,
    .poem-text.citation-gold p {
        font-size: 1.2rem;
        line-height: 1.9;
    }

    .poem-title {
        font-size: 1.6rem;
    }

    .poem-author {
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .poem-title {
        font-size: 1.4rem;
    }

    .poem-text,
    .poem-text p,
    .poem-text.citation-green,
    .poem-text.citation-gold,
    .poem-text.citation-green p,
    .poem-text.citation-gold p {
        font-size: 1.1rem;
        line-height: 1.8;
    }
}

/* ==== Styles pour le lexique moderne ==== */
.lexique-fr-section {
    margin: 50px 0;
}

.lexique-fr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.lexique-fr-card {
    background: rgba(90, 158, 111, 0.08);
    border: 1px solid var(--border-green);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

/* Séparateur entre le terme et la définition */
.lexique-fr-definition::before {
    content: '';
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0px auto 12px auto;
    display: block;
}

.lexique-fr-card:hover {
    background: rgba(90, 158, 111, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-green);
    border-color: var(--green-light);
}

.lexique-fr-term {
    color: var(--gold-light);
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.lexique-fr-definition {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    font-size: 1rem;
    line-height: 1.4;
    margin-top: 5px;
    position: relative;
    z-index: 1;
}

/* Alternative avec séparateur en pointillés */
.lexique-fr-card.separator-dotted .lexique-fr-definition {
    border-top: 1px dashed var(--border-green);
    padding-top: 10px;
}

/* Alternative avec icône */
.lexique-fr-card.separator-icon::after {
    content: '✦';
    color: var(--gold);
    font-size: 0.8rem;
    display: block;
    margin: 5px 0;
}


/* ==== Navigation alphabétique du lexique ==== */
.lexique-nav {
    position: sticky;
    top: 60px;
    z-index: 100;
    background: rgba(13, 40, 24, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold);
    border-radius: 15px;
    padding: 15px 20px;
    margin: 20px 0 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.lexique-nav-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.lexique-nav-link {
    color: var(--gold-light);
    text-decoration: none;
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    border: 1px solid transparent;
}

.lexique-nav-link:hover {
    color: #ffffff;
    background: rgba(201, 168, 76, 0.2);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px var(--shadow-gold);
}

.lexique-nav-separator {
    color: var(--gold-dark);
    opacity: 0.4;
    font-size: 0.8rem;
}

/* ==== Sections du lexique ==== */
.lexique-contenu {
    margin: 30px 0;
}

.lexique-lettre {
    margin-bottom: 50px;
    scroll-margin-top: 240px;
}

.lexique-lettre-titre {
    font-family: 'Amiri', 'Scheherazade New', serif;
    color: var(--gold-light);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-gold);
    text-shadow: 0 0 15px rgba(201, 168, 76, 0.4);
}

.lexique-entrees {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==== Cartes d'entrées ==== */
.lexique-entree {
    background: rgba(90, 158, 111, 0.05);
    border: 1px solid var(--border-green);
    border-left: 4px solid var(--gold);
    border-radius: 12px;
    padding: 25px 30px;
    transition: all 0.3s ease;
}

.lexique-entree:hover {
    background: rgba(90, 158, 111, 0.1);
    border-left-color: var(--gold-light);
    transform: translateX(5px);
    box-shadow: 0 5px 20px var(--shadow-green);
}

.lexique-terme {
    font-family: 'Amiri', 'Scheherazade New', serif;
    color: var(--gold-light);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-green);
}

.lexique-definition {
    color: var(--text-light);
    font-family: 'Amiri', 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.9;
    text-align: justify;
    margin-bottom: 15px;
}

.lexique-note {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    font-size: 0.95rem;
    line-height: 1.7;
    font-style: italic;
    padding: 10px 15px;
    background: rgba(201, 168, 76, 0.08);
    border-radius: 8px;
    border-right: 3px solid var(--gold);
    margin-top: 15px;
}

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

.lexique-back-link {
    color: var(--green-pale);
    text-decoration: none;
    font-family: 'Amiri', serif;
    font-size: 0.95rem;
    padding: 8px 20px;
    border: 1px solid var(--border-green);
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
}

.lexique-back-link:hover {
    color: #ffffff;
    background: rgba(90, 158, 111, 0.15);
    border-color: var(--green-light);
    transform: translateY(-2px);
}

/* ==== Responsive ==== */
@media (max-width: 768px) {
    .lexique-nav {
        top: 50px;
        padding: 10px;
        border-radius: 10px;
    }

    .lexique-nav-link {
        font-size: 1.1rem;
        padding: 5px 8px;
        min-width: 35px;
    }

    .lexique-nav-separator {
        display: none;
    }

    .lexique-lettre-titre {
        font-size: 2rem;
    }

    .lexique-entree {
        padding: 18px 20px;
    }

    .lexique-terme {
        font-size: 1.3rem;
    }

    .lexique-definition {
        font-size: 1rem;
    }

    .lexique-lettre {
        margin-bottom: 50px;
        scroll-margin-top: 240px;
    }
}

@media (max-width: 480px) {
    .lexique-nav-link {
        font-size: 1rem;
        padding: 4px 6px;
        min-width: 30px;
    }

    .lexique-lettre-titre {
        font-size: 1.6rem;
    }

    .lexique-entree {
        padding: 15px;
    }

    .lexique-terme {
        font-size: 1.2rem;
    }
}

/* ==== RTL (arabe) ==== */
[dir="rtl"] .lexique-entree {
    border-left: 1px solid var(--border-green);
    border-right: 4px solid var(--gold);
}

[dir="rtl"] .lexique-entree:hover {
    border-right-color: var(--gold-light);
    transform: translateX(-5px);
}

[dir="rtl"] .lexique-note {
    border-right: none;
    border-left: 3px solid var(--gold);
}

[dir="rtl"] .lexique-nav-link {
    font-size: 1.4rem;
}

/* ==== Styles spécifiques aux Amdah ==== */
.amdah-img {
    border: 3px solid var(--border-green);
    border-radius: 10px;
    transition: all 0.3s;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.amdah-img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px var(--shadow-green);
    border-color: var(--green-light);
}

.recordings-table {
    background: rgba(90, 158, 111, 0.05);
    border-color: var(--border-green) !important;
    margin: 20px 0;
}

.recordings-table th {
    background: rgba(90, 158, 111, 0.15);
    color: var(--gold-light);
    font-family: 'Amiri', serif;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    border-color: var(--border-green) !important;
}

.recordings-table td {
    color: var(--text-light);
    font-family: 'Amiri', serif;
    padding: 10px;
    text-align: center;
    border-color: var(--border-green) !important;
    transition: all 0.3s;
}

.recordings-table td:hover {
    background: rgba(90, 158, 111, 0.1);
}

.recordings-table .nav-link-sufi {
    color: var(--green-pale) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .amdah-img {
        height: 150px;
    }

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

    .recordings-table th,
    .recordings-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .amdah-img {
        height: 120px;
    }

    .recordings-table {
        font-size: 0.7rem;
    }

    .recordings-table th,
    .recordings-table td {
        padding: 5px;
    }
}

/* ==== Liste audio ==== */
.audio-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.audio-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(90, 158, 111, 0.08);
    border: 1px solid var(--border-green);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.audio-item:hover {
    background: rgba(90, 158, 111, 0.15);
    border-color: var(--green-light);
    transform: translateX(5px);
}

.audio-item.audio-playing {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--shadow-gold);
}

.audio-number {
    color: var(--gold);
    font-family: 'Amiri', serif;
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
}

.audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.audio-title {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    font-weight: bold;
    font-size: 1rem;
}

.audio-artist {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.audio-play-icon {
    color: var(--gold);
    font-size: 1.2rem;
    transition: all 0.3s;
    min-width: 20px;
    text-align: center;
}

.audio-item:hover .audio-play-icon {
    transform: scale(1.2);
    color: #ffffff;
}

.audio-item.audio-playing .audio-play-icon {
    color: #ffffff;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .audio-item {
        padding: 12px;
        gap: 10px;
    }

    .audio-title {
        font-size: 0.9rem;
    }
}

/* ==== Contrôles audio ==== */
.audio-wrapper {
    margin-bottom: 15px;
    border: 1px solid var(--border-green);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    background: rgba(90, 158, 111, 0.08);
}

/* Hover sur tout le wrapper */
.audio-wrapper:hover {
    background: rgba(90, 158, 111, 0.15);
    border-color: var(--green-light);
    transform: translateX(5px);
    box-shadow: 0 5px 15px var(--shadow-green);
}

/* Quand l'audio est en cours de lecture */
.audio-wrapper.audio-playing {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--shadow-gold);
}

/* Supprimer les bordures individuelles */
.audio-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    border: none;
    background: transparent;
}

.audio-item:hover {
    background: transparent;
    border: none;
    transform: none;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-top: 1px solid var(--border-green);
}

/* Numéro */
.audio-number {
    color: var(--gold);
    font-family: 'Amiri', serif;
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
}

/* Informations */
.audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.audio-title {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    font-weight: bold;
    font-size: 1rem;
    transition: color 0.3s;
}

.audio-artist {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Icône play/pause */
.audio-play-icon {
    color: var(--gold);
    font-size: 1.2rem;
    transition: all 0.3s;
    min-width: 20px;
    text-align: center;
}

.audio-wrapper:hover .audio-play-icon {
    transform: scale(1.2);
    color: #ffffff;
}

.audio-wrapper.audio-playing .audio-play-icon {
    color: #ffffff;
    animation: pulse 1s infinite;
}

/* Temps et barre de progression */
.audio-current-time,
.audio-total-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    min-width: 40px;
    text-align: center;
    font-family: monospace;
}

.audio-progress {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(90, 158, 111, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.audio-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--green-light);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.audio-progress::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--green-light);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.audio-progress::-webkit-slider-thumb:hover {
    background: var(--gold);
    transform: scale(1.2);
}

.audio-progress::-moz-range-thumb:hover {
    background: var(--gold);
    transform: scale(1.2);
}

/* Changement de couleur du titre au survol */
.audio-wrapper:hover .audio-title {
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .audio-wrapper {
        margin-bottom: 10px;
    }

    .audio-item {
        padding: 12px;
        gap: 10px;
    }

    .audio-controls {
        padding: 8px 10px;
        gap: 5px;
    }

    .audio-title {
        font-size: 0.9rem;
    }

    .audio-current-time,
    .audio-total-time {
        font-size: 0.7rem;
        min-width: 35px;
    }
}

/* ==== Styles pour les portraits et la galerie ==== */
.portrait-img {
    border: 3px solid var(--border-green);
    border-radius: 10px;
    transition: all 0.3s;
}

.portrait-img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px var(--shadow-green);
    border-color: var(--green-light);
}

.gallery-img {
    width: 100%;
    max-width: 600px; /* Taille maximale sur PC */
    height: auto; /* Garde les proportions */
    object-fit: contain; /* Affiche l'image entière sans déformation */
    border: 3px solid var(--border-green);
    border-radius: 10px;
    transition: all 0.3s;
    display: block;
    margin: 0 auto; /* Centre l'image */
}

.gallery-img:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px var(--shadow-green);
    border-color: var(--gold);
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-img {
        max-width: 100%; /* Prend toute la largeur disponible sur mobile */
    }

    .portrait-img {
        max-width: 150px !important;
        height: auto;
    }
}

@media (max-width: 480px) {
    .portrait-img {
        max-width: 120px !important;
        height: auto;
    }
}

/* ==== Styles spécifiques aux Trois Saintes Mosquées ==== */
.mosque-section {
    margin: 40px 0;
    padding: 20px;
    background: rgba(90, 158, 111, 0.05);
    border: 1px solid var(--border-green);
    border-radius: 15px;
}

.arabic-hadith {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-green);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.arabic-hadith p {
    margin-bottom: 15px;
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
    .mosque-section {
        padding: 15px;
        margin: 30px 0;
    }

    .arabic-hadith {
        padding: 20px;
        margin: 20px 0;
    }

    .arabic-hadith p {
        font-size: 0.9rem !important;
    }
}

/* ==== Styles pour la liste des soufis ==== */
.soufis-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sufi-entry {
    background: rgba(90, 158, 111, 0.05);
    border: 1px solid var(--border-green);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s;
}

.sufi-entry:hover {
    background: rgba(90, 158, 111, 0.1);
    box-shadow: 0 5px 20px var(--shadow-green);
}

.sufi-entry-title {
    color: var(--gold-light);
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-green);
}

.special-entry {
    border-color: var(--border-gold);
    background: rgba(201, 168, 76, 0.05);
}

.special-entry:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold);
}

.final-message {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-green);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sufi-entry {
        padding: 15px;
    }

    .sufi-entry-title {
        font-size: 1.2rem;
    }

    .final-message {
        padding: 20px;
    }
}

.dropdown-item.active, .dropdown-item:active{
    background-color:#198754;
}

/* ==== Support RTL pour l'arabe ==== */

/* Empêche le débordement horizontal */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

[dir="rtl"] body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
}


[dir="rtl"] .dropdown-menu[data-bs-popper] {
    top:100%;
    margin-top:var(--bs-dropdown-spacer);
    right:0;
    width: max-content; /* Prend la largeur du contenu */
}

[dir="rtl"] .sufi-container {
    text-align: right;
    direction: rtl;
    max-width: 100%;
    box-sizing: border-box;
}

[dir="rtl"] .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
}

[dir="rtl"] .footer-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

[dir="rtl"] .biographie-nav-grid {
    direction: rtl;
}

[dir="rtl"] .audio-item {
    flex-direction: row;
}

[dir="rtl"] .audio-info {
    text-align: right;
}

[dir="rtl"] .sommaire-link {
    flex-direction: row;
    justify-content: flex-end;
}

[dir="rtl"] .sommaire-link::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .sommaire-link:hover {
    padding-left: 20px;
    padding-right: 30px;
}

[dir="rtl"] blockquote {
    border-left: none;
    border-right: 3px solid var(--green-light);
}

[dir="rtl"] .prayer-reference {
    text-align: left;
}

[dir="rtl"] .poem-author {
    text-align: left;
    padding-right: 0;
    padding-left: 30px;
}

/* Police arabe */
[dir="rtl"] .main-title,
[dir="rtl"] .section-title,
[dir="rtl"] .sufi-entry-title {
    font-family: 'Amiri', 'Scheherazade New', serif;
}

/* Navigation */
[dir="rtl"] .navbar-nav {
    padding-right: 0;
    padding-left: 0;
}

[dir="rtl"] .navbar-collapse {
    text-align: right;
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
}

/* Contrôles audio */
[dir="rtl"] .audio-controls {
    direction: ltr; /* Garde le sens LTR pour les contrôles audio */
}

[dir="rtl"] .audio-progress {
    direction: ltr; /* La barre de progression reste LTR */
}

/* Galerie et images */
[dir="rtl"] .gallery-nav {
    flex-direction: row;
}

[dir="rtl"] .image-caption {
    text-align: center;
}

/* Responsive mobile */
@media (max-width: 768px) {
    [dir="rtl"] .sufi-container {
        padding: 10px;
        margin: 10px 0;
        width: auto;
    }

    [dir="rtl"] .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    [dir="rtl"] .navbar-nav {
        padding-right: 10px;
        padding-left: 10px;
    }

    [dir="rtl"] .footer-nav {
        gap: 3px;
    }

    [dir="rtl"] .sufi-entry {
        padding: 12px;
    }

    [dir="rtl"] .lexique-fr-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .sufi-container {
        padding: 5px;
        margin: 5px 0;
    }

    [dir="rtl"] .main-title {
        font-size: 1.5rem;
    }

    [dir="rtl"] .section-title {
        font-size: 1.2rem;
    }
}

/* ==== Styles pour l'arbre généalogique ==== */
.arbre-section {
    margin: 50px 0;
}

.arbre-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 20px;
}

.arbre-node {
    position: relative;
    text-align: center;
}

.arbre-card {
    background: rgba(90, 158, 111, 0.1);
    border: 2px solid var(--border-green);
    border-radius: 12px;
    padding: 15px 30px;
    min-width: 200px;
    transition: all 0.3s;
}

.arbre-card:hover {
    background: rgba(90, 158, 111, 0.2);
    transform: scale(1.05);
    box-shadow: 0 5px 20px var(--shadow-green);
}

.arbre-name {
    display: block;
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.arbre-role {
    display: block;
    color: var(--gold-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* Source mise en évidence */
.arbre-source .arbre-card {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
    border-width: 3px;
    padding: 20px 40px;
    box-shadow: 0 0 30px var(--shadow-gold);
}

.arbre-source .arbre-name {
    font-size: 1.5rem;
    color: var(--gold-light);
}

/* Final mis en évidence */
.arbre-final .arbre-card {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold);
}

.arbre-final .arbre-name {
    font-size: 1.5rem;
    color: var(--gold-light);
}

/* Connecteurs */
.arbre-connector {
    color: var(--gold);
    font-size: 1.5rem;
    line-height: 1;
    padding: 5px 0;
    text-align: center;
}

/* Ligne verticale entre les nœuds */
.arbre-node:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, var(--gold), transparent);
}

/* Responsive */
@media (max-width: 768px) {
    .arbre-card {
        min-width: 150px;
        padding: 12px 20px;
    }

    .arbre-source .arbre-card {
        padding: 15px 25px;
    }

    .arbre-name {
        font-size: 1rem;
    }

    .arbre-source .arbre-name,
    .arbre-final .arbre-name {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .arbre-card {
        min-width: 120px;
        padding: 10px 15px;
    }

    .arbre-name {
        font-size: 0.9rem;
    }
}

/* ==== Arbre généalogique ==== */
.genealogy-section {
    margin: 50px 0;
}

.genealogy-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 20px;
}

.genealogy-level {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.genealogy-split {
    gap: 30px;
}

.genealogy-multi {
    gap: 10px;
}

.genealogy-node {
    background: rgba(90, 158, 111, 0.1);
    border: 2px solid var(--border-green);
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    transition: all 0.3s;
    min-width: 150px;
}

.genealogy-node:hover {
    background: rgba(90, 158, 111, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-green);
}

.source-node {
    background: rgba(201, 168, 76, 0.2);
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--shadow-gold);
}

.highlight-node {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
}

.final-node {
    background: rgba(201, 168, 76, 0.25);
    border-color: var(--gold);
    box-shadow: 0 0 25px var(--shadow-gold);
}

.genealogy-name {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.source-node .genealogy-name,
.final-node .genealogy-name {
    color: var(--gold-light);
    font-size: 1.3rem;
}

.genealogy-connector {
    color: var(--gold);
    font-size: 1.5rem;
    line-height: 1;
    margin: 5px 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .genealogy-node {
        min-width: 120px;
        padding: 10px 15px;
    }

    .genealogy-name {
        font-size: 0.9rem;
    }

    .genealogy-multi {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .genealogy-node {
        min-width: 100px;
        padding: 8px 10px;
    }

    .genealogy-name {
        font-size: 0.8rem;
    }
}

/* ==== Taille de police pour les poèmes en arabe ==== */
[dir="rtl"] .poem-text,
[dir="rtl"] .poem-text p,
[dir="rtl"] .poem-text.citation-green,
[dir="rtl"] .poem-text.citation-gold,
[dir="rtl"] .poem-text.citation-green p,
[dir="rtl"] .poem-text.citation-gold p {
    font-size: 1.5rem;
    line-height: 2;
    margin-bottom: 12px;
}

[dir="rtl"] .poem-title {
    font-size: 2.4rem;
    color: var(--gold-light);
    font-weight: 700;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
}

[dir="rtl"] .poem-author {
    font-size: 1.6rem;
}

/* Version mobile */
@media (max-width: 768px) {
    [dir="rtl"] .poem-text,
    [dir="rtl"] .poem-text p,
    [dir="rtl"] .poem-text.citation-green,
    [dir="rtl"] .poem-text.citation-gold,
    [dir="rtl"] .poem-text.citation-green p,
    [dir="rtl"] .poem-text.citation-gold p {
        font-size: 1.3rem;
        line-height: 2;
    }

    [dir="rtl"] .poem-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .poem-text,
    [dir="rtl"] .poem-text p,
    [dir="rtl"] .poem-text.citation-green,
    [dir="rtl"] .poem-text.citation-gold,
    [dir="rtl"] .poem-text.citation-green p,
    [dir="rtl"] .poem-text.citation-gold p {
        font-size: 1.2rem;
        line-height: 1.9;
    }

    [dir="rtl"] .poem-title {
        font-size: 1.7rem;
    }
}

/* ==== Sous-titres pour les nœuds de l'arbre ==== */
.genealogy-subtitle {
    color: var(--text-muted);
    font-family: 'Amiri', serif;
    font-size: 0.9rem;
    display: block;
    margin-top: 3px;
}

.source-node .genealogy-subtitle,
.final-node .genealogy-subtitle {
    color: var(--green-pale);
}

.genealogy-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* ==== Carrousel ==== */
.gallery-section {
    margin: 50px 0;
}

#sufiCarousel {
    max-width: 800px;
    margin: 0 auto;
    border: 3px solid var(--border-green);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow-green);
    background: rgba(0, 0, 0, 0.3);
}

.carousel-image-container {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
}

.carousel-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Légende personnalisée */
.carousel-caption-custom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 30px 20px 20px;
    text-align: center;
}

.carousel-caption-custom p {
    color: var(--gold-light);
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

/* Indicateurs */
.carousel-indicators {
    bottom: 10px;
    margin-bottom: 0;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--green-pale);
    border: 2px solid var(--gold);
    opacity: 0.5;
    transition: all 0.3s;
    margin: 0 5px;
}

.carousel-indicators button.active {
    opacity: 1;
    background-color: var(--gold);
    transform: scale(1.3);
}

.carousel-indicators button:hover {
    opacity: 0.8;
}

/* Contrôles */
.carousel-control-prev,
.carousel-control-next {
    width: 60px;
    opacity: 0.6;
    transition: opacity 0.3s;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent);
}

.carousel-control-next {
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.5), transparent);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 5px var(--gold));
}

/* Responsive */
@media (max-width: 768px) {
    #sufiCarousel {
        max-width: 100%;
        border-radius: 10px;
        border-width: 2px;
    }

    .carousel-image-container {
        height: 350px;
    }

    .carousel-caption-custom p {
        font-size: 1rem;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .carousel-image-container {
        height: 250px;
    }

    .carousel-indicators button {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }

    .carousel-caption-custom {
        padding: 20px 10px 10px;
    }

    .carousel-caption-custom p {
        font-size: 0.9rem;
    }
}

/* Invert slide transforms for RTL without bootstrap.rtl.css */
[dir="rtl"] .carousel-item-next:not(.carousel-item-start),
[dir="rtl"] .active.carousel-item-end {
    transform: translateX(-100%);
}

[dir="rtl"] .carousel-item-prev:not(.carousel-item-end),
[dir="rtl"] .active.carousel-item-start {
    transform: translateX(100%);
}

/* ==== Bouton play/pause audio en background ==== */
.bg-audio-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(13, 40, 24, 0.95);
    border: 2px solid var(--gold);
    color: var(--gold-light);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 0;
    line-height: 1;
}

.bg-audio-toggle:hover {
    background: var(--gold);
    color: var(--green-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-gold);
}

.bg-audio-toggle.playing {
    background: var(--green-dark);
    color: var(--green-dark);
    animation: audioPulse 2s infinite;
}

.bg-audio-toggle.playing:hover {
    background: var(--gold);
    color: var(--green-dark);
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-gold);
}

@keyframes audioPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(201, 168, 76, 0.9);
    }
}

.bg-audio-toggle span {
    display: block;
    pointer-events: none;
}

@media (max-width: 768px) {
    .bg-audio-toggle {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
}

[dir="rtl"] .bg-audio-toggle {
    right: auto;
    left: 30px;
}

@media (max-width: 768px) {
    [dir="rtl"] .bg-audio-toggle {
        right: auto;
        left: 20px;
    }
}

/* ==== Formulaires d'authentification ==== */
.auth-body {
    background: linear-gradient(180deg, var(--green-dark) 0%, var(--green-deep) 50%, var(--green-dark) 100%);
}

.auth-container {
    max-width: 500px;
    margin: 50px auto;
}

.auth-form-wrapper {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(90, 158, 111, 0.05);
    border: 1px solid var(--border-green);
    border-radius: 15px;
}

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

.auth-form label {
    color: var(--green-pale);
    font-family: 'Amiri', serif;
    display: block;
    margin-bottom: 8px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-green);
    border-radius: 8px;
    color: var(--text-light);
    font-family: 'Amiri', serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--shadow-gold);
}

.auth-form .help-block {
    color: #ff6666;
    font-size: 0.85rem;
    margin-top: 5px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-green);
}

/* ==== Interface d'administration utilisateurs ==== */
.admin-actions {
    margin-bottom: 20px;
}

.user-table {
    background: rgba(90, 158, 111, 0.05);
    border-color: var(--border-green) !important;
    color: var(--text-light);
}

.user-table th {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold-light);
    font-family: 'Amiri', serif;
    text-align: center;
    padding: 12px;
    border-color: var(--border-green) !important;
}

.user-table td {
    color: var(--text-light);
    font-family: 'Amiri', serif;
    padding: 10px;
    vertical-align: middle;
    border-color: var(--border-green) !important;
}

.user-table tr:hover td {
    background: rgba(90, 158, 111, 0.1);
}

.btn-action {
    display: inline-block;
    padding: 4px 8px;
    margin: 0 2px;
    color: var(--gold-light);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-action:hover {
    background: rgba(201, 168, 76, 0.2);
    color: #ffffff;
}

.user-detail-card {
    background: rgba(90, 158, 111, 0.05);
    border: 1px solid var(--border-green);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.user-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border-left: 3px solid var(--gold);
}

.user-info-label {
    color: var(--gold-light);
    font-family: 'Amiri', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-info-value {
    color: var(--text-light);
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.btn-warning {
    border-color: #ff9800 !important;
    color: #ff9800 !important;
}

.btn-warning:hover {
    background: rgba(255, 152, 0, 0.2) !important;
    color: #ffffff !important;
}

.btn-danger {
    border-color: #f44336 !important;
    color: #f44336 !important;
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 0.2) !important;
    color: #ffffff !important;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.bg-success {
    background-color: #4caf50;
    color: white;
}
.bg-secondary {
    background-color: #6c757d;
    color: white;
}
.bg-warning {
    background-color: #ffc107;
    color: #000;
}
.bg-danger {
    background-color: #dc3545;
    color: white;
}

/* RTL */
[dir="rtl"] .user-info-item {
    border-left: 1px solid var(--border-green);
    border-right: 3px solid var(--gold);
}

/* ==== Sélecteur de langue sur la page d'authentification ==== */
.auth-language-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-switch-btn {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(13, 40, 24, 0.95);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Amiri', serif;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.language-switch-btn:hover {
    background: var(--gold);
    color: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-gold);
    text-decoration: none;
}

/* En RTL : bouton à gauche */
[dir="rtl"] .auth-language-switch {
    right: auto;
    left: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-language-switch {
        top: 15px;
        right: 15px;
    }

    .language-switch-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    [dir="rtl"] .auth-language-switch {
        right: auto;
        left: 15px;
    }
}

/* ==== Messages d'erreur des formulaires - plus visibles ==== */
.help-block,
.invalid-feedback {
    color: #ff4d4d !important;
    font-size: 1.1rem !important;
    font-weight: 600;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 77, 77, 0.1);
    border-left: 3px solid #ff4d4d;
    border-radius: 5px;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(255, 77, 77, 0.3);
}

/* Champ en erreur */
.has-error .form-control,
.is-invalid {
    border-color: #ff4d4d !important;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.5) !important;
    background-color: rgba(255, 77, 77, 0.05) !important;
}

.has-error label,
.is-invalid ~ label {
    color: #ff4d4d !important;
}

/* En RTL : bordure à droite */
[dir="rtl"] .help-block,
[dir="rtl"] .invalid-feedback {
    border-left: none;
    border-right: 3px solid #ff4d4d;
}

/* Responsive */
@media (max-width: 768px) {
    .help-block,
    .invalid-feedback {
        font-size: 1rem !important;
        padding: 6px 10px;
    }
}