:root {
    --bg-main: #0b0e14;
    --bg-surface: #161b22;
    --bg-input: #0d1117;
    --accent: #7928ca;
    --accent-glow: rgba(121, 40, 202, 0.4);
    --text-main: #f0f6fc;
    --text-dim: #8b949e;
    --border: #30363d;
    --border-hover: #484f58;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.2s ease-out;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header & Tabs */
header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 64px;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(90deg, #7928ca, #ff0080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-tabs {
    display: flex;
    height: 100%;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 0 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--text-main);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Main Layout */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Sections */
.section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

/* Upload Zone */
.upload-box {
    background: var(--bg-input);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-box:hover {
    border-color: var(--accent);
    background: rgba(121, 40, 202, 0.05);
}

.upload-box p {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.file-pill {
    margin-top: 1rem;
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    width: 100%;
}

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

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--border);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-ghost:hover {
    background: var(--bg-input);
    border-color: var(--border-hover);
}

/* Status & Progress */
.status-card {
    margin-top: 1rem;
}

.progress-track {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
}

#status-info {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
}

/* Library List */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}

.list-item:hover {
    border-color: var(--border-hover);
}

.item-meta h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.item-meta span {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-xs {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    width: auto;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
}

.modal-box h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.input-field {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    color: white;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    outline: none;
}

.input-field:focus {
    border-color: var(--accent);
}

@media (max-width: 600px) {
    .header-container { flex-direction: column; height: auto; padding: 1rem; gap: 1rem; }
    .nav-tabs { width: 100%; justify-content: center; }
}
