/* ╔══════════════════════════════════════════════════════╗
   ║  InstaSaver — Dark ViralTools Unified Theme         ║
   ╚══════════════════════════════════════════════════════╝ */

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

:root {
    --bg-deep:       #06040f;
    --bg-mid:        #0d0a1e;
    --bg-card:       rgba(255,255,255,0.04);
    --border:        rgba(255,255,255,0.08);
    --border-hover:  rgba(255,255,255,0.18);
    --text-primary:  #f0ecff;
    --text-muted:    rgba(240,236,255,0.55);
    --purple-500:    #8b5cf6;
    --purple-400:    #a78bfa;
    --pink-500:      #ec4899;
    --insta-gradient: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
    --accent-glow:   rgba(139,92,246,0.35);
    --radius:        20px;
    --transition:    all 0.3s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.py-80 { padding: 80px 0; }
.hide  { display: none !important; }

/* ── OLD HEADER: hidden (we use shared nav now) ── */
header#header { display: none; }

/* ══════════════════════════════════
   HERO
══════════════════════════════════ */
.hero {
    position: relative;
    padding: 100px 0 120px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    top: -200px; left: -100px;
    background: radial-gradient(circle, rgba(124,58,237,0.25), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    top: -100px; right: -80px;
    background: radial-gradient(circle, rgba(219,39,119,0.18), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    max-width: 800px;
    margin: 0 auto 20px;
    line-height: 1.15;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-primary), var(--purple-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* ── Search box ── */
.glass-effect {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.35);
}

.input-group {
    display: flex;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 50px;
    align-items: center;
    transition: var(--transition);
}
.input-group:focus-within {
    border-color: var(--purple-500);
    box-shadow: 0 0 0 4px rgba(139,92,246,0.12);
}

.input-group i {
    padding: 0 15px 0 20px;
    color: var(--text-muted);
}

.input-group input {
    flex: 1;
    border: none;
    padding: 12px 10px;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}
.input-group input::placeholder { color: var(--text-muted); }

.input-group button {
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124,58,237,0.55);
}

.loader {
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.example-url {
    margin-top: 15px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.error-msg {
    margin-top: 20px;
    color: #f87171;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    padding: 10px 20px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
}
.error-msg i { margin-right: 10px; }

/* ══════════════════════════════════
   RESULT CARD
══════════════════════════════════ */
.result-section {
    padding: 60px 0;
    position: relative;
    z-index: 10;
}

.result-card.glass-effect {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    display: flex;
    gap: 30px;
    align-items: center;
}

.preview-img {
    flex: 0 0 200px;
    height: 250px;
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.preview-img img { width: 100%; height: 100%; object-fit: cover; }

.video-info { flex: 1; }
.video-info h3 { margin-bottom: 20px; font-size: 1.3rem; font-weight: 700; }

.download-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dl-btn {
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
}

.video-dl {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}
.video-dl:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,185,129,0.45); }

.audio-dl {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.audio-dl:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,0.45); }

.copy-btn {
    margin-top: 15px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    transition: var(--transition);
}
.copy-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* ══════════════════════════════════
   SECTION TITLES
══════════════════════════════════ */
.section-title {
    text-align: center;
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 50px;
    color: var(--text-primary);
}

/* ══════════════════════════════════
   HOW IT WORKS
══════════════════════════════════ */
.how-it-works {
    background: var(--bg-mid);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.step-card {
    text-align: center;
    padding: 36px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    transition: var(--transition);
}
.step-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.step-num {
    position: absolute;
    top: 16px; right: 20px;
    font-size: 2.8rem;
    font-weight: 900;
    color: rgba(139,92,246,0.08);
    line-height: 1;
}

.step-card i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: block;
    color: var(--purple-400);
}

.step-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 700;
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ══════════════════════════════════
   FEATURES
══════════════════════════════════ */
.features {
    background: var(--bg-deep) !important;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.feature-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 28px;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
}
.feature-item:hover {
    border-color: rgba(139,92,246,0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(124,58,237,0.12);
}

.feature-item i {
    font-size: 1.8rem;
    color: var(--purple-400);
    margin-bottom: 18px;
    display: block;
}

.feature-item h4 {
    margin-bottom: 10px;
    font-size: 1.05rem;
    font-weight: 700;
}

.feature-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ══════════════════════════════════
   FAQ
══════════════════════════════════ */
.faq {
    background: var(--bg-mid);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.faq-question {
    padding: 18px 22px;
    background: var(--bg-card);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
    font-size: 0.95rem;
}
.faq-question:hover { background: rgba(255,255,255,0.06); }
.faq-question i { transition: transform 0.3s; font-size: 0.8rem; color: var(--text-muted); }

.faq-answer {
    padding: 0 22px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    font-size: 0.9rem;
}

.faq-item.active .faq-answer {
    padding: 18px 22px;
    max-height: 200px;
    border-top: 1px solid var(--border);
}
.faq-item.active .faq-question i { transform: rotate(180deg); }

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
footer {
    background: var(--bg-mid);
    color: var(--text-muted);
    padding: 60px 0 30px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.footer-logo i { margin-right: 8px; color: var(--purple-400); }

.footer-content p {
    margin-bottom: 22px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    margin-top: 24px;
    font-size: 0.82rem;
}

.disclaimer { font-size: 0.75rem; margin-top: 8px; opacity: 0.6; }

.contact a {
    color: var(--purple-400);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 12px;
    display: inline-block;
}
.contact a:hover { color: var(--pink-500); }

/* ── Animations ── */
.fade-in      { animation: fadeIn 0.8s ease-out; }
.fade-in-delay { animation: fadeIn 0.8s ease-out 0.3s both; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsiveness ── */
@media (max-width: 768px) {
    .hero { padding: 60px 0 80px; }
    .input-group {
        flex-direction: column;
        border-radius: 16px;
        padding: 15px;
    }
    .input-group input { width: 100%; text-align: center; margin: 10px 0; }
    .input-group button { width: 100%; }
    .result-card.glass-effect { flex-direction: column; }
    .preview-img { width: 100%; flex: none; }
}
