/* dashboard.css */

.dashboard-page {
    min-height: 100vh;
    background: url("../Image/Background_Image_library.png") center/cover no-repeat fixed;
    position: relative;
}

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

.dashboard-title {
    text-align: center;
    font-size: 3rem;
    color: var(--text-main);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px white;
}

/* Секція останніх книг */
.recent-books-section {
    margin-bottom: 60px;
}

.recent-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.book-card-mini {
    background: white;
    padding: 20px;
    border-radius: 15px;
    width: 260px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

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

.book-card-mini .book-menu-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.book-card-mini .book-menu-btn:hover {
    background: rgba(0,0,0,0.7);
}

.book-card-mini .book-cover-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
}

.book-card-mini .book-cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card-mini h4 {
    margin: 10px 0 5px 0;
    font-size: 1.4rem;
}

.book-card-mini .book-author {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 10px;
}

.book-card-mini .progress-bar {
    margin: 10px 0;
    background: #e2e8f0;
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.book-card-mini .progress-fill {
    background: #3b82f6;
    height: 100%;
    border-radius: 10px;
}

.book-card-mini .progress-text {
    font-size: 1.1rem;
    color: #64748b;
}

/* Нижня сітка (Бібліотека зліва, Словник справа) */
.dashboard-lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.dashboard-column {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 25px;
    min-height: 500px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.column-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 2.2rem;
    color: var(--primary-color);
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* ============ КНИЖКОВА ПОЛИЦЯ З ПРОКРУТКОЮ ============ */
#shelfContent {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

#shelfContent::-webkit-scrollbar {
    width: 8px;
}

#shelfContent::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

#shelfContent::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 10px;
}

#shelfContent::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

.shelf-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shelf-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    position: relative;
}

.shelf-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    padding-left: 8px;
}

.shelf-item .book-cover {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

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

.shelf-item .book-title {
    font-weight: 600;
    font-size: 1.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shelf-item .book-author {
    font-size: 1.2rem;
    color: #64748b;
}

.shelf-item .progress-bar {
    margin-top: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    height: 4px;
    overflow: hidden;
}

.shelf-item .progress-fill {
    background: #3b82f6;
    height: 100%;
    border-radius: 10px;
}

.shelf-item .progress-percent {
    font-size: 1.2rem;
    color: #64748b;
    flex-shrink: 0;
}

.shelf-item .shelf-menu-btn {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.shelf-item:hover .shelf-menu-btn {
    opacity: 1;
}

.shelf-menu-btn:hover {
    background: rgba(0,0,0,0.7);
}

/* ============ ОСОБИСТИЙ СЛОВНИК З ПРОКРУТКОЮ ============ */
#dictionaryContent {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
}

#dictionaryContent::-webkit-scrollbar {
    width: 8px;
}

#dictionaryContent::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

#dictionaryContent::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 10px;
}

#dictionaryContent::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Для Firefox */
#shelfContent, #dictionaryContent {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #e2e8f0;
}

.dictionary-actions {
    margin-bottom: 20px;
}

.play-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.word-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.word-text {
    font-weight: 600;
    font-size: 1.4rem;
}

.word-translation {
    font-size: 1.2rem;
    color: #64748b;
}

.word-actions {
    display: flex;
    gap: 8px;
}

.practice-word-btn, .delete-word-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

.practice-word-btn:hover {
    background: #e2e8f0;
    color: #3b82f6;
}

.delete-word-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Панель масових дій */
.vocabulary-batch-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.select-all-btn, .delete-selected-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.select-all-btn {
    background: #e2e8f0;
    color: #1e293b;
}

.delete-selected-btn {
    background: #fee2e2;
    color: #ef4444;
}

.word-checkbox {
    margin-right: 12px;
}

.word-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Empty states */
.empty-state, .empty-shelf {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.empty-state .material-symbols-outlined,
.empty-shelf .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 15px;
}

.cta-button {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
}

/* Loading */
.loading-mini {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

/* Guest message */
.guest-message {
    text-align: center;
    padding: 60px 20px;
}

.guest-message .material-symbols-outlined {
    font-size: 64px;
    color: #64748b;
}

/* Адаптивність */
@media (max-width: 900px) {
    .dashboard-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .book-card-mini {
        width: 100%;
        max-width: 280px;
    }
    
    #shelfContent {
        max-height: 400px;
    }
    
    #dictionaryContent {
        max-height: 350px;
    }
}