/* Radabase — shared styles for every page on the site.
   One file so a visual change (colors, spacing, the header) only needs to
   happen once instead of being kept in sync across pages. */

:root {
  --brand: #1a5fb4;
  --brand-dark: #164c8f;
  --brand-light: #eaf2ff;
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --border: #e6e8ee;
  --text: #1c2230;
  --text-muted: #626a7a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-hover: 0 4px 10px rgba(16, 24, 40, 0.06), 0 10px 24px rgba(16, 24, 40, 0.10);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  max-width: 720px;
  margin: 40px auto 64px;
  padding: 0 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.site-header .brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand);
  text-decoration: none;
}
.site-header nav a {
  margin-left: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-header nav a:hover { color: var(--brand); }
.site-header nav a.active { color: var(--brand); font-weight: 700; }

h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
p.sub { color: var(--text-muted); font-size: 14px; margin-top: 0; }

/* ----------------------------------------------------------------- forms */

label { display: block; font-weight: 600; font-size: 14px; margin: 18px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  font-family: inherit;
  background: var(--card-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.15);
}
textarea { min-height: 70px; }

#search {
  margin: 4px 0 24px;
  padding: 12px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

button {
  margin-top: 20px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: white;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
button:hover { background: var(--brand-dark); }
button:active { transform: translateY(1px); }
button.btn-secondary { background: #6b7280; margin-left: 8px; }
button.btn-secondary:hover { background: #565d69; }

.status { padding: 12px 14px; border-radius: var(--radius-sm); margin: 16px 0; font-size: 14px; line-height: 1.5; }
.status.ok { background: #eafaf0; border: 1px solid #a6e6c0; }
.status.error { background: #fdecec; border: 1px solid #f3b3b3; }
.hidden { display: none; }
.hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }

/* -------------------------------------------------------------- case list */

.case {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.case:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #11141a;
  border-radius: var(--radius-sm);
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.gallery img:hover { opacity: 0.88; transform: scale(1.015); }

.case h2 { font-size: 16px; margin: 0 0 6px; }
.meta { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.diagnosis { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.byline { font-size: 13px; color: var(--text-muted); }
.uploaded { font-size: 12px; color: #9aa1ae; margin-top: 4px; }
.badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid #b9d6f2;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

.empty, .error { padding: 16px 18px; border-radius: var(--radius); font-size: 14px; }
.empty { background: var(--brand-light); border: 1px solid #b9d6f2; color: var(--text); }
.error { background: #fdecec; border: 1px solid #f3b3b3; }

/* --------------------------------------------------------------- lightbox */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.92);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 88%; max-height: 88%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  margin-top: 0;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); }
#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }
#lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  margin-top: 0;
}
#lightbox-close:hover { background: rgba(255, 255, 255, 0.24); }
#lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
}
