:root { --bg: #f8fafc; --text: #1e293b; --card: #ffffff; --sub: #f1f5f9; --border: #e2e8f0; --accent: #2563eb; }
body.dark { --bg: #0f172a; --text: #f1f5f9; --card: #1e293b; --sub: #334155; --border: #475569; --accent: #3b82f6; }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
body { background: var(--bg); color: var(--text); display: flex; justify-content: center; padding: 20px; transition: 0.3s; min-height: 100vh; }
a { text-decoration: none; color: inherit; }

.container { width: 100%; max-width: 800px; }
.card { background: var(--card); padding: 30px; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0,0,0,0.05); text-align: center; position: relative; }

/* Stats */
.header-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.theme-toggle { background: var(--sub); border: 1px solid var(--border); padding: 10px; border-radius: 12px; cursor: pointer; color: var(--text); }
.lang-switcher a { font-weight: 800; margin-left: 10px; opacity: 0.4; color: var(--accent); }
.lang-switcher a.active { opacity: 1; text-decoration: underline; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.stat-box { background: var(--sub); padding: 15px; border-radius: 18px; border: 1px solid var(--border); }
.stat-num { display: block; font-size: 24px; font-weight: 900; }
.danger { color: #ef4444; }

/* Search */
.search-form { display: flex; gap: 10px; margin-bottom: 30px; }
.search-form input { flex: 1; padding: 16px; border-radius: 14px; border: 2px solid var(--border); background: var(--bg); color: var(--text); outline: none; }
.search-form button { background: var(--accent); color: #fff; border: none; padding: 0 25px; border-radius: 14px; font-weight: 800; cursor: pointer; }

/* Result Header & Risk Bar */
.result-header-box { background: var(--sub); padding: 25px; border-radius: 20px; margin: 20px 0; border-left: 6px solid var(--accent); text-align: left; }
.result-flex { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 15px; }
.geo-info-row { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.geo-tag { background: var(--card); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; border: 1px solid var(--border); }

.risk-section { text-align: right; min-width: 150px; }
.risk-text { font-size: 12px; font-weight: 800; text-transform: uppercase; display: block; }
.risk-bar-container { width: 150px; height: 8px; background: var(--border); border-radius: 10px; margin-top: 5px; overflow: hidden; }
.risk-bar-fill { height: 100%; border-radius: 10px; transition: width 1s ease-in-out; }

/* Dashboard & Pills */
.dashboard-row { display: flex; align-items: center; gap: 15px; margin: 30px 0; }
.side-col { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.chart-col { flex: 1.5; height: 220px; }
.country-pill { background: var(--sub); padding: 12px; border-radius: 14px; border: 1px solid var(--border); transition: 0.2s; display: block; }
.clickable:hover { border-color: var(--accent); transform: translateY(-2px); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; text-align: left; margin-bottom: 20px; }
.data-table td { padding: 12px 0; border-bottom: 1px solid var(--border); }
.weight-badge { background: #fee2e2; color: #dc2626; padding: 3px 8px; border-radius: 6px; font-weight: 800; font-size: 11px; }

/* UI Elements */
.action-row { display: flex; gap: 10px; margin-bottom: 20px; }
.btn-main-dark { flex: 1; background: #1e293b; color: #fff; padding: 15px; border-radius: 12px; font-weight: 800; }
.btn-main-blue { flex: 1; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-weight: 800; cursor: pointer; }
.btn-report-red { display: block; background: #fee2e2; color: #dc2626; padding: 15px; text-align: center; border-radius: 12px; font-weight: 800; margin-bottom: 20px; }
.btn-mini { background: var(--accent); color: #fff; border: none; padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.back-btn { display: inline-block; color: var(--accent); font-weight: 800; margin-bottom: 15px; }

/* Lists & Footer */
.offenders-list { background: var(--sub); border-radius: 18px; padding: 10px; }
.offender-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px dashed var(--border); }
.count-badge { background: #ef4444; color: #fff; padding: 4px 10px; border-radius: 8px; font-weight: 800; }
.subnet-card { background: var(--sub); padding: 15px; border-radius: 16px; margin-top: 25px; border: 1px dashed var(--border); text-align: left; }
.instr-container { display: none; margin-bottom: 20px; text-align: left; }
pre { background: #1e293b; color: #38bdf8; padding: 12px; border-radius: 12px; font-size: 11px; overflow-x: auto; }
.main-footer { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 25px; text-align: left; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.footer-col a { display: block; color: var(--accent); font-size: 13px; margin-top: 5px; font-weight: 600; }

@media (max-width: 600px) {
    .dashboard-row { flex-direction: column; }
    .side-col { flex-direction: row; width: 100%; flex-wrap: wrap; }
    .side-col a { flex: 1 1 40%; }
    .risk-section { text-align: left; width: 100%; margin-top: 10px; }
}