* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

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

/* Navigation */
nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #2563eb;
}

/* Main Content */
main {
    padding: 2rem 0;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.header p {
    color: #64748b;
    font-size: 1.1rem;
}

/* Search Controls */
.search-controls {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle {
    position: relative;
    width: 50px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle.active {
    background: #22c55e;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle.active::after {
    transform: translateX(26px);
}

/* Book List */
.book-list {
    display: grid;
    gap: 1rem;
}

.book-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.book-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.book-info h3 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.book-info .author {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.book-info .year {
    color: #94a3b8;
    font-size: 0.9rem;
}

.sources {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.source-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
    color: white;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s;
}

.source-logo:hover {
    transform: scale(1.1);
}

.source-logo.free {
    background: #22c55e;
}

.source-logo.paid {
    background: #f59e0b;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 2rem 0;
}

.pagination-btn {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.pagination-btn:hover:not(.disabled) {
    border-color: #2563eb;
    color: #2563eb;
}

.pagination-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #94a3b8;
    padding: 0 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: unset;
    }

    .book-header {
        flex-direction: column;
        gap: 1rem;
    }

    .sources {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .search-controls {
        padding: 1.5rem;
    }

    .book-item {
        padding: 1rem;
    }
}

