/* ============================================================
   VideoGrabber – style.css
   All visual rules, design tokens, animations, responsive
   ============================================================ */

/* ===== RESET & BOX MODEL ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== DESIGN TOKENS ===== */
:root {
    --purple:        #a855f7;
    --purple-dark:   #7c3aed;
    --green:         #22c55e;
    --green-dark:    #16a34a;
    --bg:            #0d0d14;
    --surface:       rgba(255,255,255,0.04);
    --surface2:      rgba(255,255,255,0.07);
    --border:        rgba(255,255,255,0.08);
    --border-purple: rgba(168,85,247,0.25);
    --text:          #f1f1f8;
    --text-muted:    #6b7280;
    --text-dim:      #9ca3af;
    --red:           #ef4444;
}

/* ===== BASE ===== */
html, body { min-height: 100vh; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,58,237,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(34,197,94,0.07) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 4rem;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.header h1 {
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
/* Logo Link and Brand Styling */
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    outline: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo-link:hover {
    transform: translateY(-2px) scale(1.02);
}
.logo-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Premium glowing background behind the logo icon */
.logo-icon-wrapper::after {
    content: '';
    position: absolute;
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, transparent 70%);
    filter: blur(8px);
    z-index: -1;
    transition: opacity 0.3s ease, background 0.3s ease;
    opacity: 0.8;
}
.logo-link:hover .logo-icon-wrapper::after {
    opacity: 1;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.55) 0%, transparent 75%);
}
.site-logo {
    height: 54px;
    width: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.35)) drop-shadow(0 2px 4px rgba(34, 197, 94, 0.25));
    transition: filter 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo-link:hover .site-logo {
    filter: drop-shadow(0 6px 18px rgba(124, 58, 237, 0.55)) drop-shadow(0 4px 8px rgba(34, 197, 94, 0.45));
    transform: rotate(3deg);
}
.site-logo-text {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2rem, 5.5vw, 2.6rem);
    font-weight: 800;
    background: linear-gradient(135deg, #c084fc, #a855f7, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.75px;
    transition: filter 0.3s ease;
}
.logo-link:hover .site-logo-text {
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.35));
}
.header p {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Platform name colours in the subtitle */
.header p span.videa     { color: #c084fc; font-weight: 600; }
.header p span.inda      { color: #4ade80; font-weight: 600; }
.header p span.youtube   { color: #ff4444; font-weight: 600; }
.header p span.tiktok    { color: #fe2c55; font-weight: 600; }
.header p span.facebook  { color: #4a9ff5; font-weight: 600; }
.header p span.instagram { color: #e1306c; font-weight: 600; }
.header p span.pinterest { color: #e60023; font-weight: 600; }
.header p span.xtwitter  { color: #e7e9ea; font-weight: 600; }

/* ===== PLATFORM CHIPS ===== */
.platform-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.chip-videa     { background: rgba(168,85,247,0.12); color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }
.chip-inda      { background: rgba(34,197,94,0.10);  color: #4ade80; border: 1px solid rgba(34,197,94,0.22); }
.chip-youtube   { background: rgba(255,0,0,0.10);    color: #ff4444; border: 1px solid rgba(255,0,0,0.25); }
.chip-tiktok    { background: rgba(254,44,85,0.12);  color: #fe2c55; border: 1px solid rgba(254,44,85,0.28); }
.chip-facebook  { background: rgba(24,119,242,0.12); color: #4a9ff5; border: 1px solid rgba(24,119,242,0.28); }
.chip-instagram {
    background: linear-gradient(135deg, rgba(240,148,51,0.10), rgba(225,48,108,0.12));
    color: #e1306c;
    border: 1px solid rgba(225,48,108,0.28);
}
.chip-pinterest { background: rgba(230,0,35,0.12); color: #e60023; border: 1px solid rgba(230,0,35,0.28); }
.chip-xtwitter  { background: rgba(231,233,234,0.08); color: #e7e9ea; border: 1px solid rgba(231,233,234,0.2); }

/* ===== MAIN LAYOUT ===== */
.main-container {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ===== CARD ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 40px -10px rgba(124,58,237,0.2);
}

/* ===== INPUT AREA ===== */
.input-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}
.input-wrap {
    flex: 1;
    position: relative;
}
.input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.url-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.75rem;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.url-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}
.url-input::placeholder { color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
    padding: 0.9rem 1.4rem;
    border: none;
    border-radius: 0.875rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--purple-dark), var(--purple));
    color: white;
    box-shadow: 0 4px 20px rgba(124,58,237,0.3);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    box-shadow: 0 4px 24px rgba(124,58,237,0.45);
}
.btn-green {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: white;
    box-shadow: 0 4px 16px rgba(34,197,94,0.25);
}
.btn-green:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803d, #16a34a);
}
.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ===== PREVIEW PANEL ===== */
#preview-panel { display: none; }

.preview-inner {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-purple);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.preview-thumb {
    width: 120px;
    height: 75px;
    object-fit: cover;
    border-radius: 0.625rem;
    background: #1a1a2e;
    flex-shrink: 0;
}
.preview-info { flex: 1; min-width: 0; }
.preview-title {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}
.preview-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.preview-meta span { display: flex; align-items: center; gap: 0.3rem; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-purple   { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }
.badge-green    { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-youtube  { background: rgba(255,0,0,0.12);    color: #ff4444; border: 1px solid rgba(255,0,0,0.28); }
.badge-tiktok   {
    background: linear-gradient(135deg, rgba(37,244,238,0.12), rgba(254,44,85,0.12));
    color: #fe2c55;
    border: 1px solid rgba(254,44,85,0.28);
}
.badge-facebook  { background: rgba(24,119,242,0.15); color: #4a9ff5; border: 1px solid rgba(24,119,242,0.3); }
.badge-instagram {
    background: linear-gradient(135deg, rgba(240,148,51,0.12), rgba(225,48,108,0.12));
    color: #e1306c;
    border: 1px solid rgba(225,48,108,0.28);
}
.badge-pinterest { background: rgba(230,0,35,0.15); color: #e60023; border: 1px solid rgba(230,0,35,0.3); }
.badge-audio    { background: rgba(251,146,60,0.15); color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }

/* ===== FORMAT TOGGLE ===== */
.format-toggle {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.65rem;
}
.fmt-btn {
    flex: 1;
    padding: 0.38rem 0.7rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.18s;
    white-space: nowrap;
}
.fmt-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.fmt-btn.active[data-fmt="mp4"] {
    background: rgba(168,85,247,0.15);
    border-color: rgba(168,85,247,0.45);
    color: #c084fc;
    box-shadow: 0 0 12px rgba(168,85,247,0.12);
}
.fmt-btn.active[data-fmt="mp3"] {
    background: rgba(251,146,60,0.15);
    border-color: rgba(251,146,60,0.45);
    color: #fb923c;
    box-shadow: 0 0 12px rgba(251,146,60,0.12);
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* ===== ERROR BOX ===== */
.error-box {
    display: none;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 0.875rem;
    padding: 0.9rem 1.1rem;
    color: #fca5a5;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.error-box.hidden { display: none !important; }

/* ===== DOWNLOAD QUEUE ===== */
.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.queue-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.queue-count {
    background: rgba(168,85,247,0.2);
    color: #c084fc;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

#download-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dl-item {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.875rem 1.1rem;
    display: flex;
    gap: 0.9rem;
    align-items: center;
    transition: border-color 0.25s;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dl-item.done    { border-color: rgba(34,197,94,0.3); }
.dl-item.error   { border-color: rgba(239,68,68,0.3); }
.dl-item.active  { border-color: rgba(168,85,247,0.3); }

/* Queue item thumbnails */
.dl-thumb {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.5rem;
    background: #1a1a2e;
    flex-shrink: 0;
}
.dl-thumb-placeholder {
    width: 72px;
    height: 48px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #1a1a2e, #0d0d14);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.dl-body { flex: 1; min-width: 0; }
.dl-title {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.35rem;
}

/* ===== PROGRESS BAR ===== */
.progress-wrap {
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}
.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--purple-dark), var(--purple), var(--green));
    background-size: 200% 100%;
    transition: width 0.4s ease;
}
.progress-bar.indeterminate {
    width: 40% !important;
    animation: indeterminate 1.4s ease infinite;
}
@keyframes indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ===== STATUS ROW ===== */
.dl-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.dl-status-text { display: flex; align-items: center; gap: 0.35rem; }
.dl-status-text.downloading { color: #c084fc; }
.dl-status-text.done        { color: #4ade80; }
.dl-status-text.error       { color: #f87171; }
.dl-status-text.queued      { color: var(--text-muted); }
.dl-status-text.processing  { color: #facc15; }

.dl-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ===== ICON BUTTONS ===== */
.icon-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
    text-decoration: none;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.icon-btn.green { border-color: rgba(34,197,94,0.4); color: #4ade80; }
.icon-btn.green:hover { background: rgba(34,197,94,0.15); }
.icon-btn.red   { border-color: rgba(239,68,68,0.3); color: #f87171; }
.icon-btn.red:hover { background: rgba(239,68,68,0.12); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.3;
    display: block;
}
.empty-state p { font-size: 0.875rem; }

/* ===== ANIMATIONS ===== */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}
.toast {
    background: rgba(20,20,35,0.95);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease;
    backdrop-filter: blur(12px);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.success i { color: #4ade80; }
.toast.error   { border-color: rgba(239,68,68,0.3); }
.toast.error   i { color: #f87171; }
.toast.info    { border-color: rgba(168,85,247,0.3); }
.toast.info    i { color: #c084fc; }

/* ===== RESPONSIVE ===== */
@media (max-width: 580px) {
    .input-row { flex-direction: column; }
    .preview-inner { flex-direction: column; align-items: flex-start; }
    .preview-actions { width: 100%; }
    .preview-actions .btn { flex: 1; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════
   SEO INFO SECTION
   ═══════════════════════════════════════════════════════════════ */
.seo-info-section,
.faq-section {
    width: 100%;
    max-width: 860px;
    margin-top: 0.5rem;
}

.seo-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.seo-section-lead {
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 1.1rem;
}

.seo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .seo-grid { grid-template-columns: 1fr; }
}

.seo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    padding: 1.25rem 1.35rem;
    backdrop-filter: blur(12px);
}

.seo-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seo-steps {
    list-style: none;
    counter-reset: steps;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.seo-steps li {
    counter-increment: steps;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.55;
}

.seo-steps li::before {
    content: counter(steps);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    min-width: 1.4rem;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: #c084fc;
    margin-top: 0.05rem;
}

.seo-steps li strong { color: var(--text); }

.seo-platform-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.seo-platform-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.seo-platform-list li i { width: 1rem; text-align: center; }
.seo-platform-list li strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   FAQ ACCORDION
   ═══════════════════════════════════════════════════════════════ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.faq-item[open] {
    border-color: var(--border-purple);
    box-shadow: 0 0 24px -8px rgba(168,85,247,0.15);
}

.faq-item summary { list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    gap: 1rem;
    user-select: none;
    transition: background 0.2s;
}

.faq-question:hover {
    background: var(--surface2);
}

.faq-question span {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.faq-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
    flex-shrink: 0;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: var(--purple);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    font-size: 0.845rem;
    color: var(--text-dim);
    line-height: 1.7;
    border-top: 1px solid var(--border);
    animation: faqOpen 0.25s ease;
}

.faq-answer strong { color: var(--text); }
.faq-answer em { color: var(--text-dim); font-style: italic; }

@keyframes faqOpen {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
