@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');

:root {
    --primary-color: #1a5fb4;
    --primary-light: #3584e4;
    --primary-dark: #0d3b7a;
    --secondary-color: #26a269;
    --accent-color: #e66100;
    --bg-light: #f6f8fc;
    --bg-white: #ffffff;
    --text-dark: #1c1c1c;
    --text-muted: #6b7280;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-10deg) scale(0.9); }
    to { opacity: 1; transform: rotate(0) scale(1); }
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* ===== Top Bar ===== */
.top-bar {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
    font-size: 0.85rem;
    padding: 8px 0;
    position: relative;
    overflow: hidden;
}
.top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}
.top-bar a {
    transition: var(--transition);
}
.top-bar a:hover {
    transform: translateY(-2px);
    color: #ffd700 !important;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    padding: 12px 0;
    transition: var(--transition);
}
.navbar.scrolled {
    padding: 8px 0;
    box-shadow: var(--shadow-md);
}
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    transition: var(--transition);
}
.navbar-brand:hover {
    transform: scale(1.02);
}
.navbar-brand img {
    transition: var(--transition);
}
.navbar-brand:hover img {
    transform: rotate(-5deg) scale(1.1);
}
.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    position: relative;
    padding: 8px 16px !important;
    margin: 0 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(50%);
}
.nav-link:hover::after {
    width: 70%;
}
.nav-link:hover {
    color: var(--primary-color) !important;
    background: rgba(26, 95, 180, 0.05);
}
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 12px;
    animation: fadeIn 0.2s ease;
}
.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    transition: var(--transition);
}
.dropdown-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-5px);
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    min-height: 600px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}
.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease;
}
.hero-title {
    font-size: 3rem;
    font-weight: 900;
    color: white;
    line-height: 1.3;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideInRight 0.8s ease;
}
.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin: 20px 0 30px;
    animation: slideInRight 0.8s ease 0.2s both;
}
.hero-btn {
    padding: 14px 36px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.8s ease 0.4s both;
}
.hero-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}
.hero-btn:hover::before {
    left: 100%;
}
.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hero-image {
    animation: float 5s ease-in-out infinite, rotateIn 1s ease;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
}

/* ===== Section Headers ===== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}
.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}
.section-subtitle {
    color: var(--text-muted);
    margin-top: 15px;
    font-size: 1.05rem;
}

/* ===== Cards ===== */
.book-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
    height: 100%;
}
.book-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}
.book-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 280px;
}
.book-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.book-card:hover .card-img-wrapper img {
    transform: scale(1.1);
}
.book-card .card-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}
.book-card:hover .card-img-overlay {
    opacity: 1;
}
.book-card .card-body {
    padding: 20px;
}
.book-card .card-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}
.book-card .price-tag {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
}
.book-card .old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.book-card .discount-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
    animation: pulse 2s infinite;
}

/* ===== Buttons ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 10px 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 95, 180, 0.35);
}
.btn-success {
    background: linear-gradient(135deg, var(--secondary-color), #2ecc71);
    border: none;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(38, 162, 105, 0.35);
}
.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}
.btn-outline-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 95, 180, 0.25);
}

/* ===== Stats Counter ===== */
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
}
.stat-card .stat-number {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    animation: countUp 0.8s ease;
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 5px;
}

/* ===== CTA Section ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    border-radius: var(--radius-lg);
    padding: 60px;
    position: relative;
    overflow: hidden;
    margin: 60px 0;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.cta-section .cta-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 15px;
}
.cta-section .cta-text {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}
.cta-section .btn-light {
    background: white;
    color: var(--primary-color);
    font-weight: 700;
    padding: 14px 36px;
    border-radius: 50px;
    transition: var(--transition);
}
.cta-section .btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ===== Footer ===== */
footer {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    position: relative;
    overflow: hidden;
}
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}
footer h5 {
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}
footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}
footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    padding: 4px 0;
}
footer a:hover {
    color: white;
    transform: translateX(-5px);
}
footer .social-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: var(--transition);
    color: white;
    font-size: 1.1rem;
}
footer .social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-5px) rotate(10deg);
}

/* ===== Breadcrumb ===== */
.breadcrumb-wrapper {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    padding: 40px 0;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.breadcrumb-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.breadcrumb-wrapper h1 {
    color: white;
    font-weight: 800;
    font-size: 2rem;
    position: relative;
    z-index: 1;
}
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}
.breadcrumb-item a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}
.breadcrumb-item a:hover {
    color: white;
}
.breadcrumb-item.active {
    color: white;
}
.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.6);
}

/* ===== Pagination ===== */
.pagination .page-link {
    border: none;
    color: var(--text-dark);
    font-weight: 600;
    padding: 10px 18px;
    margin: 0 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    box-shadow: 0 4px 15px rgba(26, 95, 180, 0.3);
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 24px;
    animation: slideInRight 0.4s ease;
}
.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}
.alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

/* ===== Loading ===== */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(26, 95, 180, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-section {
        min-height: 400px;
        padding: 40px 0;
    }
    .cta-section {
        padding: 30px;
        margin: 30px 0;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .book-card .card-img-wrapper {
        height: 220px;
    }
}

/* ===== Cart Badge Animation ===== */
.cart-badge {
    animation: pulse 2s infinite;
}

/* ===== Form Styling ===== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid #e5e7eb;
    padding: 12px 16px;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(26, 95, 180, 0.1);
}

/* ===== Card Hover Glow ===== */
.glow-card {
    position: relative;
}
.glow-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}
.glow-card:hover::before {
    opacity: 0.5;
    filter: blur(15px);
}
