:root {
    --bg: #09090b;
    --foreground: #fafafa;
    --muted: #71717a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --card: #09090b;
    --card-foreground: #fafafa;
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --accent: #27272a;
    --accent-foreground: #fafafa;
    --radius: 8px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background-color: var(--bg);
    color: var(--foreground);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(circle at 50% -20%, #1e1e2e, transparent 50%),
        linear-gradient(to bottom, #09090b, #09090b);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 5rem;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--foreground);
    letter-spacing: -0.025em;
}

.logo svg {
    color: var(--primary);
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.headline {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
}

.headline span {
    color: var(--muted-foreground);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Platform Support Pills */
.platform-support {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.platform-pill {
    background: #111113;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.platform-pill i {
    font-size: 0.9rem;
}

.platform-pill:hover {
    border-color: var(--muted);
    color: var(--foreground);
}

/* Tool Card */
.main-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    background: #111113;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Results Section */
.media-preview {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    animation: fadeIn 0.4s ease-out;
}

.preview-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.thumbnail-container {
    width: 280px;
    aspect-ratio: 16/9;
    background: var(--secondary);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.input-icon {
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    color: var(--muted);
}

#urlInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--foreground);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

#urlInput::placeholder {
    color: var(--muted);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Loading */
.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
}

.loader {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.youtube {
    background: #ff0000;
}

.badge.instagram {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
}

.badge.facebook {
    background: #1877f2;
    color: #ffffff;
    border: none;
}

.media-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.uploader {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

.stats-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-foreground);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-item i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* Format List */
.format-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.format-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: #111113;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.format-card:hover {
    background: var(--secondary);
}

.format-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ext-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    background: var(--secondary);
    border-radius: 4px;
    color: var(--muted-foreground);
}

.quality-text {
    font-weight: 500;
    font-size: 0.95rem;
}

.audio-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.audio-badge.mute {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.audio-badge.audio-only {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.size-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* How it works */
.how-it-works {
    margin-top: 6rem;
    width: 100%;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--foreground);
    letter-spacing: -0.02em;
}

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

.step-card {
    background: #111113;
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.step-num {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
    opacity: 0.1;
    position: absolute;
    top: 10px;
    right: 20px;
}

.step-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--foreground);
}

.step-card p {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

/* Footer */
.disclaimer {
    margin-top: 4rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.disclaimer p {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Toasts */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
}

.toast {
    background: var(--foreground);
    color: var(--bg);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    font-size: 1.1rem;
    padding: 0 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Trust Footer */
.trust-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-foreground);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.trust-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: var(--foreground);
}

.trust-badge i {
    color: var(--primary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.pulsing {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Ad Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(24, 24, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: scale-up 0.3s ease-out forwards;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

.ad-container {
    width: 100%;
    min-height: 250px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.countdown-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.countdown-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

@keyframes scale-up {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    max-width: 400px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
    background: rgba(24, 24, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    animation: slide-up 0.4s ease-out forwards;
}

.cookie-banner p {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    line-height: 1.5;
    margin: 0;
}

@keyframes slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Utils */
.hidden { display: none !important; }

/* Mobile Responsiveness - Perfected */
@media (max-width: 900px) {
    .headline { font-size: 3rem; }
    .container { padding: 0 1rem 3rem; }
}

@media (max-width: 768px) {
    .navbar { margin-bottom: 3rem; }
    .nav-actions { display: none; } /* Simplify mobile nav */
    
    .headline { 
        font-size: 2.5rem; 
        margin-bottom: 1rem;
    }
    
    .subtitle { 
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .main-card { padding: 1.5rem; }
    
    .input-wrapper {
        flex-direction: column;
        padding: 0.75rem;
        gap: 1rem;
    }
    
    .input-icon { display: none; }
    
    .btn-primary { width: 100%; justify-content: center; }

    .preview-header { flex-direction: column; gap: 1rem; }
    .thumbnail-container { width: 100%; }
    
    .media-info h2 { font-size: 1.1rem; }
    
    .format-card {
        padding: 0.75rem 1rem;
    }
    
    .quality-text { font-size: 0.85rem; }
    .size-text { font-size: 0.8rem; }

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

@media (max-width: 480px) {
    .headline { font-size: 2rem; }
    .platform-pill { font-size: 0.7rem; padding: 4px 10px; }
}

/* SEO Content Sections */
.seo-content-section {
    margin-top: 4rem;
    animation: fadeIn 0.8s ease-out;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04);
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: white;
}

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

/* FAQ Grid */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.faq-item {
    padding: 1.5rem;
    text-align: left;
}

.faq-item h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
    }
}

/* Guide Section */
.how-it-works {
    margin-top: 6rem;
    padding-bottom: 2rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step-card {
    background: var(--card);
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.2);
}

.step-num {
    position: absolute;
    top: -1rem;
    left: 2rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.step-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.step-card p {
    color: var(--muted-foreground);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Enhanced Footer */
.main-footer {
    margin-top: 8rem;
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border);
    background: rgba(9, 9, 11, 0.5);
    backdrop-filter: blur(10px);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-info .logo {
    margin-bottom: 1rem;
}

.footer-info p {
    color: var(--muted-foreground);
    max-width: 300px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.link-col h5 {
    color: var(--foreground);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.link-col a {
    display: block;
    color: var(--muted-foreground);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.link-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}
