/* Overhead Page Draft - Shared Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; background: #f5f5f7; color: #1d1d1f; }

/* ---- Shared ---- */
.header {
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  color: #fff; padding: 32px 32px 28px;
}
.header-brand { display: flex; align-items: center; gap: 14px; }
.header-icon { font-size: 40px; }
.header h1 { font-size: 26px; font-weight: 700; }
.header .subtitle { font-size: 15px; opacity: 0.8; margin-top: 4px; }
.header .physician-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
  border-radius: 20px; padding: 6px 16px 6px 8px; margin-top: 12px; font-size: 14px;
}
.header .physician-badge .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.loading { text-align: center; padding: 60px 20px; color: #86868b; font-size: 16px; }
.error-banner {
  background: #ffe5e5; border: 1px solid #ff3b30; border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px; color: #d30000; font-size: 14px;
}

/* ---- Guess Page ---- */
.guess-card {
  background: #fff; border-radius: 12px; padding: 20px 24px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: box-shadow 0.15s;
}
.guess-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.guess-card .page-name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; }
.guess-card .page-name .page-label { font-size: 12px; color: #86868b; font-weight: 400; margin-top: 2px; }

.guess-input-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.guess-input {
  width: 80px; padding: 10px 12px; border: 1.5px solid #d2d2d7; border-radius: 10px;
  font-size: 18px; font-weight: 600; text-align: center; font-family: inherit;
  color: #1d1d1f; outline: none; transition: all 0.15s;
}
.guess-input:focus { border-color: #0071e3; box-shadow: 0 0 0 3px rgba(0,113,227,0.15); }
.guess-input.saved { border-color: #34c759; }

.saved-indicator {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #34c759; opacity: 0; transition: opacity 0.3s; white-space: nowrap;
}
.saved-indicator.visible { opacity: 1; }

.instructions {
  background: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); font-size: 14px; color: #515154; line-height: 1.5;
}
.instructions strong { color: #1d1d1f; }

.submit-section {
  background: #fff; border-radius: 12px; padding: 20px; margin-top: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); text-align: center;
}
.btn-submit {
  padding: 12px 40px; border-radius: 10px; border: none; font-size: 16px;
  font-weight: 600; cursor: pointer; background: #0071e3; color: #fff;
  transition: all 0.15s;
}
.btn-submit:hover { background: #0077ed; transform: translateY(-1px); }
.btn-submit:disabled { background: #86868b; cursor: default; transform: none; }
.btn-submit.submitted { background: #34c759; }
.submit-note { font-size: 12px; color: #86868b; margin-top: 8px; }

.view-link {
  display: inline-block; margin-top: 12px; font-size: 13px; color: #0071e3;
  text-decoration: none; font-weight: 500;
}
.view-link:hover { text-decoration: underline; }

/* ---- Summary / Scoreboard Page ---- */
.summary-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.summary-header h2 { font-size: 20px; font-weight: 700; }
.summary-header .date-range { font-size: 13px; color: #86868b; }

.countdown-banner {
  background: #fff; border-radius: 12px; padding: 16px 20px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); text-align: center; font-size: 14px;
  color: #515154;
}
.countdown-banner .countdown-value { font-size: 20px; font-weight: 700; color: #1d1d1f; margin-top: 4px; }

.chart-container {
  background: #fff; border-radius: 12px; padding: 24px 24px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 0;
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  overflow-x: auto;
}

.chart-area {
  display: flex; justify-content: center; gap: 0; min-height: 200px;
  align-items: flex-end; padding-bottom: 8px;
}

.bar-column {
  display: flex; flex-direction: column; align-items: center; flex: 1;
  min-width: 100px; max-width: 180px;
}

.bar-value {
  font-size: 14px; font-weight: 700; color: #1d1d1f; margin-bottom: 4px;
  min-height: 20px;
}
.bar-value.pending { color: #86868b; font-weight: 400; font-style: italic; font-size: 12px; }

.bar-wrapper {
  width: 52px; border-radius: 8px 8px 0 0; position: relative;
  min-height: 4px; transition: height 0.6s ease;
}

.bar-fill {
  width: 100%; border-radius: 8px 8px 0 0;
  min-height: 4px; transition: height 0.6s ease;
}

.bar-label {
  font-size: 11px; font-weight: 600; color: #515154; text-align: center;
  margin-top: 8px; padding: 0 4px; line-height: 1.3; min-height: 32px;
  display: flex; align-items: center; justify-content: center;
}

/* Bar colors */
.bar-0 .bar-fill { background: linear-gradient(180deg, #ff6b6b 0%, #ee5a24 100%); }
.bar-1 .bar-fill { background: linear-gradient(180deg, #ffa502 0%, #e67e22 100%); }
.bar-2 .bar-fill { background: linear-gradient(180deg, #7bed9f 0%, #2ed573 100%); }
.bar-3 .bar-fill { background: linear-gradient(180deg, #70a1ff 0%, #1e90ff 100%); }
.bar-4 .bar-fill { background: linear-gradient(180deg, #a29bfe 0%, #6c5ce7 100%); }

.bar-0 { --bar-color: #ee5a24; }
.bar-1 { --bar-color: #e67e22; }
.bar-2 { --bar-color: #2ed573; }
.bar-3 { --bar-color: #1e90ff; }
.bar-4 { --bar-color: #6c5ce7; }

/* Guess grid below chart */
.grid-container {
  background: #fff; border-radius: 0 0 12px 12px; padding: 0 24px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-top: 2px solid #f5f5f7;
  overflow-x: auto;
}

.guess-grid {
  width: 100%; border-collapse: collapse;
}

.guess-grid th {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  color: #86868b; padding: 10px 8px 8px; white-space: nowrap;
}
.guess-grid th.name-col { text-align: left; min-width: 100px; }
.guess-grid th.guess-col { text-align: center; min-width: 80px; }
.guess-grid th.score-col { text-align: right; min-width: 70px; }

.guess-grid td {
  padding: 8px; font-size: 13px; border-top: 1px solid #f0f0f2;
}
.guess-grid td.physician-name {
  font-weight: 600; white-space: nowrap; padding-left: 0;
}
.guess-grid td.guess-value { text-align: center; font-variant-numeric: tabular-nums; }
.guess-grid td.score-value {
  text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; padding-right: 0;
}

.guess-grid td.guess-value .diff {
  font-size: 10px; font-weight: 600; margin-left: 2px;
}
.diff-over { color: #ff3b30; }
.diff-under { color: #0071e3; }
.diff-exact { color: #34c759; }

.guess-grid tr.rank-1 td.score-value { color: #34c759; }
.guess-grid tr.rank-2 td.score-value { color: #ff9f0a; }
.guess-grid tr.rank-3 td.score-value { color: #86868b; }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700;
  margin-right: 8px; flex-shrink: 0;
}
.rank-1 .rank-badge { background: #ffd700; color: #7a6200; }
.rank-2 .rank-badge { background: #e0e0e0; color: #666; }
.rank-3 .rank-badge { background: #cd9b5a; color: #5a3e1b; }

.guess-grid tr:hover td { background: rgba(0,113,227,0.03); }
.guess-grid tr.not-submitted td { opacity: 0.4; }

/* Admin controls */
.admin-bar {
  background: #1d1d1f; color: #fff; padding: 10px 32px; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-bar .label { font-weight: 600; opacity: 0.7; }

.actual-input {
  width: 64px; padding: 6px 8px; border: 1.5px solid #d2d2d7; border-radius: 8px;
  font-size: 14px; font-weight: 600; text-align: center; font-family: inherit;
  color: #1d1d1f; outline: none; transition: all 0.15s;
}
.actual-input:focus { border-color: #ff9f0a; box-shadow: 0 0 0 3px rgba(255,159,10,0.2); }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: #1d1d1f; color: #fff;
  padding: 12px 20px; border-radius: 10px; font-size: 14px;
  transform: translateY(100px); opacity: 0; transition: all 0.3s; z-index: 1000;
}
.toast.visible { transform: translateY(0); opacity: 1; }

/* Winner celebration */
.winner-banner {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 50%, #ffd700 100%);
  border-radius: 12px; padding: 20px 24px; margin-bottom: 20px;
  text-align: center; font-size: 20px; font-weight: 700; color: #5a3e1b;
  box-shadow: 0 4px 20px rgba(255,215,0,0.4);
  transform: scale(0.8); opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.winner-banner.visible { transform: scale(1); opacity: 1; }
.winner-banner .trophy { font-size: 32px; animation: bounce 1s ease infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.guess-grid tr.winner-row td {
  background: rgba(255,215,0,0.1);
}
.guess-grid tr.winner-row td.physician-name {
  color: #b8860b;
}
.guess-grid tr.winner-row td.score-value {
  color: #b8860b; font-size: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .header { padding: 24px 16px 20px; }
  .header h1 { font-size: 22px; }
  .container { padding: 16px; }
  .guess-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .guess-input-group { width: 100%; }
  .guess-input { flex: 1; }
  .chart-container { padding: 16px 12px 0; }
  .grid-container { padding: 0 12px 16px; }
  .bar-column { min-width: 70px; }
  .bar-label { font-size: 10px; }
  .summary-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}
