:root {
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #ec4899;
    --secondary-glow: rgba(236, 72, 153, 0.4);
    --bg: #030712;
    --surface: rgba(17, 24, 39, 0.6);
    --surface-border: rgba(255, 255, 255, 0.08);
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --glass: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

[hidden] {
    display: none !important;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    overflow-x: hidden;
    position: relative;
}

/* Animated Aura Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, var(--primary-glow) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, var(--secondary-glow) 0%, transparent 50%);
    filter: blur(80px);
    z-index: -1;
    animation: auraMove 15s ease-in-out infinite alternate;
}

@keyframes auraMove {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(1.1) translate(2%, 3%);
    }

    100% {
        transform: scale(1) translate(-2%, -3%);
    }
}

.app-wrapper {
    width: 100%;
    max-width: 960px;
    z-index: 1;
}

.glass-card {
    background: var(--surface);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--surface-border);
    border-radius: 40px;
    padding: 80px;
    box-shadow:
        0 30px 60px -12px rgba(0, 0, 0, 0.7),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    animation: cardEntrance 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }

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

header {
    text-align: center;
    margin-bottom: 64px;
}

h1 {
    font-size: 64px;
    font-weight: 900;
    background: linear-gradient(135deg, #ddd6fe 0%, #fbcfe8 50%, #8b5cf6 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    margin-bottom: 8px;
    animation: textGradient 8s linear infinite;
}

@keyframes textGradient {
    to {
        background-position: 200% center;
    }
}

.subtitle {
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* URL Input */
.url-area {
    margin-bottom: 48px;
    position: relative;
}

.url-input {
    width: 100%;
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    color: white;
    font-size: 20px;
    font-weight: 400;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.file-input {
    width: 100%;
    margin-top: 16px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--glass-border);
    border-radius: 18px;
    color: var(--text);
    font-size: 16px;
}

.file-input::file-selector-button {
    margin-right: 16px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: white;
    color: #111827;
    font-weight: 800;
}

.recent-jobs-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--glass-border);
}

.recent-jobs-list {
    display: grid;
    gap: 12px;
}

.recent-job {
    width: 100%;
    text-align: left;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.recent-job:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.recent-job-open {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    background: transparent;
    border: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.delete-job-btn {
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.08);
    color: #fecaca;
    font-weight: 800;
    cursor: pointer;
}

.delete-job-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.recent-job-title {
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.recent-job-meta {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.recent-job-succeeded {
    border-color: rgba(34, 197, 94, 0.25);
}

.recent-job-failed {
    border-color: rgba(239, 68, 68, 0.35);
}

/* Metadata Preview & Shimmer */
.preview-panel {
    display: none;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 48px;
    gap: 28px;
    align-items: center;
    animation: panelPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

.preview-thumb {
    width: 220px;
    aspect-ratio: 16/9;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    background-size: 200% 100%;
    animation: shimmerEffect 1.5s infinite;
}

@keyframes shimmerEffect {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.preview-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
}

/* Feature Grid */
.checklist-section {
    margin-bottom: 48px;
}

.section-label {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 20px;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.3), transparent);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.check-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.check-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.check-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.check-item input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: transparent;
    box-shadow: 0 0 15px var(--primary-glow);
}

.check-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 800;
}

.check-label {
    display: flex;
    flex-direction: column;
}

.check-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.check-desc {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* AI Settings Section */
.ai-settings {
    background: rgba(139, 92, 246, 0.02);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 48px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ai-settings::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.ai-settings.dimmed {
    opacity: 0.15;
    pointer-events: none;
    filter: blur(2px) grayscale(0.5);
    transform: scale(0.98);
}

.ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    color: #c4b5fd;
    font-weight: 700;
    font-size: 15px;
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-toggle-switch {
    appearance: none;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
}

.ai-toggle-switch:checked {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.ai-toggle-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-toggle-switch:checked::before {
    transform: translateX(20px);
}

.ai-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: end;
}

.select-box {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    padding: 16px;
    color: white;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

/* Submit Button */
.go-btn {
    width: 100%;
    padding: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px -15px rgba(139, 92, 246, 0.5);
    letter-spacing: 0.02em;
}

.go-btn:hover:not(:disabled) {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -20px rgba(139, 92, 246, 0.6);
}

.go-btn:active:not(:disabled) {
    transform: translateY(-2px);
}

.go-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Status / Progress */
.status-area {
    margin-top: 60px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.prog-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.prog-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% auto;
    animation: progressFlow 3s linear infinite;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes progressFlow {
    to {
        background-position: 200% center;
    }
}

.status-msg {
    text-align: center;
    color: #94a3b8;
    font-size: 16px;
    font-weight: 500;
}

/* Results Hub */
.results-area {
    display: none;
    margin-top: 80px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tab-link {
    padding: 14px 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 15px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-link.active {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.content-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.copy-all-btn {
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
}

.copy-all-btn:hover {
    background: white;
    color: #111827;
}

.content-glass {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px;
    margin-bottom: 32px;
}

.text-viewer {
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #e2e8f0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.download-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.dw-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
}

.dw-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: scale(1.02);
}

.dw-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 700;
}

.dw-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: black;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Mobile Optimization */
@media (max-width: 768px) {
    .glass-card {
        padding: 40px 24px;
        border-radius: 0;
    }

    h1 {
        font-size: 42px;
    }

    .ai-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .preview-panel {
        flex-direction: column;
    }

    .preview-thumb {
        width: 100%;
    }

    .recent-job {
        grid-template-columns: 1fr;
    }

    .delete-job-btn {
        width: 100%;
    }
}