/* ============================================
   VidScan — Premium Dark Theme
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.3);

    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;

    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;

    --gradient-main: linear-gradient(135deg, #8b5cf6, #3b82f6, #06b6d4);
    --gradient-warm: linear-gradient(135deg, #ec4899, #f59e0b);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ---------- Animated Background Blobs ---------- */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    top: -200px;
    right: -150px;
    animation: float1 20s ease-in-out infinite;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    bottom: -100px;
    left: -200px;
    animation: float2 25s ease-in-out infinite;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-pink);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-50px, 80px) scale(1.1);
    }

    66% {
        transform: translate(30px, -40px) scale(0.95);
    }
}

@keyframes float2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(60px, -50px) scale(1.05);
    }

    66% {
        transform: translate(-40px, 30px) scale(0.9);
    }
}

@keyframes float3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ---------- Container ---------- */
.container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* ---------- Header ---------- */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8));
    }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 400;
}

/* ---------- Input Section ---------- */
.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(20px);
    transition: border-color 0.3s ease;
}

.input-card:focus-within {
    border-color: var(--border-glow);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.08);
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.platform-icon {
    position: absolute;
    left: 14px;
    font-size: 1.2rem;
    z-index: 2;
}

#video-url {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px 14px 44px;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#video-url::placeholder {
    color: var(--text-muted);
}

#video-url:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

#analyze-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--gradient-main);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

#analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
}

#analyze-btn:active {
    transform: translateY(0);
}

#analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    transition: transform 0.2s ease;
}

#analyze-btn:hover .btn-icon {
    transform: translateX(3px);
}

.supported-platforms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.platform-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ---------- Error Banner ---------- */
.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #fca5a5;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

/* ---------- Loading Section ---------- */
.loading-section {
    margin-top: 30px;
}

.loading-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 28px;
    text-align: center;
    backdrop-filter: blur(20px);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-main);
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* ---------- Results Section ---------- */
.results-section {
    margin-top: 30px;
    animation: fadeInUp 0.6s ease;
}

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

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

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 16px;
    backdrop-filter: blur(20px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.card-icon {
    font-size: 1.4rem;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Video embed */
.video-card {
    padding: 14px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Summary card */
.summary-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vibe-badge,
.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

.vibe-badge {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
}

.rating-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-purple), var(--accent-cyan));
    border-radius: 100px;
}

.timeline-item {
    position: relative;
    padding-bottom: 14px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 0.4s ease both;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -21px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-purple);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
    flex-shrink: 0;
}

.timeline-time {
    display: inline-block;
    font-family: 'Inter', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 6px;
    padding: 2px 8px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.timeline-time.clickable {
    cursor: pointer;
}

.timeline-time.clickable:hover {
    background: rgba(6, 182, 212, 0.25);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
    transform: scale(1.05);
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.5;
}

/* Highlight items (short-form platforms — no timestamps) */
.highlight-item {
    position: relative;
    padding-bottom: 14px;
    padding-left: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    animation: fadeInUp 0.4s ease both;
}

.highlight-item:last-child {
    padding-bottom: 0;
}

.highlight-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.highlight-desc {
    width: 100%;
    padding-left: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Content badges (Hook / CTA) */
.content-badge {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    animation: fadeInUp 0.4s ease both;
}

.content-badge:last-child {
    margin-bottom: 0;
    margin-top: 12px;
}

.badge-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.badge-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.hook-badge {
    background: rgba(236, 72, 153, 0.08);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.hook-badge .badge-label {
    background: rgba(236, 72, 153, 0.15);
    color: #f9a8d4;
}

.cta-badge {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.cta-badge .badge-label {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

/* ---------- Actions Row ---------- */
.actions-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    transform: translateY(-1px);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .container {
        padding: 24px 14px 40px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .input-row {
        flex-direction: column;
    }

    #analyze-btn {
        justify-content: center;
    }

    .input-card {
        padding: 20px;
    }

    .result-card {
        padding: 20px;
    }
}