:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --card-glass: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --danger: #ef4444;
    --success: #10b981;
    --border: #334155;
    --border-light: rgba(255, 255, 255, 0.1);
    
    --bsky: #0085ff;
    --tumblr: #36465d;
    --pinterest: #e60023;
    --reddit: #ff4500;
    --twitter: #000000; /* X color */
}

body.light-mode {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --card-glass: rgba(255, 255, 255, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --border-light: rgba(0, 0, 0, 0.05);
    --accent-glow: rgba(59, 130, 246, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05) 0%, transparent 25%);
    background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.sticky-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
body.light-mode .sticky-header { background: rgba(255, 255, 255, 0.8); }

.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { 
    font-size: 1.25rem; 
    font-weight: 800; 
    color: var(--text-primary); 
    display: flex; 
    align-items: center; 
    gap: 0.5rem;
}
.nav-links { display: flex; gap: 1.5rem; list-style: none; align-items: center; font-size: 0.95rem; font-weight: 500; }
.nav-links a { color: var(--text-secondary); }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* Hamburger & Mobile */
.hamburger-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; padding: 0.5rem; }
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 99;
}
.mobile-menu.open { display: block; animation: slideDown 0.2s ease-out; }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 1rem; }

/* Buttons */
.theme-toggle-btn, .install-pwa-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 99px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.2s;
}
.theme-toggle-btn:hover, .install-pwa-btn:hover { background: var(--border-light); border-color: var(--text-secondary); }
.install-pwa-btn { width: auto; padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600; display: none; gap: 0.5rem; }

/* Hero */
.hero-section { padding: 5rem 0 3rem; text-align: center; }
.hero-section h1 { 
    font-size: 3rem; 
    margin-bottom: 1rem; 
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.subtitle { color: var(--text-secondary); margin-bottom: 2.5rem; font-size: 1.1rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Downloader Card */
.downloader-card {
    background: var(--card-glass);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.input-group {
    display: flex;
    position: relative;
    width: 100%;
    background: var(--bg-color);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="text"] {
    flex: 1;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    min-width: 0;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 1rem;
    transition: color 0.2s;
}
.icon-btn:hover { color: var(--text-primary); }

.primary-btn {
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    font-size: 1rem;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 15px -3px var(--accent-glow); }
.primary-btn:active { transform: translateY(0); }

@media (min-width: 640px) {
    .downloader-card { flex-direction: row; padding: 0.5rem; gap: 0.5rem; background: var(--card-bg); border: 1px solid var(--border); }
    .input-group { border: none; background: transparent; }
    .input-group:focus-within { box-shadow: none; }
    input[type="text"] { background: var(--bg-color); border: 1px solid var(--border); border-radius: 0.5rem; }
    input[type="text"]:focus { border-color: var(--accent); }
    .primary-btn { width: auto; }
}

/* Platform Tags */
.supported-platforms { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.platform-tag {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    transition: all 0.2s;
}
.platform-tag:hover { transform: translateY(-2px); border-color: currentColor; }
.platform-tag.bsky:hover { color: var(--bsky); }
.platform-tag.tumblr:hover { color: #fff; background: var(--tumblr); border-color: var(--tumblr); }
.platform-tag.pinterest:hover { color: var(--pinterest); }
.platform-tag.reddit:hover { color: var(--reddit); }
.platform-tag.twitter:hover { color: var(--text-primary); border-color: var(--text-primary); }

/* Results Grid */
.results-header h2 { font-size: 1.5rem; font-weight: 700; }
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.media-card {
    background: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.media-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); border-color: var(--accent); }

.media-preview { width: 100%; height: 220px; object-fit: cover; background: #000; display: block; }
.media-info { padding: 1.25rem; }
.media-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}
.download-item-btn { width: 100%; padding: 0.6rem; font-size: 0.9rem; }

/* Content / SEO Sections */
.seo-content { 
    max-width: 800px; 
    margin: 4rem auto; 
    line-height: 1.8; 
}
.seo-content h2 { font-size: 1.8rem; margin-bottom: 1rem; margin-top: 2.5rem; color: var(--text-primary); }
.seo-content h3 { font-size: 1.3rem; margin-bottom: 0.75rem; margin-top: 1.5rem; color: var(--text-primary); }
.seo-content p, .seo-content li { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: 1rem; }
.seo-content ul, .seo-content ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; }
.feature-card {
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    transition: transform 0.2s;
}
.feature-card:hover { border-color: var(--accent); }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; }
.feature-card p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.5; }

/* Footer */
footer { margin-top: auto; background: var(--bg-color); border-top: 1px solid var(--border); padding: 4rem 0 2rem; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; justify-content: center; }
.footer-links a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }
.disclaimer { text-align: center; font-size: 0.85rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; opacity: 0.7; }

/* Loader */
.loader { text-align: center; padding: 2rem; }
.spinner {
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--accent);
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

/* Utilities */
.hidden { display: none !important; }
.error-message { 
    color: var(--danger); 
    background: rgba(239, 68, 68, 0.1); 
    padding: 1rem; 
    border-radius: 0.5rem; 
    margin-bottom: 1rem; 
    font-size: 0.9rem; 
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
}
.secondary-btn:hover { border-color: var(--text-primary); color: var(--text-primary); }

/* Download Timer Overlay */
.timer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.timer-modal {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 90%;
    width: 340px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-modal h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.timer-modal p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.timer-modal #countdown {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.2;
    display: block;
    margin: 1rem 0;
    font-variant-numeric: tabular-nums;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { to { opacity: 1; } }

@media (max-width: 768px) {
    .hero-section h1 { font-size: 2.2rem; }
    .nav-links { display: none; }
    .hamburger-btn { display: block; }
}