/* Community Book Search - Modern UI/UX Styles */

* {
    box-sizing: border-box;
}

.cbs-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.cbs-header {
    text-align: center;
    margin-bottom: 50px;
}

.cbs-header h1 {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.cbs-header p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Search Type Buttons */
.cbs-search-type {
    margin-bottom: 40px;
}

.cbs-search-type h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.cbs-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.cbs-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    background: #ffffff;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    font-weight: 600;
    color: #333;
    position: relative;
    overflow: hidden;
}

.cbs-type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.1), transparent);
    transition: left 0.5s;
}

.cbs-type-btn:hover::before {
    left: 100%;
}

.cbs-type-btn:hover {
    border-color: #4CAF50;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.2);
}

.cbs-type-btn.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #4CAF50;
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
}

.cbs-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.cbs-label {
    font-size: 16px;
}

/* Search Box */
.cbs-search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
}

.cbs-input-group {
    flex: 1;
    position: relative;
}

#cbs-search-input {
    width: 100%;
    padding: 18px 25px;
    font-size: 17px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

#cbs-search-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

#cbs-search-btn {
    padding: 18px 35px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

#cbs-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

#cbs-search-btn:active {
    transform: translateY(0);
}

.cbs-btn-icon {
    font-size: 20px;
}

/* Search Suggestions */
.cbs-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cbs-suggestion-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f5f5f5;
    font-size: 15px;
    color: #333;
}

.cbs-suggestion-item:hover {
    background: #f8f9fa;
    padding-left: 25px;
}

.cbs-suggestion-item:last-child {
    border-bottom: none;
}

/* Filters */
.cbs-filters {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.cbs-filter-toggle {
    width: 100%;
    padding: 18px 25px;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.cbs-filter-toggle:hover {
    background: #e9ecef;
}

.cbs-arrow {
    transition: transform 0.3s;
    font-size: 12px;
}

.cbs-arrow.rotate {
    transform: rotate(180deg);
}

.cbs-filter-content {
    display: none;
    padding: 25px;
    border-top: 1px solid #e0e0e0;
}

.cbs-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.cbs-filter-item label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.cbs-filter-item select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.cbs-filter-item select:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Results */
.cbs-results {
    margin-top: 50px;
}

.cbs-loading {
    text-align: center;
    padding: 60px 20px;
}

.cbs-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cbs-loading p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Alerts */
.cbs-alert {
    padding: 20px 25px;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.cbs-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.cbs-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* No Results */
.cbs-no-results {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 16px;
}

.cbs-no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cbs-no-results h3 {
    font-size: 28px;
    color: #333;
    margin: 0 0 15px 0;
}

.cbs-no-results p {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
    line-height: 1.6;
}

/* Results Summary */
.cbs-summary {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid #e0e0e0;
}

.cbs-summary h2 {
    font-size: 32px;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.cbs-summary p {
    font-size: 17px;
    color: #666;
    margin: 0;
}

/* Community Sections */
.cbs-community-section {
    margin-bottom: 50px;
}

.cbs-community-header {
    margin-bottom: 25px;
}

.cbs-community-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cbs-community-icon {
    font-size: 42px;
    flex-shrink: 0;
}

.cbs-community-title h3 {
    font-size: 26px;
    color: #1a1a1a;
    margin: 0;
    font-weight: 700;
}

.cbs-community-title p {
    font-size: 15px;
    color: #666;
    margin: 5px 0 0 0;
}

/* Books Grid */
.cbs-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Book Card */
.cbs-book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.cbs-book-card.cbs-fade-in {
    opacity: 1;
    transform: translateY(0);
}

.cbs-book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.cbs-book-image {
    position: relative;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cbs-book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.cbs-book-card:hover .cbs-book-image img {
    transform: scale(1.05);
}

.cbs-book-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.cbs-status-available {
    background: #4CAF50;
}

.cbs-status-borrowed {
    background: #FF9800;
}

.cbs-status-offline {
    background: #9E9E9E;
}

.cbs-book-details {
    padding: 25px;
}

.cbs-book-title {
    font-size: 20px;
    margin: 0 0 12px 0;
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 56px;
}

.cbs-book-author {
    color: #666;
    font-size: 15px;
    margin: 0 0 15px 0;
    font-style: italic;
}

.cbs-book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.cbs-book-condition,
.cbs-book-genre,
.cbs-availability-badge,
.cbs-city-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.cbs-availability-badge {
    background: #fff3e0;
    color: #e65100;
}

.cbs-city-badge {
    background: #e1f5fe;
    color: #01579b;
}

.cbs-condition-new,
.cbs-condition-like_new {
    background: #e8f5e9;
    color: #2e7d32;
}

.cbs-condition-good {
    background: #e3f2fd;
    color: #1565c0;
}

.cbs-condition-fair {
    background: #fff3e0;
    color: #e65100;
}

.cbs-condition-poor {
    background: #fce4ec;
    color: #c2185b;
}

.cbs-book-genre {
    background: #f3e5f5;
    color: #7b1fa2;
}

.cbs-book-owner {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
}

.cbs-username {
    color: #4CAF50;
    font-weight: 600;
}

.cbs-book-location {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.cbs-location-tag {
    font-size: 12px;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 15px;
    color: #555;
}

.cbs-view-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.cbs-view-btn:hover {
    color: white;
    text-decoration: none;
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.cbs-arrow-right {
    font-size: 20px;
    transition: transform 0.3s;
}

.cbs-view-btn:hover .cbs-arrow-right {
    transform: translateX(5px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cbs-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .cbs-header h1 {
        font-size: 32px;
    }
    
    .cbs-header p {
        font-size: 16px;
    }
    
    .cbs-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cbs-search-box {
        flex-direction: column;
    }
    
    #cbs-search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cbs-filter-grid {
        grid-template-columns: 1fr;
    }
    
    .cbs-books-grid {
        grid-template-columns: 1fr;
    }
    
    .cbs-book-image {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .cbs-wrapper {
        padding: 30px 15px;
    }
    
    .cbs-header h1 {
        font-size: 28px;
    }
    
    .cbs-type-grid {
        grid-template-columns: 1fr;
    }
    
    .cbs-type-btn {
        flex-direction: row;
        justify-content: flex-start;
        padding: 20px;
        gap: 15px;
    }
    
    .cbs-icon {
        font-size: 32px;
        margin-bottom: 0;
    }
    
    .cbs-summary h2 {
        font-size: 24px;
    }
    
    .cbs-community-title {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cbs-community-icon {
        font-size: 36px;
    }
}

/* Scrollbar Styling */
.cbs-suggestions::-webkit-scrollbar {
    width: 8px;
}

.cbs-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cbs-suggestions::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

.cbs-suggestions::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}