/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    /* Light Mode Colors */
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --navbar-bg: #ffffff;
    --navbar-shadow: rgba(0, 0, 0, 0.1);
    --nav-link-color: #555555;
    --nav-link-hover: #2c5aa0;
    --nav-link-active: #1e3a8a;
    --toggle-bg: #e9ecef;
    --toggle-icon: #333333;
    --mobile-menu-bg: #ffffff;
    --border-color: #e2e8f0;
    --accent-color: #2c5aa0;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
}

.dark-mode {
    /* Dark Mode Colors */
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --navbar-bg: #1e293b;
    --navbar-shadow: rgba(0, 0, 0, 0.3);
    --nav-link-color: #cbd5e1;
    --nav-link-hover: #60a5fa;
    --nav-link-active: #3b82f6;
    --toggle-bg: #334155;
    --toggle-icon: #f8f9fa;
    --mobile-menu-bg: #1e293b;
    --border-color: #334155;
    --accent-color: #60a5fa;
    --card-bg: #1e293b;
    --card-shadow: rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Gulzar', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;

}

a {
    text-decoration: none;
    color: var(--accent-color);
}


/* Navbar Styles */
.navbar {
    background-color: var(--navbar-bg);
    box-shadow: 0 2px 10px var(--navbar-shadow);
    padding: 0.8rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    animation: fadeInDown 0.5s ease both;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.logo:hover {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--nav-link-color);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.5rem 0.8rem;
    position: relative;
    transition: color 0.3s;
    border-radius: 4px;
}

.nav-link:hover {
    color: var(--nav-link-hover);
    background-color: rgba(44, 90, 160, 0.1);
}

.nav-link.active {
    color: var(--nav-link-active);
    font-weight: bold;
}

/* Dark Mode Toggle */
.theme-toggle-container {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

.theme-toggle {
    background: var(--toggle-bg);
    border: none;
    border-radius: 50%;
    width: 33px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background-color: var(--accent-color);
}

.theme-toggle i {
    color: var(--toggle-icon);
    font-size: 1.2rem;
}

/* Mobile Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 5px;
    border-radius: 4px;
}

.hamburger:hover {
    background-color: rgba(44, 90, 160, 0.1);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}


/* Content Section */
.content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}


.hero {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: linear-gradient(135deg, var(--accent-color) 0%, #1e3a8a 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeInUp 0.8s ease both;
}

.hero .hero-txt h2 {
    font-size: 3.3rem;
    margin-bottom: 1rem;
}

.hero .hero-txt p {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
    padding: 18px 10px 0px 0px;
    box-shadow: 2px 0px 8px 4px #fff;
    border-radius: 10px;
}

.hero .hero-img img {
    width: 350px;
    height: 350px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 10px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 20px 2px #fff;
}

.section {
    background-color: var(--navbar-bg);
    padding: 2rem 0rem;
    margin: 3rem 0rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--card-shadow);
    border: 1px solid var(--border-color);
}

.sec-title {
    font-size: 2.2rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
    width: 100%;
}

.book-shelf {
    display: flex;
    justify-content: center;
    align-content: center;
    gap: 50px;
    flex-wrap: wrap;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease both;
}


.book img {
    border-radius: 10px;
    border: 1px solid var(--nav-link-color);
    transition: 0.5s all;
    width: 230px;
    height: 350px;
}

.book img:hover {
    transform: translateY(-8px);
    box-shadow: 5px 4px 10px rgb(199 199 199);
}

/* About Section  */
.about-sec {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.about-img {
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s;
}

.about-img:hover {
    transform: translateY(-5px);
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

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

.about-txt {
    text-align: justify;
}

.about-txt p {
    font-size: 1.5rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(44, 90, 160, 0.3);
}

.btn i {
    font-size: 1rem;
    transition: transform 0.3s;
}

.btn:hover i {
    transform: translateX(-5px);
}

/* Responsive Design for About Section */
@media screen and (max-width: 1024px) {
    .about-sec {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .about-img {
        max-width: 300px;
        margin: 0 auto;
    }

    .about-txt {
        text-align: center;
    }

    .about-txt p {
        font-size: 1.3px;
    }

}

@media screen and (max-width: 640px) {
    .section {
        margin: 2rem 0;
        padding: 1rem 0;
    }

    .sec-title {
        font-size: 1.8rem;
    }

    .about-txt p {
        font-size: 1.1rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 1rem;
    }
}

/* Book Page Styles */
.book-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.book-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.book-details,
.other-books {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px var(--card-shadow);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.book-header {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 600px;
}

.book-title {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.book-author {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.book-cover {
    max-width: 300px;
    margin: 0 auto 2rem;
    border-radius: 8px;
}

.book-cover img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--nav-link-color);
}

.btn,
.download-btn,
.order-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #1e3a8a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 5rem;
    font-size: 1.2rem;
    font-family: 'Gulzar', serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 1rem;
}

.download-btn:hover,
.order-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(44, 90, 160, 0.3);
}


.section-title {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.info-item {
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.info-label {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
}

.info-value {
    color: var(--text-color);
}

.other-books-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 5px 20px;
    list-style-type: square;
}

.other-book-link {
    color: var(--nav-link-color);
    font-size: 1.3rem;
}

/* Responsive Layout */
@media screen and (max-width: 1024px) {
    .book-layout {
        grid-template-columns: 1fr;
    }

    .book-header {
        min-height: 500px;
    }
}

@media screen and (max-width: 640px) {
    .book-header {
        padding: 1.5rem 1rem;
        min-height: 400px;
    }

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

    .book-author {
        font-size: 1.3rem;
    }

    .book-cover {
        max-width: 250px;
    }

    .download-btn {
        font-size: 1rem;
    }
}

footer {
    background-color: var(--navbar-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
    text-align: center;
    font-size: 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}



/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--mobile-menu-bg);
        width: 80%;
        height: calc(100vh - 70px);
        text-align: center;
        transition: 0.3s;
        box-shadow: -2px 0 10px var(--navbar-shadow);
        padding-top: 2rem;
        gap: 0;
        border-left: 1px solid var(--border-color);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-item {
        margin: 0.5rem 0;
    }

    .nav-link {
        font-size: 1.4rem;
        padding: 1rem;
        display: block;
        border-radius: 0;
    }

    .theme-toggle-container {
        margin-left: 0;
        margin-top: 1rem;
        justify-content: center;
    }

    .hero {
        flex-direction: column;
        gap: 50px;
    }

    .hero .hero-txt h2 {
        font-size: 2.5rem;
    }

    .hero .hero-txt p {
        font-size: 1.7rem;
    }

    .hero .hero-img img {
        width: 270px;
        height: auto;
    }

    .book img {
        width: 195px;
        height: 290px;
    }

    footer {
        font-size: 16px;
    }

}

/* Fixes */

/* Focus Styles for Keyboard Navigation */
.nav-link:focus,
.theme-toggle:focus,
.download-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link {
        text-decoration: underline;
    }

    .book img {
        border: 2px solid var(--text-color);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .book img:hover {
        transform: none;
    }

    .download-btn:hover {
        transform: none;
    }
}
