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

:root {
    --ig-pink: #E1306C;
    --ig-purple: #833AB4;
    --ig-red: #FD1D1D;
    --ig-orange: #F77737;
    --ig-yellow: #FCAF45;
    --ig-gradient: linear-gradient(135deg, #E1306C 0%, #833AB4 50%, #FD1D1D 100%);
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input {
    font-family: inherit;
    outline: none;
    border: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--white);
    transition: opacity 0.2s;
}

.header.scrolled .logo {
    color: var(--gray-900);
}

.logo:hover {
    opacity: 0.85;
}

.logo-icon {
    color: currentColor;
}

.logo-dot {
    opacity: 0.6;
    font-weight: 500;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s;
}

.header.scrolled .nav-link {
    color: var(--gray-600);
}

.nav-link:hover {
    color: var(--white);
}

.header.scrolled .nav-link:hover {
    color: var(--ig-pink);
}

/* ========== HERO ========== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 16px 60px;
    background: linear-gradient(135deg, #833AB4 0%, #E1306C 50%, #FD1D1D 100%);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--ig-purple);
    top: -10%;
    right: -5%;
    animation: float1 15s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--ig-yellow);
    bottom: -5%;
    left: -5%;
    animation: float2 20s ease-in-out infinite;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--ig-orange);
    top: 40%;
    left: 50%;
    animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 40px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -30px); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -40px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 680px;
    width: 100%;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    display: block;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== DOWNLOAD FORM ========== */
.download-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 4px;
    transition: box-shadow 0.3s;
}

.input-wrapper:focus-within {
    box-shadow: var(--shadow-xl), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.input-icon {
    padding: 0 12px 0 16px;
    color: var(--gray-400);
    flex-shrink: 0;
    display: flex;
}

.url-input {
    flex: 1;
    padding: 14px 8px;
    font-size: 1rem;
    color: var(--gray-800);
    background: transparent;
    min-width: 0;
}

.url-input::placeholder {
    color: var(--gray-400);
}

.paste-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-right: 4px;
}

.paste-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--white);
    color: var(--ig-pink);
    font-size: 1.0625rem;
    font-weight: 700;
    border-radius: var(--radius);
    transition: all 0.3s;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-xl);
    background: var(--gray-50);
}

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

.download-btn.loading {
    pointer-events: none;
    opacity: 0.9;
}

.download-btn.loading .btn-text,
.download-btn.loading .btn-icon {
    opacity: 0;
}

.btn-spinner {
    display: none;
    position: absolute;
    animation: spin 1s linear infinite;
}

.download-btn.loading .btn-spinner {
    display: block;
}

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

.supported-types {
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
}

.supported-types strong {
    color: rgba(255, 255, 255, 0.9);
}

/* ========== STATUS / RESULT ========== */
.status-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding-top: 20px;
}

.status-message {
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideUp 0.3s ease;
}

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

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-loading {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ========== RESULT CARD ========== */
.result-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.result-header {
    display: flex;
    gap: 16px;
    padding: 20px;
}

.result-thumb {
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #E1306C, #833AB4);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.result-type {
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

.result-downloads {
    padding: 0 20px 20px;
}

.download-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: background 0.2s;
}

.download-option:hover {
    background: var(--gray-100);
}

.download-option:last-child {
    margin-bottom: 0;
}

.download-option-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-option-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 8px;
    color: var(--ig-pink);
    box-shadow: var(--shadow-sm);
}

.download-option-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.download-option-quality {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
}

.download-option-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--ig-gradient);
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.download-option-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ========== PROGRESS ========== */
.progress-container {
    padding: 20px;
}

.progress-bar-wrapper {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--ig-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ========== HOW IT WORKS ========== */
.how-it-works {
    padding: 80px 0;
    background: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    text-align: center;
    font-size: 1.0625rem;
    color: var(--gray-500);
    margin-bottom: 3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
}

.step-number {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ig-gradient);
    color: var(--white);
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 50%;
    margin-bottom: 1.25rem;
}

.step-icon {
    color: var(--ig-pink);
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.9375rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ========== FEATURES ========== */
.features {
    padding: 80px 0;
    background: var(--gray-50);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(225,48,108,0.1), rgba(131,58,180,0.1));
    border-radius: var(--radius);
    color: var(--ig-pink);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ========== ABOUT TOOL ========== */
.about-tool {
    padding: 80px 0;
    background: var(--gray-50);
}

.about-content {
    max-width: 720px;
    margin: 0 auto;
}

.about-content p {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ========== FAQ ========== */
.faq {
    padding: 80px 0;
    background: var(--white);
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--gray-200);
}

.faq-item summary {
    padding: 1.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--gray-400);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-item p {
    padding: 0 0 1.25rem;
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.7;
}

/* ========== AD SLOTS ========== */
.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto;
    text-align: center;
}
.ad-banner {
    padding: 16px 0;
    min-height: 90px;
}
.ad-in-article {
    padding: 24px 0;
    margin: 24px 0;
}
.ad-feed-item {
    padding: 16px 0;
    margin: 16px 0;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.footer-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 320px;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--gray-400);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-disclaimer {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.footer-disclaimer p {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.7;
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-success {
    background: var(--success);
}

.toast.toast-error {
    background: var(--error);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 100px 16px 50px;
    }

    .hero-title {
        font-size: 1.875rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .nav {
        display: none;
    }

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

    .features-grid {
        grid-template-columns: 1fr;
    }

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

    .paste-btn span {
        display: none;
    }

    .download-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .result-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .result-thumb {
        width: 100%;
        max-width: 280px;
        height: 160px;
    }

    .result-meta {
        justify-content: center;
    }

    .download-option {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .footer-desc {
        max-width: none;
    }

    .footer-links {
        justify-content: center;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.625rem;
    }

    .download-form {
        gap: 10px;
    }

    .url-input {
        padding: 12px 6px;
        font-size: 0.9375rem;
    }
}
