:root {
    --bg-gradient: linear-gradient(135deg, #090b10, #161b22, #0d1117);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --error: #ff7b72;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-card,
.glass-header,
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Login Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(9, 11, 16, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-card {
    position: relative;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    opacity: 0.15;
    pointer-events: none;
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-card input {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.login-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

button {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #0d1117;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: #79c0ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 15px;
    min-height: 20px;
}

/* Dashboard Layout */
.dashboard {
    opacity: 1;
    transition: opacity 0.5s;
    padding: 40px;
    max-width: 1500px;
    margin: 0 auto;
}

body:has(.overlay.active) .dashboard {
    opacity: 0.1;
    pointer-events: none;
}

.glass-header {
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #8b949e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.icon-btn {
    width: auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    transform: translateY(0);
}

/* Action Button Grid within Tables */
.action-btn-group {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 320px;
}

/* Table Container */
.table-container {
    border-radius: 16px;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    min-height: 400px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead {
    background: rgba(0, 0, 0, 0.2);
}

th {
    padding: 18px 25px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    background: rgba(13, 17, 23, 0.95);
    z-index: 10;
}

td {
    padding: 18px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.95rem;
    vertical-align: top;
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.url-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--accent);
}

.title-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spinner */
.spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.active {
    display: block;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.empty-state {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
}

/* Settings Overlay */
.settings-card {
    width: 90%;
    max-width: 550px;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
}

textarea {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s;
    resize: vertical;
    font-family: monospace;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.action-btn {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.2);
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
}

.action-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    transform: none;
    box-shadow: none;
}

/* Task Status Badges */
.status-badge.queued {
    background: rgba(255, 165, 0, 0.1);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.2);
}

.status-badge.completed {
    background: rgba(63, 191, 127, 0.1);
    color: #3fbf7f;
    border: 1px solid rgba(63, 191, 127, 0.2);
}

/* Tab Navigation */
.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    margin-right: 15px;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

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

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