﻿/* ============================================
   Save Library вЂ” СЃС‚РёР»Рё СЃС‚СЂР°РЅРёС†С‹ Р±РёР±Р»РёРѕС‚РµРєРё
   Spamton Save Editor
   ============================================ */

/* в”Ђв”Ђв”Ђ Page Layout в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeUp 0.3s ease both;
}

.lib-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 24px 0 20px;
}

.lib-title {
    font-size: 30px;
    margin: 0 0 8px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lib-subtitle {
    color: var(--text-2);
    font-size: 15px;
    margin: 0 0 20px;
}

.lib-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lib-back-link {
    color: var(--text-2);
    font-size: 13px;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--elevated);
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.lib-back-link:hover {
    background: var(--hover);
    border-color: var(--accent);
    color: var(--accent);
}

/* в”Ђв”Ђв”Ђ Toolbar в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.lib-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lib-filter-btn {
    background: var(--elevated);
    color: var(--text-2);
    border: 1px solid var(--border);
    padding: 5px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.lib-filter-btn:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border-strong);
}

.lib-filter-btn.active {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(155,89,244,0.3);
    font-weight: 600;
}

.lib-search-sort {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.lib-search {
    display: flex;
    flex: 1;
    min-width: 200px;
}

.lib-search-input {
    flex: 1;
    padding: 7px 12px;
    background: var(--elevated);
    border: 1px solid var(--border-strong);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.lib-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(155,89,244,0.15);
}

.lib-search-btn {
    padding: 7px 14px;
    background: var(--elevated);
    border: 1px solid var(--border-strong);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-2);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}

.lib-search-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.lib-sort-select {
    padding: 7px 12px;
    background: var(--elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.lib-sort-select option {
    background: var(--surface);
    color: var(--text);
}

/* в”Ђв”Ђв”Ђ Count bar в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-count-bar {
    color: var(--text-3);
    font-size: 13px;
    margin-bottom: 14px;
    padding: 0 4px;
}

/* в”Ђв”Ђв”Ђ Grid в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    min-height: 200px;
}

.lib-loading,
.lib-empty,
.lib-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-2);
    font-size: 14px;
}

.lib-error {
    color: var(--danger);
}

/* в”Ђв”Ђв”Ђ Card в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition), background var(--transition),
                box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

.lib-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: var(--gradient-dim);
    transition: opacity var(--transition);
    pointer-events: none;
}

.lib-card:hover {
    border-color: var(--accent);
    background: var(--elevated);
    box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 0 0 1px rgba(155,89,244,0.2);
    transform: translateY(-3px);
}

.lib-card:hover::before {
    opacity: 1;
}

.lib-card:active {
    transform: translateY(-1px);
}

/* Supporter card */
.lib-card-supporter {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(155,89,244,0.25), var(--accent-glow-sm);
}

.lib-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.lib-card-chapter {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-xs);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
}

.lib-card-own {
    background: var(--elevated);
    color: var(--text-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    padding: 2px 7px;
    font-size: 11px;
    font-weight: bold;
}

.lib-card-name {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.lib-card-desc {
    color: var(--text-2);
    font-size: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.lib-card-meta {
    display: flex;
    gap: 12px;
    color: var(--text-3);
    font-size: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.lib-card-stats {
    color: var(--text-3);
    font-size: 12px;
    margin-bottom: 10px;
}

.lib-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.lib-action-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--elevated);
    color: var(--text-2);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    text-align: center;
}

.lib-action-btn:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border-strong);
}

.lib-download-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

.lib-load-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.lib-delete-btn {
    flex: 0;
    padding: 6px 10px;
}

.lib-delete-btn:hover {
    background: rgba(244,89,89,0.12);
    color: var(--danger);
    border-color: var(--danger);
}

/* в”Ђв”Ђв”Ђ Pagination в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    padding-bottom: 40px;
    flex-wrap: wrap;
}

.lib-page-btn {
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.lib-page-btn:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--accent);
}

.lib-page-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

/* в”Ђв”Ђв”Ђ Like button в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-like-btn {
    flex: 0 0 auto;
    padding: 6px 9px;
    font-size: 14px;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.lib-like-btn:hover,
.lib-like-btn.lib-liked {
    background: rgba(244, 89, 89, 0.12);
    color: #f47;
    border-color: #f47;
}

.lib-likes-count {
    color: var(--text-2);
}

/* в”Ђв”Ђв”Ђ Share button в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.lib-share-btn {
    flex: 0 0 auto;
    padding: 6px 9px;
}

.lib-share-btn:hover {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border-strong);
}

/* в”Ђв”Ђв”Ђ Scroll to top в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--elevated);
    color: var(--text-2);
    font-size: 16px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    font-family: inherit;
    line-height: 1;
    box-shadow: var(--shadow-sm);
}

.scroll-top-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

.scroll-top-btn.visible {
    display: flex;
}

/* в”Ђв”Ђв”Ђ Responsive в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

@media (max-width: 768px) {
    .lib-page {
        padding: 12px;
    }

    .lib-title {
        font-size: 24px;
    }

    .lib-grid {
        grid-template-columns: 1fr;
    }

    .lib-search-sort {
        flex-direction: column;
    }

    .lib-search {
        width: 100%;
    }

    .lib-sort-select {
        width: 100%;
    }

    .lib-header-actions {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .lib-card-actions {
        flex-direction: column;
    }

    .lib-delete-btn {
        flex: 1;
    }
}

