﻿:root {
    --primary-color: #1A2A3A;
    --primary-light: #2C3E50;
    --secondary-color: #4E342E;
    --secondary-light: #5D4037;
    --accent-color: #C44536;
    --accent-light: #D35400;
    --background-color: #F8F5F2;
    --text-color: #2D3436;
    --text-light: #636E72;
    --white: #FFFFFF;
    --overlay: rgba(26, 42, 58, 0.85);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "IRANSansfanum";
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
    padding-top: 90px;
}

::selection {
    background-color: var(--accent-color);
    color: var(--white);
}

/* Navigation */

.navbar {
    height: 90px;
    background-color: var(--primary-color) !important;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    padding: 0 2rem;
}

.navbar.scrolled {
    height: 70px;
    backdrop-filter: blur(10px);
    background-color: var(--overlay) !important;
    box-shadow: var(--shadow-md);
}

.navbar-brand img {
    height: 70px;
    transition: var(--transition);
}

.navbar.scrolled .navbar-brand img {
    height: 40px;
}

.navbar.scrolled .nav-item img {
    height: 40px;
}

.nav-item {
    margin-left: 1.5rem;
    position: relative;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0 !important;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover:after,
.nav-link.active:after {
    width: 100%;
    left: 0;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: none;
    width: 1.5em;
    height: 1.5em;
    position: relative;
}

.navbar-toggler-icon:before,
.navbar-toggler-icon:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--white);
    transition: var(--transition);
}

.navbar-toggler-icon:before {
    top: 0.25em;
}

.navbar-toggler-icon:after {
    bottom: 0.25em;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:before {
    transform: rotate(45deg);
    top: 0.6em;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:after {
    transform: rotate(-45deg);
    bottom: 0.6em;
}

/* Hero Section */
.hero {
    height: 500px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: linear-gradient(to left, var(--overlay), var(--overlay)), 
                url('https://images.unsplash.com/photo-1589998059171-988d887df646?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1800&q=80') no-repeat center center/cover;
    margin-bottom: 3rem;
}

.hero-content {
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Books Section */
.section {
    padding: 4rem 0;
    position: relative;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1rem;
}

.carousel-item {
    height: 500px;
    background-size: cover;
    background-position: center;
}


.carousel-caption {
    right: 10%;
    left: 10%;
    bottom: 20%;
    text-align: center;
}

.book-card {
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 2rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.book-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.book-img-container {
    height: 320px;
    overflow: hidden;
    position: relative;
}

.book-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.book-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.book-author {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.book-excerpt {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    flex: 1;
    text-align: justify;
    justify-content:right;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.book-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.book-rating {
    color: var(--accent-color);
    font-size: 0.85rem;
}

/* Features Section */
.feature-box {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1.2rem;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.feature-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    padding: 3rem 3rem;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.newsletter:before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.newsletter:after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.newsletter-title {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.newsletter-text {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.newsletter-form .form-control {
    height: 45px;
    border-radius: 8px 0 0 8px;
    border: none;
    padding: 0 1.2rem;
}

.newsletter-form .btn {
    border-radius: 0 8px 8px 0;
    padding: 0 1.2rem;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 4rem 0 1.5rem;
    position: relative;
}

.footer:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--accent-color);
}

.footer-logo img {
    height: 45px;
    margin-bottom: 1.2rem;
}

.footer-about {
    text-align: justify;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 8px;
}

.footer-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35px;
    height: 2px;
    background: var(--accent-color);
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--white);
    transform: translateX(-5px);
}

.footer-contact li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: flex-start;
    font-size: 0.9rem;
}

.footer-contact i {
    margin-left: 8px;
    color: var(--accent-color);
    margin-top: 3px;
}

.social-links {
    display: flex;
    margin-top: 1.2rem;
}

.social-links a {
    text-decoration: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: var(--white);
    transition: var(--transition);
    font-size: 0.9rem;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    opacity: 0.7;
    font-size: 0.85rem;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: var(--accent-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-light);
    transform: translateY(-3px);
}

/* Book Page Specific Styles (from second style) */
.book-header {
    background: linear-gradient(to left, rgba(26, 42, 58, 0.9), rgba(44, 62, 80, 0.9));
    color: white;
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.book-cover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    max-height: 500px;
    width: auto;
}

.book-cover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.book-page-title {
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 15px;
}

.book-page-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
}

.book-page-meta {
    margin-bottom: 1.5rem;
}

.book-page-author {
    color: var(--accent-color);
    font-weight: 500;
}

.book-description {
    margin-bottom: 3rem;
    text-align: justify;
}

.toc-title {
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 10px;
}

.toc-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

.toc-list {
    list-style-type: none;
    padding: 0;
}

.toc-item {
    margin-bottom: 1rem;
    position: relative;
    padding-right: 20px;
    transition: all 0.3s ease;
}

.toc-item:before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.toc-item:hover:before {
    opacity: 1;
    right: -5px;
}

.toc-link {
    display: block;
    padding: 12px 15px;
    background-color: white;
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}


.toc-link {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 15px;
    background-color: white;
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.toc-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(-10px);
    border-right: 3px solid var(--accent-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.chapter-number {
    display: inline-block;
    width: 38px;
    height: 38px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 38px;
    margin-left: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.toc-link:hover .chapter-number {
    background: white;
    color: var(--accent-color);
    transform: scale(1.1);
}

.book-actions {
    margin-top: 3rem;
}

.btn-purchase {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 500;
    padding: 10px 25px;
}

.btn-purchase:hover {
    background-color: var(--accent-light);
    border-color: var(--accent-light);
}

/* Responsive */
@media (max-width: 1199.98px) {
    .hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 991.98px) {
    body {
        padding-top: 70px;
    }
    
    .navbar {
        padding: 0 1rem;
    }
    nav .navbar-collapse{
        background-color: var(--primary-color) !important;
        padding: 10px;
    }    
    .hero {
        height: 400px;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section {
        padding: 3rem 0;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .book-img-container {
        height: 280px;
    }
    
    .newsletter-form .form-control,
    .newsletter-form .btn {
        border-radius: 8px;
        width: 100%;
    }
    
    .newsletter-form .btn {
        margin-top: 0.8rem;
    }
    
    .carousel-item {
        height: 300px;
    }
    
    .book-cover {
        max-height: 350px;
        margin-bottom: 2rem;
    }
    
    .book-header {
        padding: 2rem 0;
    }
    
    .toc-link {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .hero {
        height: 350px;
        padding: 1.5rem 0;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-title {
        margin-top: 1.5rem;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
}