/* =====================
   tools.piastowski.net
   ===================== */

:root {
  --bg:        #f0f2f5;
  --surface:   #ffffff;
  --surface2:  #eef1f5;
  --primary:   #1a3c5e;
  --primary-h: #254f7a;
  --accent:    #2980b9;
  --text:      #2c3e50;
  --text-muted:#7f8c8d;
  --border:    #d5dce6;
  --danger:    #e74c3c;
  --warn:      #2471a3;
  --radius:    10px;
  --shadow:    0 2px 10px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-h) 100%);
  color: #fff;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
  margin: 0;
  font-size: 1.8em;
  letter-spacing: 0.04em;
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: auto;
}

/* ---- Main card ---- */
main {
  max-width: 640px;
  width: 100%;
  margin: 40px auto;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Index — centered column */
main.index {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
}

/* ---- Forms ---- */
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.95em;
  color: var(--text);
}

input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1em;
  background: var(--surface2);
  color: var(--text);
  transition: border-color 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

input[type="submit"],
button[type="submit"] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-h) 100%);
  color: #fff;
  border: none;
  padding: 11px 26px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.15s;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ---- Result box ---- */
.result {
  margin-top: 24px;
  background: var(--surface2);
  padding: 20px;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.result h3 { margin-top: 0; }

/* ---- Messages ---- */
.warning { color: var(--warn); font-weight: bold; }
.error   { color: var(--danger); font-weight: bold; }

/* ---- Back button ---- */
.back-button {
  display: inline-block;
  margin-top: 28px;
  background: var(--surface2);
  color: var(--primary);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: background 0.2s, transform 0.15s;
}

.back-button:hover {
  background: var(--border);
  transform: translateY(-1px);
}

/* ---- Index tool links ---- */
a.tool-link {
  text-decoration: none;
  color: var(--primary);
  background: var(--surface2);
  padding: 16px 28px;
  border-radius: var(--radius);
  font-size: 1.05em;
  font-weight: 600;
  width: 320px;
  text-align: center;
  border: 1px solid var(--border);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

a.tool-link:hover {
  background: #dde4ed;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

/* ---- RAID table ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  border: 1px solid var(--border);
  padding: 11px 14px;
  text-align: center;
  font-size: 0.95em;
}

th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

tr:nth-child(even) td { background: var(--surface2); }

/* ---- IP box ---- */
.ip-box {
  background: var(--surface2);
  padding: 24px 36px;
  border-radius: var(--radius);
  font-size: 2em;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  color: var(--primary);
}

/* ---- Parking bars ---- */
.bar-container {
  background: var(--border);
  width: 100%;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  background: #27ae60;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 7px;
  color: #fff;
  font-size: 0.8em;
  font-weight: 700;
  white-space: nowrap;
  transition: width 0.3s ease;
  min-width: fit-content;
}

tr.no-spots .bar-fill { background: var(--danger); }
tr.no-spots            { background: #fdf0ef; }

/* ---- Responsive ---- */
@media (max-width: 680px) {
  main { margin: 20px 12px; padding: 20px; }
  a.tool-link { width: 100%; }
  .ip-box { font-size: 1.4em; padding: 18px; }
}
