/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #bbbbbb;
    min-height: 100vh;
    color: #333;
}

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

/* Header styles */
header {
    background: #F4F1E8;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1000;
}

header h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header h1 .header-icon {
    width: 144px !important;
    height: 144px !important;
    max-width: 144px !important;
    max-height: 144px !important;
}

.search-container {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
    position: relative;
}

.search-input-row {
    display: flex;
    gap: 10px;
}

#searchInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    border-color: #3bb6d5;
}

#searchBtn {
    padding: 12px 20px;
    background: #3bb6d5;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#searchBtn:hover {
    background: #2a9bb8;
}

/* Search dropdown */
.search-dropdown {
    position: fixed;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-width: calc(100vw - 40px);
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    max-height: 400px;
    overflow-y: auto;
}

.search-results-list {
    padding: 10px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

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

.search-result-cover {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

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

.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.search-result-author {
    color: #718096;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.add-book-btn-small {
    background: #3bb6d5;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.add-book-btn-small:hover {
    background: #2a9bb8;
}

/* Main content */
main {
    background: #F4F1E8;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.list-header h2 {
    color: #4a5568;
    font-size: 1.8rem;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filter-btn:hover {
    border-color: #3bb6d5;
    color: #3bb6d5;
}

.filter-btn.active {
    background: #3bb6d5;
    color: white;
    border-color: #3bb6d5;
}

/* Book list styles */
.book-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.book-item {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid #3bb6d5;
    position: relative;
    cursor: move;
}

.drag-handle {
    color: #a0aec0;
    margin-right: 15px;
    cursor: grab;
    font-size: 16px;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.drag-handle:hover {
    color: #3bb6d5;
    background: #f7fafc;
}

.drag-handle:active {
    cursor: grabbing;
}

.book-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

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

.book-item.archived {
    opacity: 0.6;
    border-left-color: #a0aec0;
}

.book-item.completed {
    border-left-color: #ffc40e;
}

.book-cover {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.book-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
    word-wrap: break-word;
}

.book-author {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 10px;
}

.book-status {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.book-dates {
    margin-top: 8px;
}

.book-date-added {
    color: #a0aec0;
    font-size: 0.85rem;
    font-style: italic;
}

.book-date-completed {
    color: #ffc40e;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 2px;
}

.book-icon-picker {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #a0aec0;
}

.icon-btn i {
    font-size: 16px;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.icon-btn.active {
    border-width: 3px;
}

.icon-btn[data-icon="frog"]:hover {
    color: #ff9800;
}

.icon-btn[data-icon="frog"].active {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
}

.icon-btn[data-icon="elephant"]:hover {
    color: #9f7aea;
}

.icon-btn[data-icon="elephant"].active {
    background: #9f7aea;
    color: white;
    border-color: #9f7aea;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-upcoming {
    background: #e2e8f0;
    color: #4a5568;
}

.status-reading {
    background: #bee3f8;
    color: #2b6cb0;
}

.status-completed {
    background: #fff3cd;
    color: #856404;
}

.status-archived {
    background: #e2e8f0;
    color: #4a5568;
}

.rating {
    display: flex;
    gap: 2px;
}

.star {
    color: #e2e8f0;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s ease;
}

.star.active {
    color: #ffc40e;
}

.book-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-complete {
    background: #ffc40e;
    color: #333;
}

.btn-complete:hover {
    background: #e6b000;
}

.btn-archive {
    background: #a0aec0;
    color: white;
}

.btn-archive:hover {
    background: #718096;
}

.btn-delete {
    background: #f56565;
    color: white;
}

.btn-delete:hover {
    background: #e53e3e;
}

.btn-move-up, .btn-move-down {
    background: #3bb6d5;
    color: white;
    padding: 6px 10px;
}

.btn-move-up:hover, .btn-move-down:hover {
    background: #2a9bb8;
}


/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover {
    color: #000;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #cbd5e0;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .book-item {
        flex-direction: column;
        text-align: center;
    }
    
    .book-cover {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .book-status {
        justify-content: center;
    }
    
    .search-results-list {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        justify-content: center;
    }
    
    .book-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}
