/* Style Reset & Base Variable Setup */
:root {
    --bg-base: #0D1117;
    --bg-card: rgba(22, 27, 34, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --success-color: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --error-color: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.3);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Light Theme Variable Overrides */
[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.15);
}

[data-theme="light"] .glow-bg {
    background: radial-gradient(circle, rgba(79, 70, 229, 0.06) 0%, rgba(241, 245, 249, 0) 70%);
}

[data-theme="light"] .url-form input[type="url"] {
    background: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .url-form input[type="url"]:focus {
    background: #ffffff;
}

[data-theme="light"] .rate-limit-text {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .step-item.active .step-icon {
    background: #ffffff;
}

[data-theme="light"] .pricing-card {
    background: #ffffff !important;
}

[data-theme="light"] .notice-bar {
    background: rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.15);
    color: #4f46e5;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Glowing Background Blobs */
.glow-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(3, 7, 18, 0) 70%);
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
    animation: pulseGlow 10s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: translateX(-50%) scale(1); opacity: 0.8; }
    100% { transform: translateX(-50%) scale(1.2); opacity: 1; }
}

/* App Container Layout */
.app-container {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 1;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 24px;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-dot.yellow {
    background-color: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin: 20px 0;
}

.hero-section h1 {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(129, 140, 248, 0.2);
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* Glassmorphism Dashboard Cards */
.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2, .dashboard-card h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-accent {
    color: var(--accent-color);
}

.rate-limit-text {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
}

/* Forms & Inputs */
.url-form {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group {
    position: relative;
    flex-grow: 1;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
}

.url-form input[type="url"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 16px 16px 48px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    transition: all 0.2s ease;
}

.url-form input[type="url"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    background: rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 28px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--success-glow);
    width: 100%;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

/* Notices & Subtitles */
.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
    margin-bottom: 20px;
}

.notice-bar {
    background: rgba(99, 102, 241, 0.06);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #a5b4fc;
}

/* Payment Layout */
.payment-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    align-items: center;
}

.qr-container {
    width: 240px;
    height: 300px;
    background: #000;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.qr-loader {
    color: var(--text-secondary);
    font-size: 24px;
}

.payment-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-tag {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--success-color);
}

.price-tag span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.detail-row .label {
    color: var(--text-secondary);
}

.detail-row .val {
    font-weight: 600;
}

.id-text {
    font-family: monospace;
    font-size: 12px;
    color: var(--accent-color);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

.helper-text {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 5px;
}

.helper-text i {
    color: var(--success-color);
}

/* Progress Tracking */
.badge-running {
    font-size: 12px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
    animation: pulseBadge 1.5s infinite alternate;
}

@keyframes pulseBadge {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.progress-bar-container {
    height: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, #c084fc 100%);
    box-shadow: 0 0 8px var(--accent-glow);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-percent {
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 25px;
}

/* Stepper Timeline */
.stepper-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 20px;
}

.stepper-timeline::before {
    content: '';
    position: absolute;
    left: 29px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: relative;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 0.8;
}

.step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1f2937;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-item.active .step-icon {
    background: var(--bg-base);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.step-item.completed .step-icon {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    box-shadow: 0 0 8px var(--success-glow);
}

.step-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.step-title {
    font-weight: 600;
    font-size: 15px;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Results grid */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.results-header h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.clip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.clip-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.clip-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    background: #000;
}

.clip-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.clip-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    justify-content: space-between;
}

.clip-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
}

.btn-download {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-download:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Lock Overlay for Unpaid Previews */
.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10;
    color: #f59e0b; /* Amber gold color for lock */
}

.lock-overlay i {
    font-size: 36px;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.4));
    animation: lockPulse 2s infinite alternate;
}

@keyframes lockPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.lock-overlay span {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clip-card.locked video {
    pointer-events: none;
}

.clip-card.locked .btn-download {
    pointer-events: none;
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.02);
    border-color: transparent;
    color: var(--text-secondary);
}

/* Error states */
.error-card {
    border-color: rgba(239, 68, 68, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(239, 68, 68, 0.03);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.error-icon {
    font-size: 32px;
    color: var(--error-color);
    filter: drop-shadow(0 0 5px var(--error-glow));
}

.error-card h3 {
    font-family: var(--font-heading);
    color: var(--error-color);
    font-size: 16px;
    margin-bottom: 5px;
}

.error-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Footer styling */
footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #4b5563;
    font-size: 12px;
}

/* Responsive grid adjustments */
@media (max-width: 600px) {
    .url-form {
        flex-direction: column;
    }
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .payment-grid {
        grid-template-columns: 1fr;
    }
    .qr-container {
        margin: 0 auto;
    }
    .hero-section h1 {
        font-size: 28px;
    }
}
