:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --border-color: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --success: #10b981;
    --danger: #ef4444;
}

* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg-main); color: var(--text-main); margin: 0; padding: 0; padding-top: 70px; line-height: 1.6; }
.container { max-width: 1250px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--bg-card); padding: 25px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); border: 1px solid var(--border-color); box-sizing: border-box; }

.main-header { position: fixed; top: 0; left: 0; right: 0; height: 70px; background: rgba(30, 41, 59, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); z-index: 1000; display: flex; align-items: center; }
.header-container { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; padding: 0 20px; }
.logo a { color: var(--accent); font-size: 22px; font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo img { height: 32px; width: auto; }
.main-nav { display: flex; gap: 20px; align-items: center; }
.main-nav a { color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 14px; transition: color 0.2s; }
.main-nav a:hover { color: var(--accent); }
.donate-buttons { display: flex; gap: 10px; margin-left: 15px; border-left: 1px solid var(--border-color); padding-left: 15px; }

h1 { margin: 0; color: var(--accent); font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
h3 { margin-top: 0; color: var(--text-main); }
p.subtitle { color: var(--text-muted); margin-top: 5px; margin-bottom: 25px; font-size: 14px; }
label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 13px; color: #cbd5e1; text-transform: uppercase; letter-spacing: 0.5px; }
select, input[type="text"], input[type="number"], input[type="email"], textarea { width: 100%; padding: 12px; border: 1px solid #475569; border-radius: 6px; box-sizing: border-box; font-size: 15px; background: var(--bg-main); color: #fff; margin-bottom: 15px; font-family: inherit; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); outline: none; }

.btn { display: inline-block; background: var(--accent); color: #000 !important; border: none; padding: 14px 24px; font-size: 15px; font-weight: 700; border-radius: 6px; cursor: pointer; text-align: center; width: 100%; box-sizing: border-box; transition: background 0.2s; text-decoration: none; }
.btn:hover { background: var(--accent-hover); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }
.btn-coffee { background: #ffdd00; color: #000 !important; width: auto; padding: 8px 16px; font-size: 13px; font-weight: 700; display: inline-block; text-decoration: none; border-radius: 6px; border: none; cursor: pointer; transition: background 0.2s; }
.btn-coffee:hover { background: #eec800; }
.btn-donate { background: #ff5e5e; color: #fff !important; width: auto; padding: 8px 16px; font-size: 13px; font-weight: 700; display: inline-block; text-decoration: none; border-radius: 6px; border: none; cursor: pointer; transition: background 0.2s; }
.btn-donate:hover { background: #e04444; }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; font-weight: 600; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: var(--danger); }

.tab-wrapper { display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 20px; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.tab-btn { background: none; border: none; padding: 12px 18px; font-size: 14px; font-weight: 700; color: var(--text-muted); cursor: pointer; border-radius: 6px 6px 0 0; transition: all 0.2s; white-space: nowrap; margin-bottom: -2px; }
.tab-btn:hover { color: var(--accent); background: var(--bg-card); }
.tab-btn.active { color: var(--accent); border-bottom: 2px solid var(--accent); background: var(--border-color); }

.workspace-grid { display: flex; gap: 25px; flex-wrap: wrap; }
.side-tool-panel { flex: 2.2; min-width: 320px; }
.right-sidebar-panel { flex: 1; min-width: 280px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.tip-box { background: rgba(245, 158, 11, 0.1); border-left: 3px solid var(--accent); padding: 12px 15px; border-radius: 4px; font-size: 13px; color: #e2e8f0; margin-bottom: 20px; line-height: 1.5; }

.ticker-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-bottom: 10px; }
.ticker-item { background: var(--bg-main); border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; text-align: center; }
.ticker-lbl { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.ticker-val { font-size: 20px; font-weight: 800; color: #f8fafc; margin-top: 5px; }
.val-green { color: var(--success); } .val-red { color: var(--danger); }
.runtime-box { background: var(--bg-main); border-left: 4px solid var(--accent); padding: 15px; border-radius: 0 6px 6px 0; margin-top: 20px; }
.runtime-val { font-size: 22px; font-weight: 800; color: var(--accent); }

.ad-slot { background: var(--bg-card); border: 2px dashed #475569; border-radius: 8px; text-align: center; color: #64748b; font-weight: bold; font-size: 11px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.ad-1 { width: 100%; height: 90px; margin-top: 20px; }
.ad-2 { width: 100%; height: 250px; margin-top: 20px; }
.ad-3 { width: 100%; height: 90px; margin: 25px 0 15px 0; background: #172554; border-color: #1e3a8a; }
.footer-ad-grid { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.ad-4, .ad-5 { flex: 1; min-width: 300px; height: 250px; }

.ad-top-sticky { position: sticky; top: 70px; z-index: 900; width: 100%; height: 60px; margin: 0 auto; max-width: 1250px; border-radius: 0 0 8px 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border-color); border-top: none; }
.ad-top-sticky:empty { display: none; }

.page-content p { color: #cbd5e1; font-size: 15px; }
.contact-form textarea { resize: vertical; }

.main-footer { background: var(--bg-card); border-top: 1px solid var(--border-color); padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { color: var(--accent); margin-top: 0; }
.footer-col p { color: var(--text-muted); font-size: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.social-icons { display: flex; gap: 10px; flex-wrap: wrap; }
.social-icon { background: var(--bg-main); padding: 8px 12px; border-radius: 4px; font-size: 12px; font-weight: bold; color: var(--text-main); text-decoration: none; border: 1px solid var(--border-color); }
.social-icon:hover { border-color: var(--accent); color: var(--accent); }
.footer-bottom { text-align: center; border-top: 1px solid var(--border-color); padding-top: 20px; color: #64748b; font-size: 13px; }
.footer-bottom a { color: var(--accent); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }

.cookie-notice { position: fixed; bottom: -100px; left: 0; right: 0; background: #1e293be6; backdrop-filter: blur(5px); padding: 15px 20px; z-index: 2000; display: flex; justify-content: center; align-items: center; gap: 20px; border-top: 1px solid var(--accent); transition: bottom 0.4s ease; box-shadow: 0 -4px 10px rgba(0,0,0,0.3); }
.cookie-notice.show { bottom: 0; }
.cookie-notice p { margin: 0; font-size: 13px; color: #f8fafc; max-width: 800px; }

.back-to-top { position: fixed; bottom: 80px; right: 20px; background: var(--accent); color: var(--bg-main); border: none; width: 45px; height: 45px; border-radius: 50%; font-size: 20px; font-weight: bold; cursor: pointer; display: none; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 1500; transition: transform 0.2s; }
.back-to-top:hover { transform: translateY(-3px); }

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

@media (max-width: 868px) {
    .workspace-grid { flex-direction: column; }
    .header-container { flex-wrap: wrap; }
    .mobile-menu-toggle { display: block; }
    .main-nav { display: none; width: 100%; flex-direction: column; padding: 15px 0; background: var(--bg-card); position: absolute; top: 70px; left: 0; border-bottom: 1px solid var(--border-color); }
    .main-nav.active { display: flex; }
    .donate-buttons { margin-left: 0; border-left: none; padding-left: 0; flex-direction: column; width: 100%; }
    .donate-buttons a { text-align: center; }
    .cookie-notice { flex-direction: column; text-align: center; }
    .ad-top-sticky { top: 70px; height: 50px; }
}

html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .main-nav { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .tip-box { border-left: none; border-right: 3px solid var(--accent); }
html[dir="rtl"] .runtime-box { border-left: none; border-right: 4px solid var(--accent); border-radius: 6px 0 0 6px; }
