:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --neon-color: #00ffcc;
    --neon-glow: rgba(0, 255, 204, 0.5);
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(30, 30, 35, 0.7);
    --hover-bg: rgba(40, 40, 50, 0.8);
}

[data-theme="light"] {
    --bg-color: #f0f2f5;
    --text-color: #1a1a2e;
    --neon-color: #0088cc;
    --neon-glow: rgba(0, 136, 204, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.85);
    --hover-bg: rgba(240, 240, 245, 0.9);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

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

#bg-canvas {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    opacity: 0.6;
}
[data-theme="light"] #bg-canvas { opacity: 0.2; }

.hidden { display: none !important; }
.neon-text { color: var(--neon-color); text-shadow: 0 0 8px var(--neon-glow); }
.highlight { font-weight: 800; color: var(--neon-color); }

#intro-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 1s ease-out;
}
.terminal {
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem; color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    max-width: 80%;
}
.terminal .user { color: #00ffcc; }
.terminal .path { color: #ff00ff; }
.cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

#main-ui {
    display: flex; flex-direction: column; min-height: 100vh;
    animation: fadeIn 1s ease-in;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.glass-nav {
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    background: var(--glass-bg); border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 5%; box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}
.logo { font-size: 1.5rem; font-weight: 800; font-family: 'Fira Code', monospace; display: flex; align-items: center; gap: 8px;}
.nav-btn-group { display: flex; gap: 1rem; align-items: center; }

.icon-btn {
    background: transparent; border: 1px solid var(--glass-border);
    color: var(--text-color); font-size: 1.2rem;
    cursor: pointer; padding: 8px 12px; border-radius: 8px;
    transition: 0.3s;
}
.icon-btn:hover { background: var(--card-bg); transform: translateY(-2px); }

.glow-button, .cyber-button {
    background: transparent; border: 1px solid var(--neon-color);
    color: var(--neon-color); padding: 10px 20px;
    border-radius: 8px; font-weight: 600; cursor: pointer;
    transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0,255,204,0.1) inset;
    display: inline-block;
}
.glow-button:hover, .cyber-button:hover {
    background: var(--neon-color); color: var(--bg-color);
    box-shadow: 0 0 20px var(--neon-glow);
}
.cyber-button { border-radius: 4px; padding: 15px 30px; font-size: 1.1rem; }

.hero {
    text-align: center; padding: 5rem 2rem;
    display: flex; flex-direction: column; align-items: center;
}
.hero-content h1 {
    font-size: 3rem; font-weight: 800; margin-bottom: 1rem;
    letter-spacing: 2px;
}
.hero-content p {
    font-size: 1.2rem; color: #a0a0a0; max-width: 600px;
    margin: 0 auto 2rem auto; line-height: 1.6;
}
[data-theme="light"] .hero-content p { color: #555; }
.hero-stats {
    display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
}
.stat {
    background: var(--card-bg); padding: 10px 20px;
    border-radius: 30px; border: 1px solid var(--glass-border);
    font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
    backdrop-filter: blur(5px);
}

.subscriber-count {
    margin-top: 15px; font-size: 1.1rem; color: var(--neon-color); font-weight: 600;
}

.search-container {
    margin-top: 25px; display: flex; justify-content: center; gap: 10px; width: 100%;
}
.search-container input {
    padding: 12px 20px; border-radius: 25px; border: 1px solid var(--glass-border);
    background: var(--card-bg); color: var(--text-color); font-size: 1rem;
    width: 350px; max-width: 100%; outline: none; transition: 0.3s;
}
.search-container input:focus {
    border-color: var(--neon-color); box-shadow: 0 0 10px rgba(0,255,204,0.2);
}
.search-container button {
    background: var(--neon-color); color: var(--bg-color); border: none;
    padding: 0 20px; border-radius: 25px; cursor: pointer; font-size: 1.1rem; transition: 0.3s;
}
.search-container button:hover {
    transform: scale(1.05); box-shadow: 0 0 15px var(--neon-glow);
}

.tg-poll {
    background: rgba(0,0,0,0.2); border-radius: 8px; padding: 15px;
    margin: 15px 0; border: 1px solid var(--glass-border);
}
[data-theme="light"] .tg-poll { background: rgba(0,0,0,0.03); }
.tg-poll-question { font-weight: bold; margin-bottom: 12px; font-size: 1.05rem; }
.tg-poll-option {
    display: flex; align-items: center; margin-bottom: 8px; position: relative;
    padding: 8px 10px; border-radius: 6px; background: rgba(255,255,255,0.05); overflow: hidden;
}
[data-theme="light"] .tg-poll-option { background: rgba(0,0,0,0.05); }
.tg-poll-option-percent {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--neon-glow); z-index: 1; border-radius: 6px;
}
.tg-poll-option-text { position: relative; z-index: 2; flex: 1; }
.tg-poll-option-value { position: relative; z-index: 2; font-weight: 600; margin-left: 10px; }

.tg-document {
    display: flex; align-items: center; gap: 15px; margin: 15px 0;
    padding: 12px 15px; border-radius: 8px; background: rgba(0,255,204,0.1);
    border: 1px solid rgba(0,255,204,0.2); transition: 0.3s; color: var(--text-color);
    text-decoration: none; overflow: hidden;
}
.tg-document:hover { background: rgba(0,255,204,0.15); transform: translateY(-2px); }
.tg-doc-icon {
    font-size: 2rem; color: var(--neon-color);
    display: flex; align-items: center; justify-content: center;
}
.tg-doc-info { display: flex; flex-direction: column; overflow: hidden; }
.tg-doc-title { font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;}
.tg-doc-size { font-size: 0.85rem; color: #888; margin-top: 3px; }
[data-theme="light"] .tg-document { background: rgba(0,136,204,0.1); border-color: rgba(0,136,204,0.2); }
[data-theme="light"] .tg-doc-icon { color: var(--neon-color); }

.glitch { position: relative; color: var(--text-color); }
.glitch::before, .glitch::after {
    content: attr(data-text); position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; opacity: 0.8;
}
.glitch::before { left: 2px; text-shadow: -2px 0 red; clip: rect(24px, 550px, 90px, 0); animation: glitch-anim 3s infinite linear alternate-reverse; }
.glitch::after { left: -2px; text-shadow: -2px 0 blue; clip: rect(85px, 550px, 140px, 0); animation: glitch-anim 2.5s infinite linear alternate-reverse; }
@keyframes glitch-anim {
    0% { clip: rect(42px, 9999px, 44px, 0); }
    20% { clip: rect(12px, 9999px, 59px, 0); }
    40% { clip: rect(48px, 9999px, 29px, 0); }
    60% { clip: rect(42px, 9999px, 73px, 0); }
    80% { clip: rect(23px, 9999px, 86px, 0); }
    100% { clip: rect(85px, 9999px, 32px, 0); }
}

.feed-section {
    max-width: 1000px; margin: 0 auto; padding: 2rem; flex: 1;
}
.feed-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 1rem;
}
.feed-header h2 { font-size: 1.8rem; font-weight: 600; }
.refresh-btn {
    background: var(--card-bg); border: 1px solid var(--glass-border);
    color: var(--text-color); padding: 8px 15px; border-radius: 6px; cursor: pointer; transition: 0.3s;
}
.refresh-btn:hover { background: var(--hover-bg); transform: scale(1.05); }

.news-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.tg-card {
    background: var(--card-bg); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 20px; backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-color: rgba(0, 255, 204, 0.3);
}

.tg-card-header {
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px; font-family: 'Inter', sans-serif;
}
.tg-avatar {
    width: 45px; height: 45px; border-radius: 50%;
    background: linear-gradient(135deg, #0088cc, #00ffcc);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
}
.tg-channel-name { font-weight: bold; font-size: 1.1rem; }
.tg-channel-username { font-size: 0.85rem; color: var(--neon-color); }

.tg-card-content {
    font-size: 1rem; line-height: 1.5; color: var(--text-color);
    margin-bottom: 15px; word-wrap: break-word; white-space: pre-wrap;
}
.tg-card-content a { color: var(--neon-color); text-decoration: underline; }
.tg-card-content img, .tg-card-content video {
    max-width: 100%; border-radius: 8px; margin-top: 10px; border: 1px solid var(--glass-border);
}

.tg-card-footer {
    display: flex; justify-content: space-between; font-size: 0.85rem;
    color: #888; border-top: 1px solid var(--glass-border); padding-top: 12px;
}
[data-theme="light"] .tg-card-footer { color: #666; }

.action-container { text-align: center; margin-top: 3rem; }

.skeleton { position: relative; overflow: hidden; height: 120px;}
.skeleton::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: loading 1.5s infinite;
}
.skele-text { width: 100%; height: 15px; background: rgba(255,255,255,0.05); margin-bottom: 10px; border-radius: 4px; }
.skele-text.short { width: 60%; }
[data-theme="light"] .skeleton::before { background: linear-gradient(90deg, transparent, rgba(0,0,0,0.05), transparent); }
[data-theme="light"] .skele-text { background: rgba(0,0,0,0.05); }
@keyframes loading { 100% { left: 100%; } }

.info-msg { padding: 2rem; text-align: center; color: var(--neon-color); background: var(--card-bg); border-radius: 8px; font-weight: bold; }

.glass-footer {
    margin-top: auto; padding: 2rem 5%;
    background: var(--glass-bg); backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border); text-align: center;
}
.footer-content {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; margin-bottom: 1rem;
}
.creator-info p { font-size: 1.1rem; }
.social-links a { font-size: 1.5rem; margin: 0 10px; transition: 0.3s; color: var(--text-color); }
.social-links a:hover { color: var(--neon-color); transform: scale(1.1); }
.sub-footer { font-size: 0.85rem; color: #777; border-top: 1px solid var(--glass-border); padding-top: 1rem; }
[data-theme="light"] .sub-footer { color: #888; }

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2rem; }
    .hero { padding: 3rem 1rem; }
    .footer-content { flex-direction: column; gap: 1rem; }
}
