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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #eee;
    min-height: 100vh;
    background-image: radial-gradient(ellipse at 50% 0%, #1a1a2e 0%, #0a0a0a 70%);
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0 20px;
}

header h1 {
    font-size: 2.5em;
    background: linear-gradient(135deg, #FFD700, #FF6B00, #FF0066);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle { color: #888; font-size: 1em; }

.card {
    background: rgba(26, 26, 26, 0.9);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
    backdrop-filter: blur(10px);
}

.card h2 { margin-bottom: 16px; font-size: 1.2em; }

input[type="url"] {
    width: 100%;
    padding: 16px 18px;
    border-radius: 12px;
    border: 2px solid #333;
    background: #111;
    color: #eee;
    font-size: 1em;
    margin-bottom: 12px;
    transition: border-color 0.3s;
}

input[type="url"]:focus { outline: none; border-color: #FFD700; }

button, .btn-download, .btn-secondary {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button {
    background: linear-gradient(135deg, #FFD700, #FF6B00);
    color: #000;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

button:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.4);
}

button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-download {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
}

.btn-download:hover { transform: scale(1.02); }

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #eee;
    border: 1px solid #333;
}

.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.error { color: #e74c3c; margin-top: 12px; padding: 12px; background: #2a1515; border-radius: 8px; }

.progress-bar {
    width: 100%;
    height: 14px;
    background: #222;
    border-radius: 7px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid #333;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FF6B00, #FF0066);
    border-radius: 7px;
    transition: width 0.5s ease;
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text { color: #ccc; margin-bottom: 8px; font-size: 1.1em; }
.log-box { background: #0a0a0a; padding: 16px; border-radius: 8px; font-size: 0.85em; color: #888; max-height: 200px; overflow-y: auto; font-family: monospace; }

.video-preview { text-align: center; margin: 20px 0; }
.video-preview video { max-width: 100%; border-radius: 16px; background: #000; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }

.actions { margin-top: 20px; }

.job-list { display: flex; flex-direction: column; gap: 8px; }
.job-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: rgba(17,17,17,0.8); border-radius: 10px;
    text-decoration: none; color: #eee; transition: background 0.2s, transform 0.1s;
    border: 1px solid #222;
}
.job-item:hover { background: #222; transform: translateX(4px); }
.job-title { font-size: 0.9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.job-status { font-size: 0.7em; padding: 4px 12px; border-radius: 20px; font-weight: 600; text-transform: uppercase; }
.status-done { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.status-failed { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.status-pending, .status-downloading, .status-transcribing, .status-analyzing, .status-rendering { background: rgba(255, 215, 0, 0.15); color: #FFD700; }

/* Result page */
.result-card { text-align: center; }
.result-header { margin-bottom: 16px; }
.badge-success {
    display: inline-block;
    padding: 4px 16px;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Segments list */
.segments-list { text-align: left; margin: 20px 0; }
.segments-list h3 { font-size: 1em; margin-bottom: 12px; color: #aaa; }
.segment-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(17,17,17,0.8);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #222;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    cursor: pointer;
}
.segment-item:hover { background: rgba(255,215,0,0.08); border-color: #FFD70088; transform: translateX(4px); }
.segment-item.selected { border-color: #FFD700; background: rgba(255,215,0,0.1); }
.segment-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FF6B00);
    color: #000;
    font-weight: 700;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.segment-info { flex: 1; }
.segment-title { font-weight: 600; font-size: 0.9em; margin-bottom: 4px; }
.segment-meta { display: flex; gap: 12px; font-size: 0.75em; color: #888; flex-wrap: wrap; }
.virality-tag {
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(100, 100, 255, 0.15);
    color: #8888ff;
    font-size: 0.85em;
    text-transform: capitalize;
}

footer { text-align: center; padding: 40px 0; color: #444; font-size: 0.8em; }