﻿/* ========================================
   MODERN BOOKSTORE - SITE STYLESHEET
   Bootstrap 5.2.0 Customization
   ======================================== */

:root {
    /* Primary Colors (Maroon/Burgundy) */
    --primary-color: #7C2D12;
    --primary-dark: #450A0A;
    --primary-light: #9A3412;
    
    /* Secondary Colors (Deep Emerald/Forest) */
    --secondary-color: #065F46;
    --secondary-dark: #064E3B;
    --secondary-light: #059669;
    
    /* Neutral Colors (Warm Paper/Book) */
    --dark-bg: #1C1917;
    --light-bg: #FAFAF9;
    --border-color: #E7E5E4;
    --text-muted: #78716C;
    --text-primary: #292524;
    
    /* Accent Colors */
    --accent-danger: #B91C1C;
    --accent-warning: #D97706; /* Gold/Amber */
    --accent-success: #15803D;
    --accent-info: #0369A1;
}

/* ========================================
   GENERAL STYLES
   ======================================== */

* {
    transition: all 0.3s ease;
}

html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', serif;
    font-weight: 700;
    color: var(--dark-bg);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-muted);
}

/* ========================================
   NAVBAR & HEADER
   ======================================== */

.navbar {
    background-color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: var(--primary-dark) !important;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 0.4rem;
    transition: all 0.3s ease;
}

.navbar-light .navbar-nav .nav-link:hover {
    background-color: var(--light-bg);
    color: var(--primary-color) !important;
}

.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(79, 70, 229, 0.1);
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.dropdown-item {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background-color: var(--dark-bg);
    color: #FFFFFF;
    margin-top: auto;
    padding: 3rem 0 1rem;
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--primary-light) !important;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    background: linear-gradient(135deg, #7C2D12 0%, #450A0A 100%), url('../Images/library-bg.jpg') center/cover;
    background-blend-mode: multiply;
    color: white;
    padding: 5rem 2rem;
    border-radius: 1rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(69, 10, 10, 0.2);
}

.hero h1 {
    font-family: 'Lora', serif;
    color: #FDE68A;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* ========================================
   SEARCH BAR
   ======================================== */

.search-container {
    margin-bottom: 2rem;
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 45, 18, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background-color: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* ========================================
   PRODUCT CARDS
   ======================================== */

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-light);
}

.product-image-wrapper {
    width: 100%;
    height: 320px;
    padding: 1.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(-4px 4px 8px rgba(0,0,0,0.25));
    position: relative;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    height: 3.1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.product-title:hover {
    color: var(--primary-color);
}

.product-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.product-price {
    color: var(--accent-danger);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

.product-price-original {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.product-rating {
    font-size: 0.875rem;
    color: var(--accent-warning);
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.product-actions .btn {
    flex: 1;
}

/* ========================================
   CATEGORY BUTTONS
   ======================================== */

.category-section {
    margin-bottom: 3rem;
}

.category-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--dark-bg);
}

.btn-category {
    display: inline-block;
    background-color: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-category:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* ========================================
   PRODUCT DETAIL PAGE
   ======================================== */

.product-detail-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.product-detail-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-detail-info h1 {
    font-size: 2rem;
    color: var(--dark-bg);
    margin-bottom: 1rem;
}

.product-detail-price {
    font-size: 2.5rem;
    color: var(--accent-danger);
    font-weight: 800;
    margin: 1rem 0;
}

.product-detail-meta {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.product-detail-meta p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.product-detail-meta strong {
    color: var(--text-primary);
}

.product-detail-description {
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.product-detail-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* ========================================
   CART PAGE
   ======================================== */

.cart-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .cart-container {
        grid-template-columns: 1fr;
    }
}

.cart-items {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cart-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1.5rem;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 140px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--light-bg);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: var(--accent-danger);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quantity-control .btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
    min-width: 36px;
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

.cart-item-remove {
    display: inline-block;
}

.cart-summary {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 100px;
}

.cart-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.cart-summary-item.total {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-summary-item.total .amount {
    color: var(--accent-danger);
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1rem;
}

.cart-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control,
.form-select,
textarea.form-control {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: white;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-check {
    margin-bottom: 1rem;
}

.form-check-input {
    border-color: var(--border-color);
    cursor: pointer;
    width: 1.25rem;
    height: 1.25rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */

.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-dark);
    border-left: 4px solid var(--secondary-color);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #991B1B;
    border-left: 4px solid var(--accent-danger);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #92400E;
    border-left: 4px solid var(--accent-warning);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #1E40AF;
    border-left: 4px solid var(--accent-info);
}

/* ========================================
   TABLES
   ======================================== */

.table {
    background-color: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.table thead th {
    color: var(--text-primary);
    font-weight: 700;
    padding: 1rem;
    border: none;
}

.table tbody td {
    padding: 1rem;
    border-color: var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: var(--light-bg);
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.badge-primary {
    background-color: rgba(79, 70, 229, 0.2);
    color: var(--primary-dark);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--secondary-dark);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #991B1B;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.bg-light {
    background-color: var(--light-bg) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted) !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.shadow-md {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.rounded {
    border-radius: 0.5rem;
}

.rounded-lg {
    border-radius: 1rem;
}

.m-0 {
    margin: 0;
}

.p-0 {
    padding: 0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 2rem 1.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .product-card {
        margin-bottom: 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.45rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .hero {
        padding: 1.5rem 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .product-detail-container {
        padding: 1rem;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }

    .cart-item-image {
        width: 80px;
        height: 110px;
    }
}

.review-form-card,
.review-list-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid #eef2f7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.review-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.review-score {
    font-size: 2.4rem;
    font-weight: 900;
    color: #f59e0b;
}

    .review-score span {
        font-size: 1rem;
        color: #64748b;
    }

.review-stars {
    color: #f59e0b;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.review-item {
    padding: 18px 0;
    border-bottom: 1px solid #e2e8f0;
}

    .review-item:last-child {
        border-bottom: none;
    }

.review-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.review-date {
    color: #64748b;
    font-size: 0.88rem;
    margin-top: 2px;
}

.review-comment {
    margin: 0;
    color: #334155;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .review-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .review-header {
        flex-direction: column;
    }
}