/* ============================================
   MAIN STYLESHEET – Premium E-Book Store
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary-color: #6C63FF;
    --primary-dark: #4A47A3;
    --secondary-color: #2C3E50;
    --dark-mode-bg: #1a1a2e;
    --dark-mode-text: #ffffff;
    --light-bg: #f8f9fa;
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

/* ---------- Dark Mode Toggle (body class) ---------- */
body.dark-mode {
    background-color: var(--dark-mode-bg);
    color: var(--dark-mode-text);
}

body.dark-mode .card,
body.dark-mode .bg-light {
    background-color: #2d2d44 !important;
    color: var(--dark-mode-text);
}

body.dark-mode .text-muted {
    color: #adb5bd !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #1a1a2e;
    border-color: #3d3d5c;
    color: #fff;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #1a1a2e;
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}

body.dark-mode .btn-outline-secondary {
    color: #adb5bd;
    border-color: #4a4a6a;
}
body.dark-mode .btn-outline-secondary:hover {
    background-color: #4a4a6a;
    color: #fff;
}

/* ---------- General Elements ---------- */
a {
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.section-title {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ---------- Hero Section ---------- */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0;
    border-radius: 0 0 50px 50px;
}

.hero-section h1 {
    font-weight: 800;
    font-size: 3.2rem;
}

.hero-section .lead {
    font-size: 1.3rem;
    opacity: 0.9;
}

.hero-section .btn-light {
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 600;
}

/* ---------- Book Cards ---------- */
.book-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.book-card .card-img-top {
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.book-card .card-body {
    padding: 1.25rem;
}

.book-card .card-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-card .card-text {
    font-size: 0.9rem;
    color: #6c757d;
}

.book-card .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

body.dark-mode .book-card {
    background-color: #2d2d44;
}
body.dark-mode .book-card .card-text {
    color: #adb5bd;
}

/* ---------- Category Cards ---------- */
.category-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem 1rem;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.category-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.category-card h5 {
    margin-top: 0.75rem;
    font-weight: 600;
}

body.dark-mode .category-card {
    background: #2d2d44;
    color: white;
}

/* ---------- Glassmorphism ---------- */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
}

body.dark-mode .glass-effect {
    background: rgba(0, 0, 0, 0.3);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes scaleIn {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(2deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-animation {
    font-size: 80px;
    color: #28a745;
    animation: scaleIn 0.5s ease;
}

/* ---------- FAQ Accordion ---------- */
.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}
.accordion-button:not(.collapsed) {
    background-color: rgba(108, 99, 255, 0.08);
    color: var(--primary-color);
}

body.dark-mode .accordion-item {
    background-color: #2d2d44;
    border-color: #3d3d5c;
}

body.dark-mode .accordion-button {
    background-color: #1a1a2e;
    color: #fff;
}

body.dark-mode .accordion-button:not(.collapsed) {
    background-color: rgba(108, 99, 255, 0.2);
    color: var(--primary-color);
}

/* ---------- Testimonials ---------- */
.testimonial-card {
    border: none;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.testimonial-card .stars {
    color: #ffc107;
    letter-spacing: 2px;
}

.testimonial-card .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

body.dark-mode .testimonial-card {
    background: #2d2d44;
}

/* ---------- Newsletter Section ---------- */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 60px 0;
    border-radius: 50px;
}

.newsletter-section .form-control {
    border-radius: 50px;
    padding: 12px 20px;
    border: none;
}

.newsletter-section .btn-light {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
}

/* ---------- Footer ---------- */
footer {
    background: #1a1a2e;
    color: #adb5bd;
}

footer a {
    color: #adb5bd;
    transition: var(--transition);
}

footer a:hover {
    color: #fff;
}

footer .social-links a {
    display: inline-block;
    font-size: 1.4rem;
    transition: var(--transition);
}

footer .social-links a:hover {
    transform: translateY(-3px);
    color: var(--primary-color);
}

/* ---------- Contact Page ---------- */
.contact-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: var(--border-radius);
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

.contact-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.contact-icon-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.social-btn {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-btn:hover {
    transform: scale(1.1) translateY(-3px);
}

/* ---------- About Page ---------- */
.about-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
    margin: 0 auto 1.5rem auto;
}

.about-icon-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.about-icon-circle:hover {
    transform: scale(1.1);
}

.about-stat-card {
    transition: var(--transition);
    border: none;
    border-radius: var(--border-radius);
}

.about-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.about-hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.team-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    border: 4px solid var(--primary-color);
}

/* ---------- Payment & Checkout ---------- */
.payment-summary {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 20px;
}

body.dark-mode .payment-summary {
    background: #2d2d44;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .hero-section {
        padding: 60px 0;
        border-radius: 0 0 30px 30px;
    }
    .hero-section h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
        text-align: center;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
    .book-card .card-img-top {
        height: 200px;
    }
    .category-card {
        padding: 1rem;
    }
    .social-btn {
        width: 50px !important;
        height: 50px !important;
    }
    .social-btn i {
        font-size: 1.2rem !important;
    }
    .about-icon-circle {
        width: 60px !important;
        height: 60px !important;
    }
    .about-icon-circle i {
        font-size: 1.5rem !important;
    }
    .team-img {
        width: 80px;
        height: 80px;
    }
    .newsletter-section {
        padding: 40px 20px;
        border-radius: 30px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .book-card .card-title {
        font-size: 1rem;
    }
    .contact-card .card-body {
        padding: 1.25rem !important;
    }
}

/* ---------- Utilities ---------- */
.divider-custom {
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 0 auto 1.5rem auto;
    border-radius: 2px;
}

.shadow-hover {
    transition: var(--transition);
}
.shadow-hover:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

/* ---------- Additional Dark Mode Overrides ---------- */
body.dark-mode .bg-primary.bg-opacity-10 {
    background-color: rgba(108, 99, 255, 0.2) !important;
}
body.dark-mode .bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.2) !important;
}
body.dark-mode .bg-info.bg-opacity-10 {
    background-color: rgba(23, 162, 184, 0.2) !important;
}
body.dark-mode .bg-warning.bg-opacity-10 {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

body.dark-mode .alert {
    background-color: #2d2d44;
    border-color: transparent;
}
body.dark-mode .alert-success {
    color: #75b798;
}
body.dark-mode .alert-danger {
    color: #ea868f;
}
body.dark-mode .alert-warning {
    color: #ffda6a;
}
body.dark-mode .alert-info {
    color: #6edff6;
}

body.dark-mode .modal-content {
    background: #2d2d44;
    color: #fff;
}
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .modal-header .btn-close {
    filter: invert(1);
}

body.dark-mode .pagination .page-link {
    background-color: #2d2d44;
    border-color: #3d3d5c;
    color: #adb5bd;
}
body.dark-mode .pagination .page-link:hover {
    background-color: #3d3d5c;
}
body.dark-mode .pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}