@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Vazirmatn', sans-serif; }
body { background-color: #0f1216; color: #e1e6eb; direction: rtl; padding: 20px; }
.container { max-width: 1200px; margin: 0 auto; }

.header { display: flex; justify-content: space-between; align-items: center; background: #181d24; padding: 18px; border-radius: 10px; border: 1px solid #2a333d; margin-bottom: 15px; }
.logo-area h1 { font-size: 1.3rem; color: #de9b35; display: inline-block; font-weight: 700; }

.badge { padding: 3px 8px; border-radius: 12px; font-size: 0.75rem; margin-right: 6px; font-weight: 500; }
.badge-version { background: rgba(222, 155, 53, 0.15); color: #de9b35; border: 1px solid #de9b35; }
.badge-simulated { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }

.methodology-banner { background: #1e293b; border-right: 4px solid #38bdf8; padding: 12px 16px; border-radius: 6px; font-size: 0.85rem; color: #cbd5e1; margin-bottom: 20px; }
.methodology-banner a { color: #38bdf8; text-decoration: none; font-weight: bold; }

.controls { display: flex; align-items: center; gap: 10px; }
.monitor-btn { background-color: #f87171; color: white; border: none; padding: 7px 14px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.monitor-btn.active { background-color: #4ade80; color: #0f1216; }
select { background: #252d37; color: #fff; border: 1px solid #3a4756; padding: 6px 10px; border-radius: 6px; }

.dns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.dns-card { background: #181d24; border: 1px solid #262f3a; border-radius: 8px; padding: 15px; cursor: pointer; display: flex; flex-direction: column; transition: border-color 0.2s; }
.dns-card:hover { border-color: #de9b35; }

.dns-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dns-title { font-weight: 700; font-size: 1rem; }
.dns-type { font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; }
.type-internal { background: #1e3a29; color: #4ade80; }
.type-external { background: #1e293b; color: #38bdf8; }

.dns-ips { font-family: monospace, 'Vazirmatn'; font-size: 0.85rem; color: #94a3b8; margin-bottom: 10px; }
.stats-box { background: #12161c; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.stat-row { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 4px; }

.ping-good { color: #4ade80; }
.ping-medium { color: #facc15; }
.ping-bad { color: #f87171; }

.dns-route { font-size: 0.75rem; color: #64748b; display: flex; justify-content: space-between; margin-bottom: 10px; }
.trace-action-btn { background: #252d37; color: #de9b35; border: 1px solid #de9b35; padding: 7px; border-radius: 6px; font-size: 0.8rem; cursor: pointer; font-weight: bold; margin-top: auto; }
.trace-action-btn:hover { background: #de9b35; color: #0f1216; }

.back-link { color: #94a3b8; text-decoration: none; font-size: 0.9rem; }
.top-routes-section h2 { font-size: 1.1rem; color: #cbd5e1; margin-bottom: 15px; }
.top-routes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin-bottom: 25px; }
.top-route-card { background: #181d24; border: 1px solid #262f3a; border-radius: 8px; padding: 15px; position: relative; text-align: center; }
.top-route-card.rank-1 { border-color: #4ade80; background: rgba(74, 222, 128, 0.05); }
.rank-badge { position: absolute; top: 10px; right: 10px; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; background: #252d37; }
.route-server-code { font-size: 1.8rem; font-weight: bold; color: #de9b35; margin-top: 5px; }
.route-server-name { font-size: 0.85rem; color: #94a3b8; margin-bottom: 10px; }
.route-ping { font-size: 1.4rem; font-weight: bold; color: #4ade80; }

.console-section { background: #12161c; border: 1px solid #262f3a; border-radius: 8px; overflow: hidden; }
.console-header { background: #181d24; padding: 10px 15px; font-size: 0.85rem; color: #64748b; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #262f3a; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #facc15; }
.pulsing { animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.console-body { padding: 15px; font-family: monospace; font-size: 0.85rem; height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.log-info { color: #38bdf8; }
.log-step { color: #94a3b8; }
.log-success { color: #4ade80; }

.toast { visibility: hidden; min-width: 200px; background-color: #de9b35; color: #0f1216; font-weight: 700; text-align: center; border-radius: 6px; padding: 12px; position: fixed; bottom: 30px; left: 30px; z-index: 100; }
.toast.show { visibility: visible; }