/* Variables */
:root {
    --primary-color: #2C5F2D;
    --secondary-color: #B9965B;
    --background-color: #F9F9F9;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --font-cairo: 'Cairo', sans-serif;
    --font-amiri: 'Amiri', serif;
    /* --shadow: 0 4px 15px rgba(0,0,0,0.1); */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-cairo);
    background-color: var(--background-color);
    color: var(--text-dark);
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-amiri);
    font-weight: 700;
    color: var(--primary-color);
}

a:active {
    background: var(--secondary-color) !important;
    color: var(--white);
}

/* Header Styles */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background: var(--primary-color);
    color: #ffffff;
    /* Force White */
    font-size: 0.9rem;
}


.navbar-brand {
    width: 30%;
}

.navbar-brand .logo-text img {
    width: 150px;
}

.navbar-brand:active {
    background: none !important;
}


/* Make Top Bar single-line on small screens and prevent vertical scroll */
@media (max-width: 767.98px) {

    /* Center all images and text in cards */
    .book-card,
    .explained-book-card,
    .fatwa-card,
    .sermon-card,
    .item-card {
        text-align: center;
    }

    .book-cover img,
    .book-image img,
    .item-image img {
        margin: 0 auto;
    }

    .book-info,
    .card-body,
    .fatwa-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Fix Top Bar Overflow - Side by Side */
.top-bar .row {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    gap: 0;
}

.top-bar .col-md-6 {
    width: auto !important;
    flex: 0 1 auto;
    padding: 0 4px;
    text-align: center !important;
}

.social-links {
    justify-content: flex-end;
    display: flex;
    gap: 5px;
    /* Tighter gap */
}

.social-icon {
    width: 20px;
    /* Smaller icons */
    height: 20px;
    font-size: 0.8rem;
}

.contact-info {
    text-align: left;
}

.contact-info span {
    /* font-size: 0.65rem; */
    /* Much smaller font to fit email */
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.contact-info i {
    margin-right: 3px;
}

.book-info .btn,
.card-body .btn,
.fatwa-content .btn,
.item-content .btn {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.top-bar {
    padding-top: 4px;
    padding-bottom: 4px;
    overflow: hidden;
    /* display: flex; */
}

.top-bar .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    max-height: 44px;
}

.top-bar .row {
    flex-wrap: nowrap;
    gap: 0;
    align-items: center;
    min-height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.top-bar .col-md-6 {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.top-bar .social-links {
    display: flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.top-bar .social-links .social-icon {
    margin-left: 0;
    width: 28px;
    height: 28px;
    /* font-size: 0.8rem; */
    line-height: 1;
}

.top-bar .contact-info {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    line-height: 1;
}


.social-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.social-links .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    /* White semi-transparent for dark background */
    border-radius: 50%;
    color: #ffffff;
    /* Force White */
    margin-left: 6px;
    transition: var(--transition);
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
}

.social-links .social-icon:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.contact-info {
    color: var(--white);
}

.contact-info i {
    color: var(--secondary-color);
}

.main-navbar {
    background: var(--white);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.logo-text h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin: 0;
}

.logo-subtitle {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-family: var(--font-cairo);
}

.navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

.search-form {
    position: relative;
}

.search-form .form-control {
    border-radius: 25px;
    padding-right: 45px;
    border: 2px solid var(--primary-color);
}

.search-form .btn-search {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero-section {
    /* background: linear-gradient(135deg, rgba(44,95,45,0.05) 0%, rgba(185,150,91,0.05) 100%); */
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.05) 0%, rgba(185, 150, 91, 0.05) 100%);
    padding: 80px 0;
}

section.hero-section.py-5 {
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--secondary-color);
}

.sheikh-intro .lead {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.sheikh-image img {
    border: 5px solid var(--secondary-color);
    border-radius: 15px;
}

.sheikh-stats .stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.sheikh-stats .stat-card:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 8px 25px rgba(0,0,0,0.15); */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sheikh-stats .stat-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.sheikh-stats .stat-card h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 10px 0;
}

.sheikh-stats .stat-card p {
    color: var(--text-light);
    margin: 0;
}

/* For Strich the section with full size */
@media (min-width: 992px) {
    .col-lg-8 {
        width: 100% !important;
    }
}

/* Books Section */
.books-section {
    padding: 80px 0;
}

.section-header {
    margin-bottom: 50px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.book-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.book-cover {
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #fdfbf7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.book-info .book-title {
    /* font-size: 1.25rem; */
    /* Increased from 1.25rem */
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.book-description {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 0.95rem;
    /* Increased from 0.95rem */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Increased lines to 3 for better balance with larger font */
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Explained Books Section */
.explained-books-section {
    background: var(--background-color);
}

.explained-book-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.explained-book-card:hover {
    transform: translateY(-8px);
    /* box-shadow: 0 8px 25px rgba(0,0,0,0.12); */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.explained-book-card .book-image {
    position: relative;
    overflow: hidden;
    height: 280px;
    background: #fdfbf7;
}

.explained-book-card .book-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.28s ease;
}

.explained-book-card:hover .book-image img {
    opacity: 0.98;
}

.audio-count {
    position: absolute;
    top: 15px;
    right: 15px;
    /* background: rgba(44,95,45,0.9); */
    background: rgba(44, 95, 45, 0.9);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explained-book-card .card-body {
    padding: 20px;
}

.explained-book-card .book-title {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.4;
    height: 2.3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sermons Section */
.sermon-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    border-right: 4px solid var(--secondary-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.sermon-card:hover {
    transform: translateX(-5px);
    /* box-shadow: 0 8px 25px rgba(0,0,0,0.15); */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.sermon-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sermon-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.sermon-card .btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.sermon-card .btn-link:hover {
    color: var(--secondary-color);
}

/* Fatwas Section */
.fatwa-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 20px;
    transition: var(--transition);
}

.fatwa-card:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 8px 25px rgba(0,0,0,0.15); */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.fatwa-icon {
    flex-shrink: 0;
}

.fatwa-icon i {
    font-size: 3rem;
    color: var(--secondary-color);
}

.fatwa-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.fatwa-excerpt {
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 1rem;
    /* Increased from 0.9rem */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    /* box-shadow: 0 5px 15px rgba(0,0,0,0.2); */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 10px !important;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3d1b 100%);
    color: #ffffff;
    /* Force White */
    margin-top: 80px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo img {
    width: 250px !important;
}

.footer-logo i {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.footer-logo h4 {
    color: var(--white);
    margin: 0;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff;
    /* Force White */
    margin-left: 10px;
    transition: var(--transition);
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.footer-title {
    color: var(--secondary-color) !important;
    /* font-size: 1.15rem; */
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--secondary-color);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ffffff;
    /* Force White */
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.footer-links a::before {
    content: '◄';
    margin-left: 8px;
    color: var(--secondary-color);
}

.footer-links a:hover,
.footer-contact li a:hover {
    color: var(--secondary-color);
    padding-right: 10px;
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    color: #ffffff;
    /* Force White */

}

.footer-contact li i {
    color: var(--secondary-color);
    font-size: 1.2rem;
    width: 25px;
}

.footer-contact li a,
.footer-contact a {
    color: #ffffff;
    /* Force White */
    text-decoration: none;
    transition: var(--transition);

}

.footer-contact li a:hover,
.footer-contact a:hover {
    color: var(--secondary-color);
}

.newsletter-form .input-group .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-radius: 8px 0 0 8px;
}

.newsletter-form .input-group .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form .btn-primary {
    border-radius: 0 8px 8px 0;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.footer-bottom-links a {
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--secondary-color);
}


/* Responsive */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-section {
        padding: 40px 0;
    }

    .sheikh-stats .stat-card {
        margin-bottom: 12px;
    }

    .fatwa-card {
        flex-direction: column;
        text-align: center;
    }

    .carousel-item .row>[class*='col-'] {
        display: flex;
        justify-content: center;
    }
}

/* Single Page Styles */
.single-page {
    background: var(--white);
}

.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "‹";
    padding: 0 8px;
}

.breadcrumb-item a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.page-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.page-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item i {
    color: var(--secondary-color);
}

.featured-image img {
    width: 100%;
    box-shadow: var(--shadow);
}

.page-content {
    font-size: 1.1rem;
    line-height: 2;
    color: var(--text-dark);
}

.page-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.page-content h3 {
    margin-top: 30px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.page-content p {
    margin-bottom: 20px;
}

.book-info-box {
    background: var(--background-color);
    padding: 30px;
    border-radius: 10px;
    border-right: 4px solid var(--secondary-color);
}

.book-info-box p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.audio-list .list-group-item {
    border: none;
    background: var(--background-color);
    margin-bottom: 12px;
    padding: 20px;
    border-radius: 10px;
}

.audio-player {
    max-width: 300px;
}

.audio-player-container {
    background: var(--background-color);
    padding: 30px;
    border-radius: 10px;
}

.social-share {
    display: flex;
    gap: 10px;
}

.social-share .btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.btn-facebook {
    background: #3b5998;
}

.btn-twitter {
    background: #1da1f2;
}

.btn-whatsapp {
    background: #25d366;
}

.btn-x-twitter {
    background: #000000;
}

.social-share .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* List Page Styles */
.list-page {
    background: var(--background-color);
}

.item-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.item-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.item-image {
    height: 300px;
    overflow: hidden;
    background: #fdfbf7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.item-card:hover .item-image img {
    transform: translateY(-6px);
}

.item-content {
    padding: 25px;
}

.item-title a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.4rem;
    /* Increased from 1.25rem */
    transition: var(--transition);
    font-weight: 700;
    line-height: 1.4;
}

.item-title a:hover {
    color: var(--secondary-color);
}

.item-meta {
    color: var(--text-light);
    font-size: 0.9rem;
}

.item-meta i {
    color: var(--secondary-color);
}

.item-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 1rem;
    /* Increased from 0.9rem */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Truncate after 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pagination {
    gap: 5px;
}

.page-link {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 20px;
    transition: var(--transition);
}

.page-link:hover,
.page-item.active .page-link {
    background: var(--primary-color);
    color: var(--white);
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow);
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* Search overlay styles */
.search-overlay {
    position: fixed;
    inset: 0;
    display: none;
    /* controlled by JS */
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1500;
    opacity: 0;
    transition: opacity 180ms ease;
}

.search-overlay.open {
    display: flex;
    opacity: 1;
}

.search-overlay-box {
    width: 100%;
    max-width: 760px;
    background: var(--white);
    padding: 20px 18px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    position: relative;
    transform: translateY(-8px);
    transition: transform 200ms ease, opacity 200ms ease;
    opacity: 0;
}

.search-overlay.open .search-overlay-box {
    transform: translateY(0);
    opacity: 1;
}

.search-close-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.header-search-results .search-result-item a {
    display: block;
}


@media (max-width:767px) {
    .search-overlay {
        align-items: flex-start;
        padding: 20px 12px
    }

    .search-overlay-box {
        max-width: 100%;
        padding: 16px;
        border-radius: 10px
    }

    .search-close-btn {
        top: 8px;
        left: 8px
    }
}

/* Disable hover raise on cards and interactive items */
.item-card:hover,
.explained-book-card:hover,
.sheikh-stats .stat-card:hover,
.sermon-card:hover,
.fatwa-card:hover,
.book-card:hover,
.explained-book-card .card-body:hover,
.book-cover img:hover,
.item-card:hover .item-image img,
.book-card:hover .book-cover img,
.card:hover {
    transform: none !important;
    box-shadow: var(--shadow) !important;
}

/* 404 Page */
h1.display-4.text-primary.fw-bold.mb-3 {
    color: var(--secondary-color) !important;
}

.error-code {
    color: var(--primary-color);
    font-size: 150px;
    margin-bottom: 0 !important;
}

span.zero {
    color: var(--secondary-color);
}

button#error-search-button {
    background: var(--primary-color);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

form.search-form.position-relative.shadow-sm {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Carousel Controls */
.carousel-control-next:focus,
.carousel-control-next,
.carousel-control-prev:focus,
.carousel-control-prev {
    opacity: 1 !important;
}

.carousel-control-next,
.carousel-control-prev {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
}

span.carousel-control-next-icon,
span.carousel-control-prev-icon {
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: var(--transition);
}

span.carousel-control-next-icon:hover,
span.carousel-control-prev-icon:hover {
    background-color: var(--secondary-color);
}

.carousel-indicators {
    bottom: -70px;
}

.carousel-indicators button {
    background-color: var(--primary-color) !important;
    width: 15px !important;
    height: 15px !important;
    border-radius: 50% !important;
}

.carousel-indicators .active {
    background-color: var(--secondary-color) !important;
}

/* Button bellow carousel */
a.btn.btn-outline-primary.btn-lg {
    margin-top: 40px;
}

a.btn.btn-outline-primary.btn-lg:hover {
    border: 2px solid var(--secondary-color);
    color: var(--white);
}

a.btn.btn-outline-primary.btn-lg:active {
    background: var(--secondary-color);
}

/* Contact Page Styles */
.contact-section {
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.03) 0%, rgba(185, 150, 91, 0.03) 100%);
}

.contact-info-card {
    border-right: 4px solid var(--secondary-color);
}

.contact-icon {
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-info-card li:hover .contact-icon {
    background-color: var(--secondary-color) !important;
    transform: scale(1.05);
}

.social-link {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-link.facebook {
    background-color: #3b5998;
}

.social-link.twitter {
    background-color: #1da1f2;
}

.social-link.youtube {
    background-color: #ff0000;
}

.social-link.telegram {
    background-color: #0088cc;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-form-card {
    border: 1px solid rgba(44, 95, 45, 0.1);
}

.contact-form-card .form-control,
.contact-form-card .form-select {
    border: 2px solid rgba(44, 95, 45, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    transition: var(--transition);
}

.contact-form-card .form-control:focus,
.contact-form-card .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(44, 95, 45, 0.25);
}

.contact-form-card .form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.map-placeholder {
    border: 2px dashed var(--secondary-color);
}

.faq-section .accordion-button {
    background-color: var(--background-color);
    color: var(--primary-color);
    font-weight: 600;
    border: 1px solid rgba(44, 95, 45, 0.1);
    padding: 15px 20px;
    transition: var(--transition);
}

.faq-section .accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
    box-shadow: none;
}

.faq-section .accordion-button::after {
    margin-right: auto;
    margin-left: 0;
}

.faq-section .accordion-body {
    background-color: var(--white);
    border: 1px solid rgba(44, 95, 45, 0.1);
    border-top: none;
    padding: 20px;
    line-height: 1.8;
}

/* ==========================================================================
   صفحة اتصل بنا - Contact Us Page
   ========================================================================== */

.contact-title {
    font-family: var(--font-amiri);
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 25px !important;
}

.contact-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.contact-form-card {
    border: 1px solid rgba(185, 150, 91, 0.1);
    box-shadow: 0 20px 50px rgba(44, 95, 45, 0.08);
}

.contact-info-card {
    background: linear-gradient(145deg, #ffffff, #fdfbf7);
    border: 1px solid rgba(185, 150, 91, 0.2);
    box-shadow: 0 10px 30px rgba(44, 95, 45, 0.05);
    transition: var(--transition);
}

.contact-info-card:hover {
    box-shadow: 0 15px 40px rgba(44, 95, 45, 0.1);
    transform: translateY(-5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--primary-color);
    font-family: var(--font-cairo);
    font-weight: 500;
    pointer-events: auto;
    border: 1px solid rgba(185, 150, 91, 0.2);
    transform: translateX(-120%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
}

.shaikh-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.shaikh-toast-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Success Toast */
.shaikh-toast-success {
    border-right: 5px solid var(--primary-color);
}

.shaikh-toast-success .shaikh-toast-icon {
    background: var(--primary-color);
    color: var(--white);
}

/* Error Toast */
.shaikh-toast-error {
    border-right: 5px solid #dc3545;
}

.shaikh-toast-error .shaikh-toast-icon {
    background: #dc3545;
    color: var(--white);
}

/* Warning Toast */
.shaikh-toast-warning {
    border-right: 5px solid var(--secondary-color);
}

.shaikh-toast-warning .shaikh-toast-icon {
    background: var(--secondary-color);
    color: var(--white);
}

@media (max-width: 576px) {
    .shaikh-toast-container {
        top: 20px;
        left: 20px;
        right: 20px;
    }

    .shaikh-toast {
        min-width: auto;
        width: 100%;
    }
}

.contact-info-card li:hover .contact-icon {
    background: var(--secondary-color);
    transform: rotate(10deg);
}

.contact-info-card h5 {
    font-family: var(--font-cairo);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.social-links-contact .social-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: var(--primary-color);
    border-radius: 10px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(44, 95, 45, 0.1);
}

.social-links-contact .social-btn:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateY(-3px);
    border-color: var(--secondary-color);
}

/* Form Styles */
.contact-form-card .form-control,
.contact-form-card .form-select {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-family: var(--font-cairo);
    transition: var(--transition);
}

.contact-form-card .form-control:focus,
.contact-form-card .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(185, 150, 91, 0.15);
    background-color: #fff;
}

.btn-shaikh-contact {
    background: var(--primary-color) !important;
    color: var(--white);
    padding: 14px 40px;
    border-radius: 10px;
    font-weight: 700;
    font-family: var(--font-cairo);
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-shaikh-contact:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(185, 150, 91, 0.3);
}

.map-card {
    border: 1px solid rgba(185, 150, 91, 0.1);
}

.map-placeholder {
    transition: var(--transition);
}

.map-card:hover .map-placeholder {
    background: #f0f4f0 !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {

    .contact-info-card,
    .contact-form-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 767.98px) {

    /* Center all images and text in cards */
    .book-card,
    .explained-book-card,
    .fatwa-card,
    .sermon-card,
    .item-card {
        text-align: center;
    }

    .book-cover img,
    .book-image img,
    .item-image img {
        margin: 0 auto;
    }

    .book-info,
    .card-body,
    .fatwa-content,
    .item-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-info .btn,
    .card-body .btn,
    .fatwa-content .btn,
    .item-content .btn {
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .contact-info-card {
        padding: 25px !important;
    }

    .contact-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .btn-shaikh-contact {
        width: 100%;
        justify-content: center;
    }
}

/* Accordion Styles */
.accordion-item {
    border: 1px solid rgba(185, 150, 91, 0.1);
    margin-bottom: 10px;
    border-radius: 10px !important;
    overflow: hidden;
}

.accordion-button {
    font-family: var(--font-cairo);
    font-weight: 600;
    color: var(--primary-color);
    background-color: #fdfbf7;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: none;
}

.accordion-button::after {
    filter: sepia(1) saturate(5) hue-rotate(40deg);
    /* Adjust to gold/olive tint if possible */
}

.accordion-button:not(.collapsed)::after {
    filter: brightness(0) invert(1);
}

.accordion-body {
    font-family: var(--font-cairo);
    background-color: #fff;
    color: var(--text-light);
    line-height: 1.8;
}

/* ==========================================================================
   نظام التنبيهات المخصص - Custom Toast System
   ========================================================================== */
.shaikh-toast-container {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.shaikh-toast {
    min-width: 300px;
    padding: 18px 25px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--primary-color);
    font-family: var(--font-cairo);
    font-weight: 500;
    pointer-events: auto;
    border: 1px solid rgba(185, 150, 91, 0.2);
    transform: translateX(-120%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
}

.shaikh-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.shaikh-toast-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Success Toast */
.shaikh-toast-success {
    border-right: 5px solid var(--primary-color);
}

.shaikh-toast-success .shaikh-toast-icon {
    background: var(--primary-color);
    color: var(--white);
}

/* Error Toast */
.shaikh-toast-error {
    border-right: 5px solid #dc3545;
}

.shaikh-toast-error .shaikh-toast-icon {
    background: #dc3545;
    color: var(--white);
}

/* Warning Toast */
.shaikh-toast-warning {
    border-right: 5px solid var(--secondary-color);
}

.shaikh-toast-warning .shaikh-toast-icon {
    background: var(--secondary-color);
    color: var(--white);
}

@media (max-width: 576px) {
    .shaikh-toast-container {
        top: 20px;
        left: 20px;
        right: 20px;
    }

    .shaikh-toast {
        min-width: auto;
        width: 100%;
    }
}

/* Responsive adjustments for Books and Cards */
@media (max-width: 991.98px) {
    .book-card {
        text-align: center;
        padding: 25px 15px;
    }

    .book-info {
        padding-top: 20px;
    }

    .book-info .book-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 767.98px) {

    /* Center all images and text in cards */
    .book-card,
    .explained-book-card,
    .fatwa-card,
    .sermon-card,
    .item-card {
        text-align: center;
    }

    .book-cover img,
    .book-image img,
    .item-image img {
        margin: 0 auto;
    }

    .book-info,
    .card-body,
    .fatwa-content,
    .item-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-info .btn,
    .card-body .btn,
    .fatwa-content .btn,
    .item-content .btn {
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .book-info .book-title {
        font-size: 1.15rem;
    }

    .book-description,
    .fatwa-excerpt,
    .item-excerpt {
        font-size: 0.95rem;
    }

    .explained-book-card .book-title {
        font-size: 1.2rem;
    }

    /* Center text in all sections on mobile */
    .section-header,
    .book-info,
    .item-content,
    .fatwa-content {
        text-align: center;
    }

    .fatwa-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .fatwa-icon {
        margin-bottom: 12px;
    }
}

/* Mobile Sliders for Sermons and Fatwas */
.d-lg-none .carousel-item {
    padding: 20px 0;
}

.d-lg-none .carousel-controls .btn {
    width: 40px;
    height: 40px;
    border-radius: 10% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.d-lg-none .carousel-controls .btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Ensure cards in carousel rows have equal height */
@media (min-width: 992px) {
    .carousel-item .row {
        display: flex;
        flex-wrap: nowrap;
    }
}

.carousel-item .row>[class*='col-'] {
    display: flex;
}

.carousel-item .sermon-card,
.carousel-item .fatwa-card,
.carousel-item .explained-book-card,
.carousel-item .book-card {
    width: 100%;
}

/* Dark Mode Configuration */
body.dark-mode {
    --background-color: #121212;
    --white: #1e1e1e;
    --text-dark: #f0f0f0;
    --text-light: #cccccc;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* 
   User Request: STRICTLY Preserve Gradient and Brand Colors.
   Do NOT redefine --primary-color or --secondary-color globally.
   Instead, override text colors specifically where needed for contrast.
*/

/* Text Readability Overrides */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .section-title,
body.dark-mode .book-title,
body.dark-mode .fatwa-title,
body.dark-mode .sermon-title,
body.dark-mode .navbar-nav .nav-link:hover {
    color: var(--primary-color);
    /* Lighter Green for Text Readability */
}


body.dark-mode button.btn.btn-shaikh-contact.px-5.py-3,
body.dark-mode button.show,
body.dark-mode .audio-count {
    color: #fff !important;
}

body.dark-mode .section-title::after {
    background: var(--secondary-color);
    /* Lighter Gold */
}

body.dark-mode .contact-info span,
body.dark-mode a.btn.btn-outline-primary.btn-lg:hover {
    color: #ffffff !important;
    /* Force white in Top Bar */
}

/* Ensure Links in cards are visible */
body.dark-mode .sermon-card .btn-link {
    color: var(--secondary-color);
}

body.dark-mode .sermon-card .btn-link:hover,
body.dark-mode .btn-outline-primary {
    color: var(--secondary-color);
}

body.dark-mode .btn-outline-primary {
    border-color: var(--secondary-color);
}

/* Buttons */
body.dark-mode .btn-primary {
    background-color: var(--primary-color);
    /* Keep Original Brand Color */
    color: #ffffff;
}

body.dark-mode .btn-primary:hover {
    background-color: var(--secondary-color);
    color: #121212;
}

body.dark-mode .form-control {
    background-color: #2d2d2d;
    border-color: #444;
    color: #f0f0f0;
}

/* Dark Mode Placeholder Fix with Vendor Prefixes */
body.dark-mode .form-control::placeholder {
    color: #bbbbbb !important;
    opacity: 1;
}

body.dark-mode .form-control::-webkit-input-placeholder {
    color: #bbbbbb !important;
    opacity: 1;
}

body.dark-mode .form-control::-moz-placeholder {
    color: #bbbbbb !important;
    opacity: 1;
}

body.dark-mode .form-control:-ms-input-placeholder {
    color: #bbbbbb !important;
    opacity: 1;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #bbbbbb !important;
    opacity: 1;
}

body.dark-mode .form-control:focus {
    background-color: #333;
    color: #fff;
}

body.dark-mode .search-overlay-box {
    background-color: #1e1e1e;
}

body.dark-mode #site-search-results {
    background-color: #1e1e1e !important;
    color: #f0f0f0;
}

body.dark-mode .search-form .btn-search {
    color: #ffffff;
}

body.dark-mode .navbar-nav .nav-link {
    color: #e0e0e0;
}

body.dark-mode .site-header {
    background-color: #1e1e1e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .book-cover,
body.dark-mode .explained-book-card .book-image {
    background-color: #2d2d2d;
}

/* Ensure Logo text is visible */
body.dark-mode .logo-text h3 {
    color: var(--secondary-color);
}

/* Stats Card */
body.dark-mode .sheikh-stats .stat-card {
    background-color: #1e1e1e;
}

body.dark-mode .sheikh-stats .stat-card h3 {
    color: var(--secondary-color);
}

/* Footer & Top Bar:
   Since we are NOT changing --primary-color, 
   CSS uses the original #2C5F2D.
   The gradients and backgrounds will remain EXACTLY as they are in Light Mode.
*/

body.dark-mode .book-cover,
body.dark-mode .explained-book-card .book-image {
    background-color: #2d2d2d;
}

/* Dark Mode Specific Section Adjustments */
body.dark-mode .explained-books-section,
body.dark-mode .fatwas-section,
body.dark-mode .bg-light {
    background-color: #0f1210 !important;
    /* Very subtle dark green tint/black, overrides Bootstrap bg-light */
}

body.dark-mode .explained-book-card,
body.dark-mode .fatwa-card {
    background-color: #1c1c1c;
    border: 1px solid #2c2c2c;
}

body.dark-mode .explained-book-card:hover,
body.dark-mode .fatwa-card:hover {
    background-color: #222222;
    border-color: var(--primary-color);
}

/* Audio Items & List Groups in Dark Mode */
body.dark-mode .audio-item,
body.dark-mode .list-group-item {
    background-color: #1a1a1a !important;
    border-color: #333 !important;
    color: #f0f0f0 !important;
}

body.dark-mode .audio-item h5,
body.dark-mode .audio-item h6 {
    color: var(--secondary-color) !important;
}

body.dark-mode .audio-item:hover,
body.dark-mode .list-group-item:hover {
    background-color: #252525 !important;
}

/* Breadcrumbs in Dark Mode */
body.dark-mode .breadcrumb {
    background-color: transparent;
}

body.dark-mode .breadcrumb-item,
body.dark-mode .breadcrumb-item a {
    color: #cccccc !important;
}

body.dark-mode .breadcrumb-item.active {
    color: var(--secondary-color) !important;
}

/* Page Header and Lists */
body.dark-mode .page-header,
body.dark-mode .list-page {
    /* background-color: var(--background-color); */
    color: var(--text-dark);
}

body.dark-mode .page-title {
    color: var(--secondary-color) !important;
}

/* Book Details */
body.dark-mode .book-info-box {
    background-color: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 12px;
}

body.dark-mode .book-info-box p {
    color: #f0f0f0;
}

/* Share Buttons */
body.dark-mode .share-buttons h5 {
    color: var(--secondary-color);
}

/* Plyr Overrides for Dark Mode if needed */
body.dark-mode .plyr--audio .plyr__controls {
    background: #1a1a1a;
    color: #f0f0f0;
}

body.dark-mode .plyr--audio .plyr__control {
    color: var(--secondary-color);
}


/* Stats Card */
body.dark-mode .sheikh-stats .stat-card {
    background-color: #1e1e1e;
}

body.dark-mode .sheikh-stats .stat-card h3 {
    color: var(--primary-color);
}

body.dark-mode .contact-form-card.bg-white.p-4.p-md-5.rounded-4.shadow-sm {
    background-color: #1e1e1e !important;
    /* color: #fff !important; */
}

body.dark-mode .contact-form-card.bg-white.p-4.p-md-5.rounded-4.shadow-sm p.text-muted.mt-2 {
    color: #fff !important;
}

body.dark-mode .shaikh-toast-container i {
    color: #fff !important;
}

body.dark-mode nav {
    color: #fff !important;
}

/* Fatwas Page Dark Mode */
body.dark-mode .search-container .input-group {
    background: #1e1e1e !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    border-radius: 50px !important;
    /* Ensure rounded corners */
}

body.dark-mode .search-container .input-group-text {
    background: transparent !important;
    border: none !important;
    color: var(--secondary-color) !important;
}

body.dark-mode .search-container .form-control {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    box-shadow: none !important;
}

body.dark-mode .search-container .form-control::placeholder {
    color: #888 !important;
}

body.dark-mode .filter-btn {
    background: #1e1e1e;
    border: 1px solid #333 !important;
    /* Match light mode border width */
    color: #f0f0f0 !important;
    padding: 10px 25px !important;
    /* Ensure padding matches */
}

body.dark-mode .filter-btn:hover {
    background-color: #252525 !important;
    border-color: var(--secondary-color) !important;
}

body.dark-mode .filter-btn.active {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: #fff !important;
}

body.dark-mode .item-card {
    background: #1e1e1e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.dark-mode .item-title a {
    color: var(--secondary-color) !important;
}

body.dark-mode .item-excerpt {
    color: #cccccc !important;
}

body.dark-mode .item-meta {
    color: #999 !important;
}

body.dark-mode .badge.bg-light.text-primary.border-primary {
    background-color: rgba(185, 150, 91, 0.1) !important;
    /* Gold tint */
    color: var(--secondary-color) !important;
}

body.dark-mode #no-fatwas-msg {
    background-color: #1e1e1e;
    border-color: #333;
    color: #f0f0f0;
}

/* Navbar Toggler Dark Mode Fix */
body.dark-mode .navbar-toggler {
    border-color: var(--secondary-color);
}

body.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(185, 150, 91, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

div button {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.15rem !important;
}

body.dark-mode div button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.15rem !important;
}

/* Fix Button Text Alignment */
.btn-outline-primary.btn-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}