:root {
    --bg-color: #f9fafb;
    --text-color: #111827;
    --text-muted: #6b7280;
    --glass-bg: #ffffff;
    --glass-border: #e5e7eb;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --primary-color: #000000;
    --primary-hover: #1f2937;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --card-gradient: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 100%);
    --nav-gradient: linear-gradient(90deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
    --outline-btn-gradient: linear-gradient(135deg, rgba(0, 100, 224, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    --outline-btn-hover: linear-gradient(135deg, rgba(0, 100, 224, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    --meta-glow: 0 10px 30px rgba(0, 100, 224, 0.08), 0 0 0 1px rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #f3f5f7;
    --text-muted: #9ca3af;
    --glass-bg: #181818;
    --glass-border: #333638;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --primary-color: #ffffff;
    --primary-hover: #e5e7eb;
    --card-bg: #181818;
    --border-color: #333638;
    --card-gradient: linear-gradient(135deg, rgba(24,24,24,0.9) 0%, rgba(10,10,10,0.8) 100%);
    --nav-gradient: linear-gradient(90deg, rgba(24,24,24,0.9) 0%, rgba(10,10,10,0.8) 100%);
    --outline-btn-gradient: linear-gradient(135deg, rgba(0, 100, 224, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    --outline-btn-hover: linear-gradient(135deg, rgba(0, 100, 224, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    --meta-glow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Container */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Glass */
.glass { background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }

/* Navbar */
.navbar { position: sticky; top: 0; z-index: 100; padding: 15px 0; background: var(--nav-gradient); border-bottom: 1px solid var(--border-color); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav-content { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-color); font-weight: 700; font-size: 20px; }
.logo-icon-wrap { width: 36px; height: 36px; background: var(--primary-color); color: var(--bg-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 18px; flex-shrink: 0; }
.logo-text { display:flex; flex-direction:column; line-height: 1.1; }
.logo-text span.small { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.mobile-menu-btn { display: none; cursor: pointer; color: var(--text-color); background: none; border: none; font-size: 24px; padding: 5px; }

.nav-links { display: flex; align-items: center; gap: 20px; transition: 0.3s ease-in-out; }
.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 15px; transition: color 0.2s; }
.nav-link:hover { color: var(--text-color); }

.theme-toggle { background: none; border: none; cursor: pointer; color: var(--text-color); display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; transition: background 0.2s; }
.theme-toggle:hover { background: rgba(128,128,128,0.1); }
.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; }

/* Main Content */
.content { flex: 1; padding: 40px 0; width:100%; }
.hero { text-align: center; max-width: 800px; margin: 0 auto 40px; }
.hero h1 { font-size: clamp(28px, 5vw, 36px); font-weight: 800; line-height: 1.2; margin-bottom: 16px; color: var(--text-color); }
.hero p { font-size: clamp(14px, 3vw, 16px); color: var(--text-muted); margin-bottom: 30px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: none; font-size: 16px; }
.btn-primary { background: linear-gradient(135deg, #0064e0 0%, #8b5cf6 100%); color: #ffffff; box-shadow: 0 4px 15px rgba(0, 100, 224, 0.25); }
.btn-primary:hover { background: linear-gradient(135deg, #0056c2 0%, #7c3aed 100%); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 100, 224, 0.4); color: #ffffff; }
.btn-outline { background: var(--outline-btn-gradient); color: var(--text-color); border: 1px solid rgba(139, 92, 246, 0.3); backdrop-filter: blur(5px); }
.btn-outline:hover { background: var(--outline-btn-hover); transform: translateY(-2px); border-color: rgba(139, 92, 246, 0.6); }

.button-group { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Card */
.card { background: var(--card-gradient); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 16px; border: none; box-shadow: var(--meta-glow); padding: 30px; }

/* Code Block */
pre { background: #0f172a; color: #f8fafc; padding: 20px; border-radius: 12px; overflow-x: auto; font-family: monospace; font-size: 14px; line-height: 1.5; border: 1px solid #1e293b; max-width: 100%; }

/* Drag and Drop Zone */
.upload-zone { border: 2px dashed var(--border-color); border-radius: 16px; padding: 30px 20px; text-align: center; cursor: pointer; transition: all 0.3s; background: var(--glass-bg); display: block; }
.upload-zone:hover { background: rgba(128, 128, 128, 0.05); border-color: var(--primary-color); }
.upload-icon { width: 48px; height: 48px; fill: var(--primary-color); margin-bottom: 16px; }
.upload-text { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.upload-sub { color: var(--text-muted); font-size: 14px; }
#fileInput { display: none; }

/* Stats & Analyzer UI */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 30px; }
.stat-card { display: flex; align-items: center; gap: 15px; padding: 20px; border-radius: 16px; background: var(--card-gradient); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: none; box-shadow: var(--meta-glow); transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: linear-gradient(135deg, rgba(0, 100, 224, 0.1), rgba(139, 92, 246, 0.1)); color: #0064e0; }
[data-theme="dark"] .stat-icon { background: linear-gradient(135deg, rgba(0, 100, 224, 0.2), rgba(139, 92, 246, 0.2)); color: #38bdf8; }
.stat-icon svg { width: 24px; height: 24px; fill: currentColor; }
.stat-info { display: flex; flex-direction: column; gap: 4px; }
.stat-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text-color); line-height: 1; text-shadow: 0 2px 4px rgba(0,0,0,0.05); }
[data-theme="dark"] .stat-value { text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.pill-tabs-container { display: flex; gap: 10px; padding: 15px 20px; background: var(--card-gradient); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 40px; border: none; box-shadow: var(--meta-glow); margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pill-tabs-container::-webkit-scrollbar { display: none; }
.pill-tab { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 30px; font-size: 14px; font-weight: 600; color: var(--text-muted); background: transparent; border: none; cursor: pointer; transition: 0.3s; }
.pill-tab.active { background: linear-gradient(90deg, #0064e0, #8b5cf6); color: #fff; transform: scale(1.02); box-shadow: 0 4px 12px rgba(0, 100, 224, 0.3); }
.pill-tab .badge { background: rgba(128,128,128,0.2); color: var(--text-color); padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.pill-tab.active .badge { background: rgba(0,0,0,0.25); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

.header-card { background: var(--card-gradient); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: none; box-shadow: var(--meta-glow); border-radius: 16px; padding: 30px; margin-bottom: 20px; position:relative; }
.header-card h2 { font-size: clamp(16px, 4vw, 20px); margin-bottom: 10px; color: var(--text-color); }
.header-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; line-height: 1.5; max-width: 100%; }

.list-item { display: flex; align-items: center; gap: 15px; padding: 15px 20px; border-bottom: 1px solid var(--border-color); transition: background 0.2s; flex-wrap: wrap; }
.list-item:hover { background: rgba(128,128,128,0.05); }
.list-item:last-child { border-bottom: none; }
.list-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: bold; flex-shrink: 0; }
.list-username { color: var(--text-color); font-weight: 700; font-size: 15px; text-decoration: none; display: block; margin-bottom: 2px; }
.list-username:hover { text-decoration: underline; }
.list-name { color: var(--text-muted); font-size: 13px; }
.list-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.icon-btn { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-muted); cursor: pointer; transition: 0.2s; text-decoration: none; }
.icon-btn:hover { background: rgba(128,128,128,0.1); color: var(--text-color); }
.icon-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* Footer */
.footer { padding: 30px 0; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border-color); text-align: center; margin-top: auto; }

/* --- Mobile Responsiveness (The Missing Piece) --- */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    
    /* Navbar Mobile */
    .mobile-menu-btn { display: block; }
    .nav-links { 
        display: flex; flex-direction: column; 
        position: absolute; top: 100%; left: 0; width: 100%; 
        background: var(--glass-bg); padding: 0; 
        border-bottom: 1px solid var(--border-color); box-shadow: var(--glass-shadow); 
        overflow: hidden; max-height: 0; opacity: 0; visibility: hidden; 
        gap: 0;
    }
    .nav-links.active { max-height: 400px; opacity: 1; visibility: visible; padding: 15px 20px; gap: 15px; }
    .nav-link { width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
    .nav-link:last-child { border-bottom: none; }
    
    .logo-text span.small { display: none; } /* Hide 'Threads ile bağlantılı değildir' to save space */
    
    /* Hero & Buttons */
    .button-group { flex-direction: column; }
    .btn { width: 100%; }
    
    /* Upload & Cards */
    .card { padding: 20px 15px; }
    .upload-zone { padding: 20px 15px; }
    
    /* Stats Grid */
    .stats-grid { grid-template-columns: 1fr; gap: 12px; } /* Stack vertically! */
    .stat-card { padding: 15px 20px; gap: 12px; }
    .stat-title { font-size: 12px; }
    .stat-value { font-size: 20px; }
    
    /* Lists */
    .list-item { padding: 12px 15px; flex-direction: row; }
    .list-actions { width: 100%; justify-content: flex-end; margin-top: 10px; margin-left: 0; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }
    
    .header-card { padding: 20px; }
}

@media (max-width: 480px) {
    /* Very Small Screens */
    .pill-tabs-container { padding: 10px; }
    .pill-tab { padding: 8px 12px; font-size: 13px; }
}

/* Base Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.content > * { animation: fadeUp 0.5s ease-out forwards; }

/* Meta Video / Background effects */
.background-effects {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; overflow: hidden; z-index: -1; pointer-events: none;
    background: var(--bg-color);
}
.bg-video {
    position: absolute; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; transform: translateX(-50%) translateY(-50%); opacity: 1; object-fit: cover;
}
[data-theme="dark"] .bg-video { opacity: 0.8; }

.bg-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
[data-theme="dark"] .bg-overlay {
    background: rgba(10, 10, 10, 0.85);
}

.hero p {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
[data-theme="dark"] .hero p {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
