/**
 * Author: hoangedu773
 * GitHub: https://github.com/hoangedu773
 * Date: 2025-12-07
 * Description: Modern CSS styling for BookStore
 */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --bg-light: #f8f9fa;
    --text-dark: #2c3e50;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

* {
    font-family: 'Be Vietnam Pro', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* Navbar */
.navbar {
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    transition: var(--transition);
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Book Cards */
.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.book-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.book-card:hover .card-img-top {
    transform: scale(1.05);
}

.book-card .card-img-wrapper {
    overflow: hidden;
    position: relative;
}

.book-card .card-img-wrapper .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.book-card:hover .overlay {
    opacity: 1;
}

.book-card .card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.book-card .book-category {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.book-card .book-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
}

.book-card .book-price-old {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.book-card .btn-add-cart {
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

/* New badge */
.badge-new {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 10;
}

/* Section titles */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Category sidebar */
.category-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.category-sidebar h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-light);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
}

.category-list a:hover,
.category-list a.active {
    background: var(--gradient-primary);
    color: white;
}

/* Cart table */
.cart-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cart-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
    padding: 1rem;
}

.cart-table td {
    padding: 1rem;
    vertical-align: middle;
}

.cart-table .product-img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.quantity-input {
    width: 80px;
    text-align: center;
}

/* Cart summary */
.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.cart-summary h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.cart-summary .total-row {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    padding-top: 1rem;
    border-top: 2px solid var(--bg-light);
}

/* Forms */
.auth-form {
    max-width: 450px;
    margin: 40px auto;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.auth-form h2 {
    text-align: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-form p {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Book details */
.book-details {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.book-details .book-image {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.book-details h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.book-details .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.book-details .info-list {
    list-style: none;
    padding: 0;
}

.book-details .info-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.book-details .info-list strong {
    color: #666;
    min-width: 120px;
    display: inline-block;
}

/* Order confirmation */
.order-success {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin: 40px auto;
    max-width: 600px;
}

.order-success .success-icon {
    font-size: 5rem;
    color: var(--success-color);
    margin-bottom: 1.5rem;
}

.order-success h1 {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 4px;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .book-card .card-img-top {
        height: 150px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    animation: fadeInUp 0.5s ease forwards;
}

.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.2s; }
.book-card:nth-child(4) { animation-delay: 0.3s; }