/* ============================================
   BookHaven - Professional Bookstore Styles
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Base */
body {
    font-family: var(--font-body);
    color: #334155;
    background-color: #fff;
}

h1, h2, h3, .hero-title, .section-title {
    font-family: var(--font-heading);
    color: var(--dark);
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

/* Navbar */
.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-text {
    font-family: var(--font-heading);
    color: var(--dark);
}

.search-form {
    max-width: 450px;
    width: 100%;
}

.search-form .form-control {
    border-radius: 25px 0 0 25px;
    border-right: none;
    padding-left: 1.25rem;
}

.search-form .btn {
    border-radius: 0 25px 25px 0;
}

/* Top Bar */
.top-bar {
    font-size: 0.85rem;
}

/* Category Nav */
.category-nav .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.category-nav .nav-link:hover {
    color: var(--primary) !important;
}

/* Hero Section */
.hero-section {
    padding: 2rem 0;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    line-height: 1.7;
}

.hero-image {
    max-height: 400px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.15));
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
}

.section-title i {
    color: var(--accent);
}

/* Book Cards */
.book-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1) !important;
}

.book-cover-wrapper {
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.3s ease;
}

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

.book-cover-placeholder {
    height: 250px;
}

.book-title {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-group {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

/* Category Cards */
.category-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.star-rating i {
    font-size: 0.875rem;
}

/* Rating Input (Review Form) */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}

.rating-input input {
    display: none;
}

.rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.15s;
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
    color: var(--accent);
}

/* Book Detail Page */
.book-detail-title {
    font-size: 2rem;
    font-weight: 700;
}

.book-desc-text {
    line-height: 1.8;
    color: #475569;
}

/* Promo Banner */
.promo-banner .card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* Footer */
.footer {
    margin-top: 3rem;
}

.footer-heading {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
}

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

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.social-links a {
    transition: color 0.2s;
}

.social-links a:hover {
    color: #fff !important;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Cards */
.card {
    border-radius: 0.75rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
}

/* Pagination */
.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 2px;
    border: none;
    color: var(--dark);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
}

/* Review Item */
.review-item:last-child {
    border-bottom: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-image-wrapper {
        margin-top: 2rem;
    }
    
    .book-cover-wrapper {
        height: 200px;
    }
    
    .search-form {
        max-width: 100%;
        margin: 0.5rem 0;
    }
    
    .top-bar .col-md-6:last-child {
        display: none;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .book-cover-wrapper {
        height: 180px;
    }
    
    .hero-stats {
        display: none;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}
