:root {
    --bg-deep: var(--bg);
    --bg-card: var(--card-bg);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --text-main: var(--text);
    --text-dim: var(--muted);
    --success: #10b981;
    --error: #ef4444;
}

body {
    background: var(--bg);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}


.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.portal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.uploader-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.uploader-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.15;
    pointer-events: none;
}

/* Uppy Overrides */
.uppy-Dashboard-inner {
    background: transparent !important;
    border: none !important;
    height: 500px !important;
}

.uppy-Dashboard-AddFiles-title {
    color: var(--text-main) !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

.uppy-Dashboard-browse {
    color: var(--accent) !important;
}

.uppy-StatusBar {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px) !important;
}

.uppy-StatusBar-actionBtn--upload {
    background: var(--accent) !important;
}

/* Index Activity Table Styles */
.extraction-status-container {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(to right, var(--text-main), var(--text-dim));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}




.content-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.summary-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.summary-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.6;
}

.summary-card.total::after {
    background: var(--text-main);
}

.summary-card.success::after {
    background: var(--success);
}

.summary-card.processing::after {
    background: var(--accent);
}

.summary-card.extract-queue::after {
    background: #f59e0b;
}

.summary-card.format-queue::after {
    background: #6366f1;
}

.summary-card.error::after {
    background: var(--error);
}

.summary-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
}

.table-wrapper {
    margin-bottom: 2rem;
}

.status-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    table-layout: fixed;
    /* Ensures fixed column widths */
}


/* Checkbox */
.status-table th:nth-child(1) {
    width: 3%;
}

/* File Name */
.status-table th:nth-child(2) {
    width: 22%;
}

/* Status */
.status-table th:nth-child(3) {
    width: 10%;
}

/* Next Activity */
.status-table th:nth-child(4) {
    width: 15%;
}

/* Date */
.status-table th:nth-child(5) {
    width: 15%;
}

/* Actions */
.status-table th:nth-child(6) {
    width: 35%;
}

.status-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-table th:hover {
    color: var(--text-main);
}

.status-table th .sort-icon::after {
    content: '↕';
    margin-left: 0.5rem;
    opacity: 0.3;
}

.status-table th.sort-asc .sort-icon::after {
    content: '↑';
    opacity: 1;
    color: var(--accent);
}

.status-table th.sort-desc .sort-icon::after {
    content: '↓';
    opacity: 1;
    color: var(--accent);
}

.status-table td {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.status-table tr td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.status-table tr td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.status-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.status-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    font-size: 0.95rem;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.file-message {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.status-queued {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-dim);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-starting {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    position: relative;
    overflow: hidden;
}

.status-starting::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(99, 102, 241, 0.4),
            transparent);
    animation: statusScan 2s infinite linear;
}

@keyframes statusScan {
    from {
        left: -100%;
    }

    to {
        left: 150%;
    }
}

.status-starting {
    animation: statusPulse 1.5s infinite ease-in-out;
}

@keyframes statusPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 10px 2px rgba(99, 102, 241, 0.2);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.status-formatted {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid #8b5cf6;
}

.status-indexed {
    background: rgba(6, 182, 212, 0.1);
    color: #22d3ee;
    border: 1px solid #06b6d4;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.action-btn {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.action-btn.delete {
    color: var(--error);
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pg-btn {
    padding: 0.4rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pg-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--text-main);
}

.pg-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pg-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

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

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

.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

.empty-msg {
    text-align: center;
    color: var(--text-dim);
    padding: 6rem 2rem !important;
    background: rgba(255, 255, 255, 0.01) !important;
    border: 1px dashed rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.empty-msg::before {
    content: '📑';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.2;
}