:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 32, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f0f5;
    --text-secondary: #9898a8;
    --accent: #6c5ce7;
    --accent-hover: #7f6ff0;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --success: #00cec9;
    --warning: #fdcb6e;
    --danger: #ff6b6b;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.06) 0%, transparent 50%);
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Glass */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.logo-icon { color: var(--accent); font-size: 1.3rem; }

.search-form {
    flex: 1;
    display: flex;
    max-width: 480px;
}

.search-form input {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.search-form button {
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.search-form button:hover { background: var(--accent-hover); }

.nav-links { display: flex; gap: 16px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.nav-links a:hover { color: var(--text-primary); }

/* Hero */
.hero { padding: 80px 0 60px; }

.hero-content {
    padding: 60px 48px;
    text-align: center;
    border-radius: var(--radius-lg);
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 32px;
}

.stat-value { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover { background: rgba(255,255,255,0.12); }

/* Sections */
.section { padding: 48px 0; }
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.page-header { padding: 48px 0 24px; }
.page-header h1 { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; }
.page-subtitle { color: var(--text-secondary); margin-top: 8px; }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 8px; opacity: 0.4; }

/* Grid */
.grid { display: grid; gap: 24px; }
.grid-categories { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-collections { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Cards */
.card {
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(108, 92, 231, 0.3);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
}

.card-image.no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--bg-secondary), rgba(108,92,231,0.1));
}

.card-body { padding: 16px 20px; }
.card-body h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.card-meta { font-size: 0.8rem; color: var(--text-secondary); }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
}

.badge-stl { background: rgba(108,92,231,0.2); color: #a29bfe; }
.badge-preview { background: rgba(0,206,201,0.15); color: var(--success); }
.badge-no-preview { background: rgba(255,107,107,0.15); color: var(--danger); }
.badge-multi { background: rgba(253,203,110,0.15); color: var(--warning); }
.badge-zip { background: rgba(255,255,255,0.1); color: var(--text-secondary); }

/* Collection detail */
.collection-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 24px 0 48px;
}

.collection-preview { padding: 24px; border-radius: var(--radius-lg); }
.cover-image { width: 100%; border-radius: var(--radius); object-fit: contain; max-height: 500px; }

.no-preview-large {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.gallery { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: var(--transition); }
.gallery-thumb:hover { transform: scale(1.05); }

.collection-info h1 { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; margin-bottom: 8px; }
.category-path { color: var(--accent); font-size: 0.9rem; margin-bottom: 4px; }
.original-path { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 16px; word-break: break-all; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag {
    padding: 4px 14px;
    background: rgba(108,92,231,0.15);
    color: #a29bfe;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: var(--transition);
}
.tag:hover { background: rgba(108,92,231,0.3); }

.files-section { padding: 24px; margin-top: 24px; border-radius: var(--radius-lg); }
.files-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.files-header h2 { font-size: 1.1rem; }

.file-list { list-style: none; }
.file-item { border-bottom: 1px solid var(--glass-border); }
.file-item:last-child { border-bottom: none; }

.file-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border-radius: 8px;
}

.file-link:hover { background: rgba(108,92,231,0.1); }
.file-icon { color: var(--accent); }
.file-name { flex: 1; font-weight: 500; }
.file-size { color: var(--text-secondary); font-size: 0.8rem; white-space: nowrap; }
.file-meta { display: block; font-size: 0.75rem; color: var(--text-secondary); font-weight: 400; margin-top: 2px; }

.useful-category-section { padding-top: 0; }
.useful-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
}
.useful-icon-pdf { background: rgba(255, 107, 107, 0.15); color: var(--danger); }
.useful-icon-doc, .useful-icon-docx { background: rgba(108, 92, 231, 0.15); color: #a29bfe; }
.useful-icon-xls, .useful-icon-xlsx, .useful-icon-csv { background: rgba(0, 206, 201, 0.15); color: var(--success); }

/* Filter panel */
.filter-panel { padding: 24px; margin-bottom: 24px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filter-row input, .filter-row select {
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}
.filter-row input { flex: 1; min-width: 200px; }
.results-count { color: var(--text-secondary); margin-bottom: 16px; font-size: 0.9rem; }

/* Admin */
.table-wrap { overflow-x: auto; padding: 0; border-radius: var(--radius-lg); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--glass-border); }
.data-table th { color: var(--text-secondary); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.status { padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.status-completed { background: rgba(0,206,201,0.15); color: var(--success); }
.status-running { background: rgba(108,92,231,0.15); color: #a29bfe; }
.status-failed { background: rgba(255,107,107,0.15); color: var(--danger); }
.status-pending { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

.log-list { padding: 16px; border-radius: var(--radius-lg); max-height: 500px; overflow-y: auto; }
.log-entry { display: flex; gap: 12px; padding: 6px 0; font-size: 0.8rem; font-family: monospace; border-bottom: 1px solid rgba(255,255,255,0.03); }
.log-time { color: var(--text-secondary); min-width: 70px; }
.log-stage { color: var(--accent); min-width: 100px; }
.log-level { min-width: 60px; font-weight: 600; }
.log-error .log-level { color: var(--danger); }
.log-warning .log-level { color: var(--warning); }
.log-info .log-level { color: var(--success); }

/* Footer */
.footer { margin-top: 80px; padding: 24px 0; text-align: center; border-radius: 0; border-bottom: none; border-left: none; border-right: none; }
.footer p { color: var(--text-secondary); font-size: 0.85rem; }

.empty-state { color: var(--text-secondary); padding: 48px 0; text-align: center; grid-column: 1 / -1; }

.main-content { min-height: calc(100vh - 200px); }

/* Responsive */
@media (max-width: 768px) {
    .nav-inner { flex-wrap: wrap; }
    .search-form { order: 3; max-width: 100%; width: 100%; }
    .collection-layout { grid-template-columns: 1fr; }
    .hero-content { padding: 40px 24px; }
    .hero-stats { gap: 24px; }
    .filter-row { flex-direction: column; }
    .filter-row input, .filter-row select { width: 100%; }
}
