* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.search-container, .sort-container {
    flex: 1;
}

.search-bar, .sort-select {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background: #f1f3f5;
    outline: none;
    font-size: 16px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2c3e50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.book-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.book-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.book-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
    align-items: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.book-container.grid-view .book-item {
    flex-direction: column;
    text-align: center;
    align-items: center;
}

.book-item:hover {
    transform: translateY(-5px);
}

.book-item img {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.book-details h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 20px;
}

.book-details p {
    color: #666;
    margin: 5px 0;
    font-size: 14px;
}

.book-details strong {
    color: #2c3e50;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 20px;
    border: none;
    background: #2c3e50;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.page-info {
    color: #2c3e50;
    font-size: 16px;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }
    
    .book-item {
        flex-direction: column;
        text-align: center;
    }
}