/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: #002855;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.subtitle {
    color: #6B7280;
    font-size: 1.1rem;
}

/* Search Form */
.search-form-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-section {
    margin-bottom: 35px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #E5E7EB;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.form-field input,
.form-field select {
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #E5E7EB;
    flex-wrap: wrap;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #0EA5E9 0%, #8B5CF6 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.5);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #D1D5DB;
}

.btn-secondary:hover {
    background: #F3F4F6;
    border-color: #0EA5E9;
    color: #0EA5E9;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #0EA5E9;
    margin-bottom: 10px;
}

.stat-label {
    display: block;
    color: #6B7280;
    font-size: 1rem;
    font-weight: 500;
}

/* Loading */
.loading {
    background: white;
    border-radius: 16px;
    padding: 80px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    border: 5px solid #F3F4F6;
    border-top-color: #0EA5E9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Table */
.results-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    overflow-x: auto;
    /* overflow: hidden;*/
    margin-bottom: 30px;
    -webkit-overflow-scrolling: touch;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background: linear-gradient(135deg, #F9FAFB 0%, #E5E7EB 100%);
}

.results-table th {
    padding: 20px 16px;
    text-align: left;
    font-weight: 700;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #D1D5DB;
    white-space: nowrap;
}


.results-table td {
    padding: 18px 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 0.95rem;
    color: #1F2937;
    white-space: nowrap;
}

.results-table tbody tr:hover {
    background: #F9FAFB;
    cursor: pointer;
}

.book-cover {
    width: 70px;
    height: 105px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.book-title {
    font-weight: 600;
    color: #1F2937;
    max-width: 350px;
}

.book-author {
    color: #6B7280;
    font-size: 0.9rem;
}

.book-category {
    color: #6B7280;
    font-size: 0.85rem;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-bsr {
    font-weight: 700;
    color: #0EA5E9;
    font-size: 1.05rem;
}

.book-rating {
    color: #F59E0B;
    font-weight: 600;
}

.book-price {
    font-weight: 700;
    color: #10B981;
    font-size: 1.1rem;
}

.btn-view {
    background: #0EA5E9;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-view:hover {
    background: #0284C7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    padding: 25px;
}

.btn-pagination {
    background: white;
    color: #374151;
    padding: 14px 28px;
    border: 2px solid #D1D5DB;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-pagination:hover:not(:disabled) {
    background: #F3F4F6;
    border-color: #0EA5E9;
    color: #0EA5E9;
    transform: translateY(-2px);
}

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

#paginationInfo {
    font-weight: 600;
    color: #374151;
    font-size: 1.05rem;
}

/* No Results */
.no-results {
    background: white;
    border-radius: 16px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 25px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.8rem;
    color: #374151;
    margin-bottom: 15px;
}

.empty-state p {
    color: #6B7280;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .search-form-container {
        padding: 25px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .results-table {
        font-size: 0.85rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 12px 10px;
    }
    
    .book-cover {
        width: 50px;
        height: 75px;
    }
    
    .pagination {
        flex-direction: column;
    }
}
