/* Reset và base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.navbar {
    background: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    color: #ecf0f1;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
}

/* Main content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

/* Auth forms */
.auth-form {
    max-width: 450px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.alert {
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Search section */
.search-section {
    text-align: center;
    padding: 2rem 0;
}

.search-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.search-form input:focus {
    border-color: #3498db;
    outline: none;
}

/* Book grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.book-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.book-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.book-image-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    font-size: 4rem;
}

.book-info {
    padding: 1.2rem;
}

.book-info h3 {
    margin-bottom: 0.5rem;
}

.book-info h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.book-info h3 a:hover {
    color: #3498db;
}

.author {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.isbn {
    color: #95a5a6;
    font-size: 0.85rem;
}

.rating {
    color: #f39c12;
    margin: 0.5rem 0;
}

.price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e74c3c;
}

/* Book detail */
.book-detail-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.book-cover {
    width: 100%;
}

.book-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.book-cover-placeholder {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    font-size: 6rem;
    border-radius: 8px;
}

.book-meta h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.book-meta .author {
    font-size: 1.1rem;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.rating-stars .star {
    color: #ddd;
    font-size: 1.5rem;
}

.rating-stars .star.filled {
    color: #f39c12;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
}

.old-price {
    text-decoration: line-through;
    color: #95a5a6;
    margin-left: 1rem;
}

.stock {
    color: #27ae60;
    font-weight: 500;
}

.book-description {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.book-description h2 {
    margin-bottom: 1rem;
}

/* Reviews */
.reviews-section {
    margin-top: 2rem;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.review-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.review-user {
    font-weight: 500;
}

.review-date {
    color: #95a5a6;
    font-size: 0.9rem;
    margin-left: 1rem;
}

/* Rating input */
.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.3rem;
}

.rating-input input {
    display: none;
}

.rating-input label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-input label:hover,
.rating-input label:hover ~ label {
    color: #f39c12;
}

.rating-input input:checked ~ label {
    color: #f39c12;
}

/* Admin */
.admin-header {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    margin: 0;
}

.stat-info p {
    color: #7f8c8d;
    margin: 0;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.admin-action {
    background: white;
    padding: 1.5rem;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-action:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .book-detail-header {
        grid-template-columns: 1fr;
    }
    
    .book-cover {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-menu a {
        padding: 0.3rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .search-form {
        flex-direction: column;
    }
}