:root {
    --primary-color: #3f51b5;
    --bg-color: #121212;
    --panel-bg: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(90deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.folder-section {
    margin-bottom: 40px;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.folder-title {
    font-size: 1.8rem;
    color: #bb86fc;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-top: 0;
}

.animations-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
}

.animation-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.animation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(3, 218, 198, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.animation-name {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.canvas-container {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    background-color: #2c2c2c;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: transparent;
    pointer-events: none;
}

.animation-card {
    cursor: pointer;
}

/* ===== POPUP OVERLAY ===== */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    position: relative;
    width: 80vw;
    height: 80vh;
    background: var(--panel-bg);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.popup-title-bar {
    padding: 16px 56px 12px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.popup-actions {
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.popup-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.popup-action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.popup-action-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.popup-action-btn-primary {
    background: linear-gradient(90deg, #bb86fc, #03dac6);
    color: #121212;
    border-color: transparent;
}

.popup-action-btn-primary:hover:not(:disabled) {
    background: linear-gradient(90deg, #c79cff, #34e7d6);
    border-color: transparent;
}

.popup-title {
    font-size: 1.4rem;
    font-weight: 600;
    background: linear-gradient(90deg, #bb86fc, #03dac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.popup-canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #2c2c2c;
    overflow: hidden;
    position: relative;
}

.popup-canvas-container canvas {
    display: block;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.popup-close:hover {
    background: rgba(187, 134, 252, 0.3);
    transform: scale(1.1);
}

/* ===== STATS BAR ===== */
.stats-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    letter-spacing: 0.03em;
}

.project-toolbar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== PAGINATION ===== */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 12px 16px;
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pagination-bar-bottom {
    margin-top: 28px;
    margin-bottom: 40px;
}

.page-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.page-nav-btn:hover:not(:disabled) {
    background: rgba(187, 134, 252, 0.25);
    border-color: #bb86fc;
    transform: translateY(-1px);
}

.page-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.page-btn:hover {
    background: rgba(187, 134, 252, 0.2);
    color: #ffffff;
}

.page-btn.active {
    background: #bb86fc;
    border-color: #bb86fc;
    color: #121212;
    font-weight: 700;
}

.page-dots {
    color: var(--text-muted);
    padding: 0 4px;
    font-size: 1rem;
    line-height: 36px;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 0 8px;
}

.project-switch {
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-switch-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.project-switch-select {
    height: 36px;
    min-width: 180px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    padding: 0 10px;
    font-size: 0.85rem;
    outline: none;
}

.project-switch-select:focus {
    border-color: #bb86fc;
    box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.18);
}
.page-jump,
.folder-jump {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-jump-input,
.folder-jump-input {
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    padding: 0 10px;
    font-size: 0.85rem;
    outline: none;
}

.page-jump-input {
    width: 88px;
}

.folder-jump-input {
    width: 180px;
}

.page-jump-input:focus,
.folder-jump-input:focus {
    border-color: #bb86fc;
    box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.18);
}

.page-jump-input::placeholder,
.folder-jump-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.page-jump-btn,
.folder-jump-btn {
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.85rem;
    padding: 0 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.page-jump-btn:hover,
.folder-jump-btn:hover {
    background: rgba(187, 134, 252, 0.25);
    border-color: #bb86fc;
    transform: translateY(-1px);
}

.folder-jump-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* ===== CARD PLACEHOLDERS ===== */
.load-placeholder,
.load-error {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.2);
}

.load-error {
    color: rgba(255, 100, 100, 0.5);
    font-size: 1.4rem;
}

@media (max-width: 768px) {
    .popup-content {
        width: 92vw;
        height: 88vh;
    }

    .popup-actions {
        flex-wrap: wrap;
    }

    .popup-action-btn {
        flex: 1 1 180px;
    }

    .animations-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .animations-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}




