/* Library View Styles */

#library-view {
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Prevent page scrolling */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.library-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent vertical scroll */
}

/* Search Container */
.library-search-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
    position: relative;
}

.search-bar {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
    transition: box-shadow 0.3s;
}

.search-bar:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-icon {
    color: #999;
    font-size: 16px;
    margin-right: 12px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    background: transparent;
}

.search-input::placeholder {
    color: #999;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.clear-search-btn:hover {
    color: #666;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8f8f8;
}

.result-icon {
    font-size: 20px;
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.result-subtitle {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.result-preview {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-header {
    margin-bottom: 40px;
    text-align: center;
}

.library-header h1 {
    font-size: 2rem;
    color: #333;
    margin: 0 0 8px 0;
}

.library-header p {
    font-size: 1rem;
    color: #999;
    margin: 0;
}

/* Horizontal Bookshelf */
.books-grid {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 40px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    justify-content: flex-start; /* Align to left */
}

.books-grid::-webkit-scrollbar {
    height: 8px;
}

.books-grid::-webkit-scrollbar-track {
    background: transparent;
}

.books-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.books-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Book Card - Simple bookshelf style */
.book-card {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-card:hover {
    transform: translateY(-10px);
}

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

/* Book Cover - Simple, clean design */
.book-cover {
    width: 140px;
    height: 200px;
    background: linear-gradient(135deg, #4a6da7 0%, #2a4a87 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.book-cover .icon {
    font-size: 56px;
    color: rgba(255, 255, 255, 0.9);
}

.book-cover.lyrics-cover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.book-cover.add-cover {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    box-shadow: none;
}

.book-cover.add-cover .icon {
    color: #999;
}

/* Book Info - Minimal */
.book-info {
    margin-top: 15px;
    text-align: center;
}

.book-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 3px 0;
}

.book-subtitle {
    font-size: 0.8rem;
    color: #999;
    margin: 0 0 5px 0;
}

.book-meta {
    font-size: 0.75rem;
    color: #bbb;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .library-container {
        padding: 20px 10px;
    }

    .library-search-container {
        max-width: 100%;
        margin-bottom: 30px;
        padding: 0 10px;
    }

    .search-bar {
        padding: 10px 16px;
    }

    .search-input {
        font-size: 13px;
    }

    .search-results {
        max-height: 300px;
    }

    .library-header {
        margin-bottom: 30px;
    }

    .library-header h1 {
        font-size: 1.5rem;
    }

    .library-header p {
        font-size: 0.9rem;
    }

    .books-grid {
        gap: 30px;
        padding: 20px;
    }

    .book-cover {
        width: 120px;
        height: 170px;
    }

    .book-cover .icon {
        font-size: 48px;
    }
}
