/* --- Global & Variables --- */
:root {
    --primary-color: #1e4e5e; /* الأزرق الغامق الرئيسي */
    --secondary-color: #dcb668; /* الذهبي الثانوي */
    --light-bg: #fdfaf3; /* بيج فاتح جدًا للخلفيات */
    --text-dark: #2c3e50; /* لون نص داكن بديل للأسود */
    --font-family: "Cairo", sans-serif;
    --border-radius: 12px;
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: #fff;
    scroll-behavior: smooth;
}

/* --- Animation Classes --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.fade-in-right {
    transform: translateX(-50px);
}
.animate-on-scroll.fade-in-left {
    transform: translateX(50px);
}
.animate-on-scroll.zoom-in {
    transform: scale(0.9);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* --- Navigation Bar --- */
.navbar {
    transition: all 0.3s;
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    background-color: #ffffffc9 !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.navbar .logo-text {
    font-weight: 900;
    color: var(--primary-color);
}
.navbar .nav-link {
    font-weight: 700;
    position: relative;
    padding-bottom: 5px;
}
.navbar .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s;
}
.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 50%;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    color: #fff;
    border-radius: var(--border-radius);
    padding: 10px 25px;
    font-weight: 700;
    transition: all 0.3s;
}
.btn-primary-custom:hover {
    background-color: #163a46;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 78, 94, 0.3);
}

/* --- Hero Section --- */
.hero-section {
    background-color: var(--light-bg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    height: 100vh;
}
.hero-text-content {
    z-index: 2;
}
.hero-text-content h1 {
    color: var(--primary-color);
    line-height: 1.2;
}
.search-wrapper {
    position: relative;
}
.search-wrapper .form-control {
    border-radius: var(--border-radius);
    padding: 18px 25px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    border: none;
}
.btn-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--secondary-color);
    color: #fff;
    border-radius: 10px;
    padding: 10px 20px;
    border: none;
}
.hero-illustration {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translatey(0px);
    }
    50% {
        transform: translatey(-20px);
    }
    100% {
        transform: translatey(0px);
    }
}

/* Hero shape divider */
.custom-shape-divider-bottom-1709934988 {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}
.custom-shape-divider-bottom-1709934988 svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 70px;
}
.custom-shape-divider-bottom-1709934988 .shape-fill {
    fill: #ffffff;
}

/* --- Shared Section Title --- */
.section-title {
    font-weight: 900;
    color: var(--primary-color);
}

/* --- Journey Section --- */
.journey-section {
    background-color: #fff;
}
.journey-step {
    margin-bottom: 80px;
}
.step-number {
    background-color: var(--secondary-color);
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-left: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}
.journey-arrow i {
    color: #ccc;
    animation: arrow-move 2s ease-in-out infinite;
}
@keyframes arrow-move {
    0%,
    100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}
.flex-row-reverse .journey-arrow i {
    animation: arrow-move-reverse 2s ease-in-out infinite;
}
@keyframes arrow-move-reverse {
    0%,
    100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-10px);
    }
}

/* --- Showcase Section --- */
.showcase-section {
    background-color: var(--light-bg);
}
.nav-pills .nav-link {
    color: var(--text-dark);
    font-weight: 700;
    margin: 0 10px;
}
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--primary-color) !important;
    color: #fff;
    border-radius: var(--border-radius);
}

.book-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.book-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}
.book-card .book-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
}
.book-info {
    padding: 15px;
    text-align: center;
}
.book-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-color);
}
.book-author {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 10px;
}
.price-tag {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.9rem;
}

/* --- CTA Section --- */
.cta-section {
    background-color: var(--primary-color);
    background-image: linear-gradient(
            rgba(30, 78, 94, 0.95),
            rgba(30, 78, 94, 0.95)
        ),
        url("https://images.unsplash.com/photo-1512820790803-83ca734da794?w=800&q=80");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}
.btn-light-custom {
    background-color: var(--secondary-color);
    color: #fff;
    font-weight: 700;
    padding: 15px 35px;
    border-radius: 50px;
    transition: all 0.3s;
}
.btn-light-custom:hover {
    background-color: #fff;
    color: var(--primary-color);
    transform: scale(1.05);
}

/* --- Testimonials Section --- */
.community-section {
    background-color: #fff;
}
.testimonial-card {
    background-color: var(--light-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    position: relative;
    border: 1px solid #f0e9d6;
    height: 100%;
}
.quote-icon {
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 2.5rem;
    color: rgba(220, 182, 104, 0.3);
    z-index: 1;
}
.testimonial-card p {
    position: relative;
    z-index: 2;
}
.user-info {
    display: flex;
    align-items: center;
    margin-top: 20px;
}
.user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 15px;
}
.user-info h6 {
    margin-bottom: 0;
    font-weight: 700;
}
.user-info small {
    color: #888;
}

/* --- Footer --- */
.footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.7);
}
.footer h6 {
    color: var(--secondary-color);
    font-weight: 700;
}
.footer hr {
    width: 60px;
    height: 2px;
    background-color: var(--secondary-color);
    opacity: 1;
    margin-bottom: 20px !important;
}
.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: 0.3s;
}
.footer a:hover {
    color: #fff;
}
.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 0 5px;
    transition: 0.3s;
}
.social-icons a:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--primary-color);
}
.btn-secondary-custom {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 700;
    border: none;
}
.copyright {
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

.btn-outline-primary-custom {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: var(--border-radius);
    padding: 10px 25px;
    font-weight: 700;
    transition: all 0.3s;
}
.btn-outline-primary-custom:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* روابط الأيقونات في الهيدر */
.nav-icon-link {
    color: var(--text-dark);
    transition: color 0.3s;
}
.nav-icon-link:hover {
    color: var(--primary-color);
}

.dropdown-toggle::after {
    display: none; /* إخفاء سهم bootstrap الافتراضي */
}
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    border: none;
}
.dropdown-item {
    font-weight: 700;
}
.dropdown-item:active {
    background-color: var(--primary-color);
    color: #fff;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #eee;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #888;
    font-size: 0.75rem;
    font-weight: 700;
    transition: color 0.3s;
}

.bottom-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.add-book-btn i {
    font-size: 2.2rem;
    color: var(--secondary-color);
    transform: translateY(-10px);
    transition: transform 0.3s;
}
.bottom-nav-item.add-book-btn:hover i {
    transform: translateY(-10px) scale(1.1);
}

body {
    padding-bottom: 80px;
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
}
/* ======================= Custom Scrollbar ======================= */

/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px; /* عرض الـ scrollbar */
    background-color: var(--light-bg); /* لون الخلفية للشريط */
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary-color); /* لون المقبض الرئيسي */
    border-radius: 10px; /* جعل المقبض دائري الحواف */
    border: 3px solid var(--light-bg); /* إضافة إطار حول المقبض بنفس لون الخلفية */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #163a46; /* لون المقبض عند مرور الماوس */
}

::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
    background-color: var(--light-bg);
}

/* For Firefox */
/* Firefox يدعم خصائص أحدث وأكثر قياسية */
html {
    scrollbar-width: thin; /* "auto", "thin", or "none" */
    scrollbar-color: var(--primary-color) var(--light-bg); /* (لون المقبض) (لون الخلفية) */
}
/* Styling for the book card when it is sold */

/* The .sold class on the card itself */
.book-card.sold {
    /* Optional: reduce the opacity to make it less prominent */
    opacity: 0.7;
}

.book-card.sold .book-cover {
    /* Apply a grayscale filter to the image to visually indicate it's unavailable */
    filter: grayscale(80%);
}

/* The "Sold" overlay div */
.sold-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(30, 78, 94, 0.6); /* Using your primary color with transparency */
    z-index: 2; /* Make sure it's above the image */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Allows clicks to go through to the link if needed */
}

.sold-overlay span {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
    border: 3px solid #fff;
    padding: 10px 30px;
    border-radius: 5px;
    transform: rotate(-10deg); /* Give it a slight angle for a stamp-like effect */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

/* Make sure the card is a positioned parent for the overlay */
.book-card {
    position: relative; /* This is crucial for the absolute positioning of the overlay */
}