* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4bb543;
    --warning: #ffcc00;
    --danger: #dc3545;
    --gray: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: #f5f7fb;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo i {
    color: var(--accent);
}

.search-bar {
    display: flex;
    width: 40%;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.search-bar button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    background: #3ab0d5;
}

.user-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #3ab0d5;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

main {
    padding: 2rem 0;
}

.section-title {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title h2 {
    font-size: 1.8rem;
    color: var(--secondary);
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.book-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.book-cover {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.book-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-available {
    background: var(--success);
    color: white;
}

.status-borrowed {
    background: var(--warning);
    color: var(--dark);
}

.book-info {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
}

.book-author {
    color: var(--gray);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.book-description {
    font-size: 0.9rem;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--gray);
}

.book-rating {
    color: var(--warning);
}

.book-actions {
    display: flex;
    gap: 10px;
}

.book-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-borrow {
    background: var(--primary);
    color: white;
}

.btn-borrow:hover {
    background: var(--secondary);
}

.btn-details {
    background: #e9ecef;
    color: var(--dark);
}

.btn-details:hover {
    background: #dee2e6;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.book-detail {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.book-detail-cover {
    flex: 0 0 150px;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
}

.book-detail-info {
    flex: 1;
}

.book-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.book-detail-author {
    color: var(--gray);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.book-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.8rem;
    color: var(--gray);
}

.meta-value {
    font-weight: 600;
}

.book-detail-description {
    line-height: 1.6;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

footer {
    background: var(--dark);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    color: #adb5bd;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .search-bar {
        width: 100%;
    }

    .book-detail {
        flex-direction: column;
    }

    .book-detail-cover {
        align-self: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}