@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --background-color: #f3f4f6;
    --card-background: #ffffff;
    --text-color: #111827;
    --subtle-text: #6b7280;
    --border-color: #e5e7eb;
    --muted: #9ca3af;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 1rem 2rem 2rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1040px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    box-sizing: border-box;
}

.topbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 1rem; padding: 0; border-bottom: none; position: static; transform: none; width: 100%; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.auth-compact .inline-form input { padding: .5rem .6rem; }
.auth-compact .btn { padding: .5rem .7rem; }
.auth-state button { margin-left: .35rem; }
.btn { padding: .6rem .9rem; border-radius: 10px; font-weight: 600; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; }
.btn-outline { background: #fff; color: #111827; border-color: var(--border-color); }
.btn-outline:hover { background: #f9fafb; }
.btn-ghost { background: transparent; color: #111827; border-color: transparent; }
.btn-ghost:hover { background: #f3f4f6; }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-google { display: inline-flex; align-items: center; gap: .4rem; background: #fff; color: #111827; border-color: var(--border-color); }
.btn-google:hover { background: #f9fafb; }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; }
.inline-form input { padding: .4rem .6rem; border: 1px solid var(--border-color); border-radius: 8px; }
.muted { color: var(--subtle-text); }
.link-small { font-size: .85rem; color: #2563eb; text-decoration: none; margin-left: .35rem; }
.link-small:hover { text-decoration: underline; }
.user-chip { display: inline-flex; gap: .5rem; align-items: center; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 999px; padding: .35rem .6rem; }
.user-chip .avatar { background: #111827; color: #fff; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: .9rem; }
.user-chip .email { font-weight: 600; }
.user-chip .credits { color: var(--subtle-text); font-size: .9rem; }
.actions button { margin-left: .35rem; }
.user-menu-wrapper { position: relative; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: .5rem; box-shadow: 0 10px 24px rgba(0,0,0,.12); min-width: 220px; display: grid; gap: .4rem; z-index: 50; }
.user-menu .btn { width: 100%; text-align: left; }
.user-chip#user-menu-toggle { cursor: pointer; }
.menu-sep { height: 1px; background: var(--border-color); margin: .25rem 0; }

.hero { text-align: left; margin-bottom: 0; }
.brand { display: flex; align-items: center; justify-content: flex-start; gap: .6rem; }
.intro .ig-inline .ig-icon { width: 56px; height: 56px; }
.ig-inline { display: inline-flex; align-items: center; }
.ig-inline .ig-icon { width: 18px; height: 18px; display: inline-block; }

.logo { width: 48px; height: 48px; margin-bottom: .25rem; }
.brand .name { font-weight: 800; letter-spacing: .2px; font-size: 1.1rem; }

.headline { font-size: 2.6rem; line-height: 1.12; font-weight: 800; margin: .35rem 0 0 0; }

.tagline { color: var(--subtle-text); margin-top: .6rem; font-size: 1.05rem; }
.pill-row { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .75rem; }
.pill { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; padding: .25rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }

.card { border: 1px solid var(--border-color); border-radius: 12px; padding: 1.25rem; background: #fff; }
.section-title { margin: 0 0 1rem 0; font-size: 1.125rem; }
.input-group { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.help-text { margin: 0 0 .75rem 0; color: var(--muted); font-size: .9rem; }
.inline-balance { margin: .35rem 0 .25rem 0; font-size: .9rem; }
@media (min-width: 1024px) { .inline-balance { text-align: right; } }

#reel-url {
    flex: 1 1 260px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: box-shadow 0.2s;
}

#reel-url:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
    border-color: var(--primary-color);
}

/* Pretty file upload */
.file-group { display: inline-flex; align-items: center; gap: .5rem; }
.file-group input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.file-button { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; background: #111827; color: #fff; border: 1px solid #111827; padding: .65rem 1rem; border-radius: 10px; font-weight: 600; box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.06); transition: transform .04s ease, background .2s ease; }
.file-button:hover { background: #0b1220; }
.file-button:active { transform: translateY(1px); }
.file-name { color: var(--subtle-text); font-size: .9rem; }

#start-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#start-btn:hover {
    background-color: #4338ca;
}

#start-btn:disabled {
    background-color: #a5b4fc;
    cursor: not-allowed;
}

.hidden {
    display: none;
}

#download-section {
    margin-top: 1rem;
}

.result { background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 8px; padding: 1rem; text-align: center; }
.result h3 { margin: 0 0 1rem 0; color: var(--text-color); }

.download-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #16a34a; /* Green */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.download-button:hover {
    background-color: #15803d;
}


.video-preview {
    margin-bottom: 1rem;
}

/* Swap progress (loading) */
.swap-progress {
    margin-top: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
}
.swap-progress .progress-stage {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}
.progress-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(79, 70, 229, 0.2);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.progress-pct {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 3ch;
    font-size: 0.95rem;
}
.progress-hint {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
}

.features { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin: 1.25rem 0; }
.feature { border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem; }
.feature h3 { margin: 0 0 .25rem 0; font-size: 1rem; }
.feature p { margin: 0; color: var(--subtle-text); }

.callout { border: 1px dashed #c7d2fe; background: #f5f7ff; padding: 1rem; border-radius: 12px; margin-top: 1rem; text-align: center; }
.callout p { margin: .25rem 0 1rem 0; color: var(--subtle-text); }
.cta-button { display: inline-block; background: #111827; color: #fff; text-decoration: none; padding: .7rem 1.1rem; border-radius: 10px; font-weight: 600; border: 0; cursor: pointer; }
.cta-button:hover { background: #0b1220; }
.cta-large { padding: 1.1rem 1.6rem; font-size: 1.15rem; }
.intro-cta { margin-top: 1rem; }

/* Animated CTA styling for intro */
.intro-cta .cta-button,
#start-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 8px 24px rgba(79,70,229,.25), 0 2px 8px rgba(79,70,229,.12);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    animation: pulseGlow 2.8s ease-in-out infinite;
}
.intro-cta .cta-button::after,
#start-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -150%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.28), transparent);
    transform: skewX(-20deg);
}
.intro-cta .cta-button:hover,
#start-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 12px 32px rgba(79,70,229,.32), 0 4px 12px rgba(79,70,229,.16);
    filter: brightness(1.02);
}
.intro-cta .cta-button:hover::after,
#start-btn:hover::after { left: 150%; transition: left .6s ease; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(79,70,229,.25), 0 2px 8px rgba(79,70,229,.12); transform: translateY(0); }
  50% { box-shadow: 0 14px 36px rgba(79,70,229,.35), 0 6px 16px rgba(79,70,229,.18); transform: translateY(-1px); }
}

/* Toasts */
.toast-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: .6rem .9rem; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; transform: translateY(-8px) scale(.98); transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0) scale(1); }

.guide-form { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.guide-form input[type="email"] { flex: 1 1 260px; max-width: 360px; padding: .7rem 1rem; border: 1px solid var(--border-color); border-radius: 10px; font-size: 1rem; }
.guide-success { margin-top: .75rem; }

.how { margin-top: 1rem; }
.steps { margin: .5rem 0 0 1.25rem; color: var(--subtle-text); }

/* Testimonials */
.testimonials { margin-top: 1rem; text-align: center; }
.testi-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.testimonial { border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem; background: #fff; }
.testimonial .stars { color: #f59e0b; font-size: 1rem; letter-spacing: .05em; margin-bottom: .35rem; }
.testimonial .quote { font-weight: 600; }
.testimonial .author { margin-top: .35rem; color: var(--subtle-text); font-size: .9rem; }
.testimonial .author .meta { font-weight: 500; }
@media (min-width: 720px) { .testi-grid { grid-template-columns: repeat(3, 1fr); } }

@media (min-width: 720px) {
    .features { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile topbar adjustments */
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; gap: .5rem; }
  .container { padding-top: 2rem; }
  .auth-compact .inline-form { flex-wrap: wrap; }
  .auth-compact .inline-form input { flex: 1 1 100%; }
  .auth-compact .btn, .btn-google { width: 100%; }
}

footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--subtle-text);
} 

.pricing {
    margin: 1rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}
.pricing-legend { text-align: center; font-weight: 700; margin: .35rem 0 .35rem 0; color: var(--text-color); }
.pricing-footnote { text-align: center; color: var(--muted); font-size: .875rem; margin-top: .35rem; }
.price-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    position: relative;
    background: #fff;
}
.price-card.featured { border-color: #c7d2fe; box-shadow: 0 6px 18px rgba(79,70,229,0.08); }
.badge { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.price-heading { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .5rem; }
.price-title { font-weight: 700; }
.price-credits { color: var(--subtle-text); }
.price-amount { font-weight: 700; }
.price-note { color: var(--subtle-text); }
.price-note.highlight { color: #16a34a; font-weight: 600; }
.price-sub { color: var(--subtle-text); font-size: .85rem; }
.price-body { display: grid; gap: .15rem; }
.price-actions { margin-top: .35rem; }
.price-actions .cta-button { width: 100%; text-align: center; display: block; }

@media (min-width: 720px) {
    .pricing { grid-template-columns: repeat(3, 1fr); }
}

/* Intro two-column section */
.intro { margin: 1.25rem 0 1.5rem 0; }
.intro-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: center; }
.intro-left { padding-right: .5rem; text-align: center; }
.ig-badge { display: inline-flex; align-items: center; gap: .4rem; color: #7c3aed; background: #f5f3ff; border: 1px solid #e9d5ff; padding: .25rem .5rem; border-radius: 999px; margin-top: .35rem; font-weight: 600; font-size: .85rem; }
.intro-title { margin: .5rem 0 0 0; font-size: 1.25rem; font-weight: 700; }
.intro-text { color: var(--subtle-text); margin: .6rem 0; max-width: 60ch; }
.intro-points { margin: .6rem 0 0 1.25rem; color: var(--subtle-text); }
.intro-right { width: 100%; }
.intro-video { width: 100%; border-radius: 14px; border: 1px solid var(--border-color); display: block; box-shadow: 0 12px 24px rgba(0,0,0,.08); }
.intro .pill-row { justify-content: center; }
.intro .brand { justify-content: center; }
.intro .logo { width: 56px; height: 56px; margin-bottom: .35rem; }
@media (min-width: 880px) {
  .intro-grid { grid-template-columns: 1.25fr .95fr; gap: 1.75rem; }
}

/* Admin Panel Styles */
.admin-only.hidden { display: none !important; }
.admin-panel { margin-top: 2rem; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary-color); margin-bottom: 0.5rem; }
.stat-label { color: var(--subtle-text); font-size: 0.9rem; }
.admin-actions { margin-bottom: 2rem; padding: 1.5rem; background: #f8fafc; border-radius: 8px; }
.admin-actions h3 { margin: 0 0 1rem 0; }
.admin-form { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.admin-input { flex: 1; min-width: 200px; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 8px; }
.admin-tables { display: grid; gap: 2rem; }
.admin-table-section h3 { margin: 0 0 1rem 0; }
.table-container { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.admin-table th { background: #f8fafc; font-weight: 600; color: var(--text-color); }
.admin-table tr:hover { background: #f8fafc; }
.admin-table .actions { white-space: nowrap; }
.admin-table .btn { padding: 0.25rem 0.5rem; font-size: 0.8rem; margin: 0 0.25rem; }

/* Admin button in user menu */
.user-menu .admin-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.user-menu .admin-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
}