﻿/* Reset và font chữ */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

    header h1 {
        font-size: 2rem;
        font-weight: 600;
        letter-spacing: 1px;
    }

/* Layout chính */
.content {
    display: flex;
    gap: 25px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

    .sidebar h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
        color: var(--primary-color);
        padding-bottom: 10px;
        border-bottom: 2px solid var(--light-color);
    }

.category-list {
    list-style: none;
}

.category-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--dark-color);
    border-left: 4px solid transparent;
}

    .category-item:hover {
        background-color: #f0f7ff;
        color: var(--secondary-color);
        border-left-color: var(--secondary-color);
    }

    .category-item.active {
        background-color: var(--secondary-color);
        color: white;
        border-left-color: var(--primary-color);
    }

/* Phần hiển thị sách */
.book-display {
    flex: 1;
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

    .book-header h2 {
        font-size: 1.5rem;
        color: var(--primary-color);
    }

.book-count {
    color: var(--dark-color);
    font-size: 0.95rem;
    background: var(--light-color);
    padding: 8px 15px;
    border-radius: 20px;
}

#book-total {
    font-weight: bold;
    color: var(--accent-color);
}

/* Lưới sách */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

/* Card sách */
.book-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

    .book-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    }

    .book-card img {
        width: 100%;
        height: 220px;
        object-fit: cover;
        border-bottom: 1px solid #eee;
    }

    .book-card h3 {
        font-size: 1rem;
        padding: 12px 15px 5px;
        color: var(--dark-color);
        font-weight: 600;
    }

.book-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    padding: 0 15px 8px;
}

.book-category {
    font-size: 0.75rem;
    color: var(--secondary-color);
    background-color: #f0f7ff;
    padding: 5px 10px;
    border-radius: 4px;
    margin: 0 15px 15px;
    display: inline-block;
    align-self: flex-start;
}

/* Responsive */
@media (max-width: 992px) {
    .content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 576px) {
    .book-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .book-grid {
        grid-template-columns: 1fr;
    }
}
