:root {
    --bg: #fff;
    --text: #333;
    --card-bg: #fff;
    --border: 1px solid #e0e0e0;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --accent: #333; 
    --radius: 16px;
    --input-bg: #fff;
}
[data-theme="dark"] {
    --bg: #111;
    --text: #eee;
    --card-bg: #1e1e1e;
    --border: 1px solid #333;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --accent: #fff;
    --input-bg: #252525;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }
body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); color: var(--text); height: 100vh; overflow: hidden; 
    transition: background 0.3s, color 0.3s;
}

.app-layout { display: flex; height: 100%; width: 100%; }

.sidebar {
    width: 240px; border-right: var(--border); padding: 30px 20px;
    display: flex; flex-direction: column; background: var(--bg); z-index: 10;
}
.logo { font-size: 1.2rem; font-weight: 800; margin-bottom: 50px; display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: 1px; }
.nav-links { display: flex; flex-direction: column; gap: 8px; }
.nav-btn {
    text-align: left; padding: 12px 15px; background: transparent; border: none; border-radius: 12px;
    cursor: pointer; font-family: inherit; font-weight: 600; color: #888; transition: 0.2s; display: flex; gap: 12px; align-items: center;
}
.nav-btn:hover, .nav-btn.active { background: var(--card-bg); color: var(--text); box-shadow: var(--shadow); }

.main-content { flex: 1; overflow-y: auto; padding: 20px; position: relative; }

.tab-section { display: none; max-width: 700px; margin: 0 auto; padding-bottom: 100px; animation: fadeIn 0.3s ease; }
.tab-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.center-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; gap: 20px; }
.top-badge { 
    background: var(--card-bg); padding: 6px 16px; border-radius: 30px; font-weight: 600; font-size: 0.85rem; 
    box-shadow: var(--shadow); border: var(--border); color: #888;
}
.cat-wrapper img { width: 140px; height: auto; display: block; }

.supported-services {
    display: flex; gap: 15px; align-items: center; flex-wrap: wrap; justify-content: center;
    color: #888; font-size: 1.2rem; margin-bottom: 10px; opacity: 0.7;
}
.service-text { font-size: 0.8rem; font-weight: bold; border: 1px solid #ccc; padding: 2px 6px; border-radius: 4px; }

.input-area { width: 100%; max-width: 580px; position: relative; }
.input-wrapper {
    display: flex; align-items: center; border-radius: 16px; padding: 8px; 
    background: var(--input-bg); box-shadow: var(--shadow); border: var(--border); transition: 0.2s;
}
.input-wrapper:focus-within { transform: scale(1.02); border-color: #888; }
.input-wrapper input { 
    border: none; flex: 1; padding: 12px 15px; font-size: 1rem; background: transparent; color: var(--text); font-weight: 500;
}
.submit-btn {
    background: var(--accent); color: var(--bg); border: none; width: 45px; height: 45px; border-radius: 12px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: 0.2s;
}
.submit-btn:hover { opacity: 0.9; }

#result-area { width: 100%; margin-top: 20px; }
.result-header { text-align: center; margin-bottom: 20px; }

.batch-btn-group {
    display: flex; gap: 10px; justify-content: center; margin-top: 10px; flex-wrap: wrap;
}
.batch-btn {
    border: none; padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: 0.85rem; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: 0.2s; color: #fff;
}
.batch-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.batch-btn.vid { background: #ff9f43; }
.batch-btn.img { background: #54a0ff; }
.batch-btn.aud { background: #ff6b6b; }

.scroll-list { 
    max-height: 450px; overflow-y: auto; padding-right: 5px; scrollbar-width: thin; 
}
.media-card {
    display: flex; align-items: center; gap: 15px; background: var(--card-bg); padding: 12px; 
    border-radius: 16px; margin-bottom: 12px; border: var(--border); transition: 0.2s;
}
.preview-box { width: 80px; height: 60px; border-radius: 8px; overflow: hidden; background: #000; flex-shrink: 0; }
.preview-box img, .preview-box video { width: 100%; height: 100%; object-fit: cover; }
.dl-btn {
    background: var(--card-bg); border: var(--border); padding: 8px 15px; border-radius: 8px; 
    cursor: pointer; color: var(--text); font-weight: 600; text-decoration: none; font-size: 0.9rem;
}
.neo-card, .api-card { background: var(--card-bg); border: var(--border); padding: 25px; margin-bottom: 20px; border-radius: var(--radius); }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed #ccc; }
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(24px); }

.donate-flex { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.history-list { list-style: none; max-height: 250px; overflow-y: auto; margin-top: 15px; }
.history-list li { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 0.9rem; display: flex; justify-content: space-between; }
.api-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }
.bottom-nav { display: none; }
@media (max-width: 768px) {
    .sidebar { display: none; }
    .bottom-nav {
        display: block; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
        width: 90%; max-width: 400px; background: var(--card-bg); border: var(--border);
        border-radius: 30px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); padding: 10px 20px; z-index: 100;
    }
    .nav-scroll-wrapper { display: flex; justify-content: space-between; }
    .b-nav-item {
        background: none; border: none; color: #aaa; font-size: 1.4rem; cursor: pointer; padding: 10px; border-radius: 50%; transition: 0.2s;
    }
    .b-nav-item.active { color: var(--bg); background: var(--accent); transform: translateY(-5px); }
    .main-content { padding-bottom: 100px; }
}