* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

/* ========== Dark theme (default) ========== */
body.dark-theme {
    background: #0b0e14;
    color: #e5e9f0;
}
body.dark-theme .sidebar,
body.dark-theme .main-content,
body.dark-theme .navbar,
body.dark-theme .stat-card,
body.dark-theme .library-item,
body.dark-theme .upload-area,
body.dark-theme .live-left,
body.dark-theme .live-right,
body.dark-theme .platform-section,
body.dark-theme .advanced-settings,
body.dark-theme .overlay-controls,
body.dark-theme .stream-status-panel,
body.dark-theme .history-table,
body.dark-theme .settings-group,
body.dark-theme .donation-card,
body.dark-theme .doc-card,
body.dark-theme .terms-card,
body.dark-theme .contact-info {
    background: #1a1e2a;
    border-color: #2a2e3a;
    color: #e5e9f0;
}
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
    background: #2a2e3a;
    border-color: #3a3e4a;
    color: #e5e9f0;
}
body.dark-theme .btn:not(.primary):not(.secondary) {
    background: #2a2e3a;
    color: #e5e9f0;
}
body.dark-theme .btn.primary { background: #ff0000; }
body.dark-theme .btn.secondary { background: #2a2e3a; border-color: #f44336; color: #f44336; }

/* ========== Light theme ========== */
body.light-theme {
    background: #f9f9f9;
    color: #030303;
}
body.light-theme .sidebar,
body.light-theme .main-content,
body.light-theme .navbar,
body.light-theme .stat-card,
body.light-theme .library-item,
body.light-theme .upload-area,
body.light-theme .live-left,
body.light-theme .live-right,
body.light-theme .platform-section,
body.light-theme .advanced-settings,
body.light-theme .overlay-controls,
body.light-theme .stream-status-panel,
body.light-theme .history-table,
body.light-theme .settings-group,
body.light-theme .donation-card,
body.light-theme .doc-card,
body.light-theme .terms-card,
body.light-theme .contact-info {
    background: #ffffff;
    border-color: #e5e5e5;
    color: #030303;
}
body.light-theme input,
body.light-theme textarea,
body.light-theme select {
    background: #ffffff;
    border-color: #e5e5e5;
    color: #030303;
}
body.light-theme .btn:not(.primary):not(.secondary) {
    background: #f0f0f0;
    color: #030303;
}

/* ========== Global styles ========== */
.app { display: flex; height: 100vh; }

/* Sidebar */
.sidebar {
    width: 240px;
    border-right: 1px solid;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}
.logo {
    display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 500;
    padding: 0 20px 20px; border-bottom: 1px solid;
}
.logo i { font-size: 1.8rem; color: #ff0000; }
.nav-menu { flex: 1; margin-top: 16px; }
.nav-item {
    display: flex; align-items: center; gap: 16px; padding: 10px 20px;
    text-decoration: none; transition: 0.2s; border-radius: 0 30px 30px 0;
}
.nav-item i { width: 24px; font-size: 1.2rem; }
.nav-item:hover, .nav-item.active { background: rgba(255,0,0,0.1); color: #ff0000; font-weight: 500; }
.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid; display: flex; flex-direction: column; align-items: center;
}
.animated-logo {
    width: 40px; height: 40px; border-radius: 50%; margin-bottom: 10px;
    animation: colorCycle 3s infinite;
}
@keyframes colorCycle {
    0% { background: #ff0000; box-shadow: 0 0 10px #ff0000; }
    25% { background: #00ff00; box-shadow: 0 0 10px #00ff00; }
    50% { background: #0000ff; box-shadow: 0 0 10px #0000ff; }
    75% { background: #ffff00; box-shadow: 0 0 10px #ffff00; }
    100% { background: #ff0000; box-shadow: 0 0 10px #ff0000; }
}
.user-info {
    display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 12px;
    background: rgba(255,255,255,0.05); border-radius: 20px; width: 100%;
}
.user-info i { font-size: 1.5rem; color: #ff0000; }
.user-info span { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.small { width: 100%; padding: 8px; }

/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.navbar {
    display: flex; justify-content: space-between; align-items: center; padding: 12px 24px;
    border-bottom: 1px solid;
}
.navbar-left h2 { font-weight: 500; font-size: 1.3rem; }
.navbar-right { display: flex; align-items: center; gap: 20px; }
.speed-meter {
    display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px;
}
.stream-status {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.online { background: #4caf50; }
.status-dot.offline { background: #f44336; }
.icon-btn { background: transparent; border: none; font-size: 1.3rem; cursor: pointer; }
.profile-icon { display: flex; align-items: center; gap: 8px; }
.profile-icon i { font-size: 2rem; }
.profile-icon span { font-size: 0.9rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toast */
.toast-notification {
    position: fixed; top: 70px; right: 20px; background: #ff0000; color: white;
    padding: 12px 20px; border-radius: 30px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-weight: 500; z-index: 1000; animation: slideIn 0.3s ease-out; display: none;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Content Views */
.content-view { display: none; padding: 24px; overflow-y: auto; flex: 1; }
.content-view.active { display: block; }

/* Dashboard Cards */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    border: 1px solid; border-radius: 8px; padding: 16px;
    display: flex; align-items: center; gap: 16px;
}
.stat-card i { font-size: 2rem; color: #ff0000; }
.stat-card h3 { font-size: 1.5rem; }
.stat-card p { opacity: 0.8; }

/* Video Library */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; }
.library-item {
    border: 1px solid; border-radius: 8px; overflow: hidden;
    transition: 0.2s; cursor: pointer; position: relative;
}
.library-item:hover { border-color: #ff0000; }
.library-item video { width: 100%; height: 100px; object-fit: cover; }
.library-item .info { padding: 12px; }
.library-item .info p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delete-video-btn {
    position: absolute; top: 5px; right: 5px; background: rgba(255,255,255,0.9); color: #f44336;
    border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 14px; opacity: 0; transition: opacity 0.2s;
}
.library-item:hover .delete-video-btn { opacity: 1; }
.delete-video-btn:hover { background: #f44336; color: white; }

/* Upload */
.upload-area {
    border: 2px dashed; border-radius: 8px; padding: 48px; text-align: center; cursor: pointer;
}
.upload-area i { font-size: 3rem; color: #ff0000; }
.browse-text { color: #ff0000; font-weight: 500; }
.progress-bar { height: 8px; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: #ff0000; transition: width 0.3s; }

/* Live Panel */
.live-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.live-left, .live-right {
    border: 1px solid; border-radius: 8px; padding: 20px;
}
.live-tabs {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid; padding-bottom: 8px;
}
.live-tab {
    background: transparent; border: none; padding: 8px 12px; cursor: pointer; font-weight: 500;
    border-radius: 20px; transition: 0.2s;
}
.live-tab:hover { background: rgba(255,0,0,0.1); }
.live-tab.active { background: #ff0000; color: #fff; }
.tab-content { display: none; margin-bottom: 20px; }
.tab-content.active { display: block; }
.platform-section {
    border: 1px solid; border-radius: 8px; padding: 16px; margin: 0;
}
.platform-section h3 { margin-bottom: 12px; color: #ff0000; }
.platform-section.tiktok { border-left: 4px solid #010101; }
.platform-section.tiktok i { color: #010101; }
.advanced-settings, .overlay-controls {
    border: 1px solid; border-radius: 8px; padding: 16px; margin: 0;
}
.aspect-toggles { display: flex; gap: 8px; margin-bottom: 12px; }
.aspect-btn {
    background: transparent; border: 1px solid; padding: 6px 12px; border-radius: 20px; cursor: pointer;
}
.aspect-btn.active { background: #ff0000; color: #fff; border-color: #ff0000; }
.video-wrapper { width: 100%; position: relative; padding-top: 56.25%; }
.video-wrapper video {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 8px; background: #000;
}
input, textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid; border-radius: 4px;
    font-size: 0.9rem; margin-top: 4px;
}
input:focus, textarea:focus { outline: none; border-color: #ff0000; }
.btn {
    padding: 10px 20px; border: none; border-radius: 4px; font-weight: 500; cursor: pointer;
    transition: 0.2s;
}
.btn.primary { background: #ff0000; color: #fff; }
.btn.primary:hover { background: #cc0000; }
.btn.secondary { background: transparent; border: 1px solid #f44336; color: #f44336; }
.btn.secondary:hover { background: #f44336; color: #fff; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.stream-status-panel {
    border: 1px solid; border-radius: 8px; padding: 16px;
}
.status-item { display: flex; justify-content: space-between; margin-bottom: 8px; border-bottom: 1px solid; padding-bottom: 4px; }

/* History Table */
.history-table { width: 100%; border-collapse: collapse; border-radius: 8px; overflow: hidden; }
.history-table th { background: rgba(255,0,0,0.1); color: #ff0000; padding: 12px; text-align: left; }
.history-table td { padding: 10px 12px; border-bottom: 1px solid; }

/* Settings */
.settings-group {
    border: 1px solid; border-radius: 8px; padding: 20px; margin-bottom: 20px;
}

/* Donation Grid */
.donation-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 24px;
}
.donation-card {
    border: 1px solid; border-radius: 16px; padding: 24px; transition: 0.2s;
}
.donation-card:hover { border-color: #ff0000; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.donation-card h3 {
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: #ff0000;
}
.donation-card p { margin: 8px 0; line-height: 1.5; }
.donation-card .note { font-style: italic; opacity: 0.7; margin-top: 12px; }

/* Docs Grid */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 24px; }
.doc-card {
    border: 1px solid; border-radius: 16px; padding: 24px; transition: 0.2s;
}
.doc-card:hover { border-color: #ff0000; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.doc-card h3 { margin-bottom: 12px; color: #ff0000; }
.doc-card p { margin-bottom: 16px; }
.learn-more-btn {
    background: transparent; border: 1px solid #ff0000; color: #ff0000; padding: 8px 16px;
    border-radius: 20px; cursor: pointer; font-weight: 500; transition: 0.2s; margin-bottom: 10px;
}
.learn-more-btn:hover { background: #ff0000; color: #fff; }
.doc-detail {
    margin-top: 16px; padding: 16px; background: rgba(0,0,0,0.03); border-radius: 8px; border-left: 3px solid #ff0000;
}
.doc-detail h4 { margin: 12px 0 6px; color: #ff0000; }
.doc-detail p { margin: 6px 0; }

/* Terms Grid */
.terms-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px;
}
.terms-card {
    border: 1px solid; border-radius: 16px; padding: 24px;
}
.terms-card h3 { margin-bottom: 20px; color: #ff0000; }
.terms-card p { margin-bottom: 12px; line-height: 1.6; }
.terms-card strong { color: #ff0000; }

/* Contact Info */
.contact-info {
    border: 1px solid; border-radius: 8px; padding: 24px; max-width: 600px; margin-top: 20px;
}
.contact-info a { color: #ff0000; text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }

/* Footer */
.app-footer { text-align: center; padding: 16px; border-top: 1px solid; }

/* Floating WhatsApp */
.whatsapp-float {
    position: fixed; bottom: 30px; right: 30px; background: #25D366; color: white;
    width: 60px; height: 60px; border-radius: 50%; text-align: center; font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3); z-index: 1000;
    display: flex; align-items: center; justify-content: center; text-decoration: none; transition: 0.3s;
}
.whatsapp-float:hover { background: #128C7E; transform: scale(1.1); }

/* Splash Screen */
.splash-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    background: #0b0e14; z-index: 2000;
}
.animated-bg {
    position: absolute; width: 100%; height: 100%;
    overflow: hidden; background: linear-gradient(135deg, #1e2a3a, #0f1a2a);
}
.circle {
    position: absolute; border-radius: 50%; animation: float 8s infinite;
}
.circle.red { width: 200px; height: 200px; background: rgba(255,0,0,0.3); top: 10%; left: 20%; animation-delay: 0s; }
.circle.green { width: 300px; height: 300px; background: rgba(0,255,0,0.2); bottom: 10%; right: 15%; animation-delay: 2s; }
.circle.blue { width: 250px; height: 250px; background: rgba(0,0,255,0.25); top: 40%; left: 60%; animation-delay: 4s; }
.circle.yellow { width: 180px; height: 180px; background: rgba(255,255,0,0.3); bottom: 30%; left: 10%; animation-delay: 1s; }
.circle.white { width: 220px; height: 220px; background: rgba(255,255,255,0.15); top: 70%; right: 30%; animation-delay: 3s; }
@keyframes float {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}
.login-card {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-radius: 20px;
    padding: 40px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); text-align: center; z-index: 10; width: 350px;
}
.login-card h1 { font-size: 2rem; margin-bottom: 10px; color: #030303; }
.login-card p { color: #606060; margin-bottom: 30px; }
.login-card .btn { width: 100%; margin-bottom: 15px; padding: 12px; }
.terms-note { font-size: 0.9rem; margin-top: 20px; }
.terms-note a { color: #ff0000; text-decoration: none; }

/* Responsive */
@media (max-width: 1024px) { .live-panel { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .sidebar { width: 72px; }
    .logo span, .nav-item span, .user-info span, .profile-icon span { display: none; }
    .terms-grid { grid-template-columns: 1fr; }
}
