/* IP Subnet Visualizer — Teal/Cyan network theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #14B8A6;
  --primary-dim: rgba(20,184,166,0.12);
  --primary-glow: rgba(20,184,166,0.3);
  --accent: #06B6D4;
  --accent-dim: rgba(6,182,212,0.12);
  --bg: #0A1628;
  --bg-card: #111D32;
  --bg-input: #081320;
  --border: rgba(20,184,166,0.15);
  --border-focus: rgba(20,184,166,0.5);
  --text: #E2E8F0;
  --text-dim: #94A3B8;
  --text-muted: #475569;
  --green: #34D399;
  --green-dim: rgba(52,211,153,0.12);
  --yellow: #FACC15;
  --red: #F87171;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at top, rgba(20,184,166,0.04), transparent 50%); pointer-events: none; }

.header { border-bottom: 1px solid var(--border); background: rgba(17,29,50,0.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 800px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-family: var(--font); font-size: 0.8rem; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #0D9488); color: #0A1628; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); transform: translateY(-1px); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

.main { max-width: 800px; margin: 0 auto; padding: 20px; }

.input-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.cidr-field { flex: 1; padding: 8px 12px; font-family: var(--mono); font-size: 0.88rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; }
.cidr-field:focus { border-color: var(--border-focus); }

.presets { display: flex; gap: 4px; flex-wrap: wrap; }
.preset { padding: 3px 8px; font-family: var(--mono); font-size: 0.68rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); cursor: pointer; transition: all var(--transition); }
.preset:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 16px; }
.result-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.result-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.result-value { font-family: var(--mono); font-size: 0.82rem; color: var(--primary); font-weight: 600; word-break: break-all; }
.result-value.big { font-size: 1.2rem; }

.visual-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
canvas { display: block; width: 100%; background: var(--bg-input); }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 24px rgba(0,0,0,0.5); font-size: 0.82rem; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) { .results { grid-template-columns: 1fr 1fr; } }
