:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --glow: rgba(99, 102, 241, 0.15);
    --font-main: 'Outfit', sans-serif;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding-top: 60px;
}

.background-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo svg {
    color: var(--primary);
}

.w-6 {
    width: 2rem;
}

.h-6 {
    height: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* ==================== TABS ==================== */

.tabs-nav {
    display: flex;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.35rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(99, 102, 241, 0.08);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.tab-btn svg {
    flex-shrink: 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== CARDS ==================== */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input,
textarea {
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--glow);
}

/* ==================== BUTTONS ==================== */

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.875rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-stop {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.875rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    margin-top: 0.5rem;
}

.btn-stop:hover {
    background-color: #dc2626;
}

.btn-stop:active {
    transform: scale(0.98);
}

/* ==================== STATUS SECTION ==================== */

.status-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.status-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.file-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    word-break: break-all;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar-bg {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

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

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== FILES TABLE ==================== */

.files-container {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    flex: 1;
}

.files-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.table-responsive {
    overflow-y: auto;
    border-radius: 0.5rem;
    background: #0f172a;
    flex: 1;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.files-table th {
    top: 0;
    position: sticky;
    background: #1e293b;
    padding: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.files-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.files-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-completed {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.status-skipped {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.status-error {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.tbl-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin-top: 4px;
}

.tbl-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.2s;
}

.file-row-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-all;
}

.file-icon {
    color: var(--text-muted);
}

/* ==================== CONFIG SECTION ==================== */

.config-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.config-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.config-desc code {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.code-editor {
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 0.8rem !important;
    line-height: 1.6;
    background: #0a0f1a !important;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    color: #e2e8f0;
    resize: vertical;
    tab-size: 4;
}

.config-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.config-status {
    font-size: 0.85rem;
    padding: 0.5rem 0;
    min-height: 1.5rem;
}

.config-status.success {
    color: var(--success);
}

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

/* ==================== SA UPLOAD ==================== */

.sa-upload-area {
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    background: rgba(0, 0, 0, 0.15);
}

.sa-upload-area:hover,
.sa-upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.sa-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.sa-upload-content svg {
    opacity: 0.5;
}

.sa-upload-content p {
    font-size: 0.9rem;
}

.sa-browse {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.sa-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.sa-info .sa-count {
    color: var(--success);
    font-weight: 600;
}

.sa-info .sa-clear {
    color: var(--danger);
    cursor: pointer;
    text-decoration: underline;
    margin-left: 1rem;
    font-size: 0.8rem;
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ==================== CONFIRM MODAL ==================== */

.confirm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

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

.confirm-modal-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirm-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.confirm-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.confirm-modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-btn {
    padding: 10px 24px !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    min-width: 100px;
    cursor: pointer;
    font-weight: 500;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 600px) {
    body {
        padding-top: 30px;
    }

    .container {
        padding: 1rem;
    }

    .config-actions {
        flex-direction: column;
    }
}