/* Google Forms inspired stylesheet — cwc_hyouka */
:root {
  --primary:       #673ab7;
  --primary-dark:  #4527a0;
  --primary-light: #ede7f6;
  --bg:            #f0ebf8;
  --surface:       #ffffff;
  --text:          #202124;
  --muted:         #5f6368;
  --border:        #dadce0;
  --red:           #d93025;
  --green:         #137333;
  --blue:          #1a73e8;
}

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

body {
  margin: 0;
  font-family: 'Google Sans', Roboto, 'Noto Sans JP', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.gf-nav {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.gf-nav-brand { font-size: 17px; font-weight: 500; white-space: nowrap; }
.gf-nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.gf-nav-links a, .gf-nav-links span {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 4px;
}
.gf-nav-links a:hover { background: rgba(255,255,255,.15); }

/* ── Page containers ─────────────────────────────────────────────────────── */
.gf-page      { max-width: 680px; margin: 0 auto; padding: 20px 12px 80px; }
.gf-page-wide { max-width: 960px; margin: 0 auto; padding: 20px 16px 80px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.gf-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px rgba(60,64,67,.15);
}
.gf-card-header { border-top: 10px solid var(--primary); }
.gf-card-header h1 { font-size: 26px; font-weight: 400; margin: 0 0 8px; }
.gf-card-header .sub { color: var(--muted); font-size: 14px; margin: 0; }
.gf-section-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--primary);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--primary-light);
}

/* ── Question labels ─────────────────────────────────────────────────────── */
.gf-qlabel { font-size: 15px; margin-bottom: 14px; }
.gf-qlabel .req { color: var(--red); margin-left: 3px; }

/* ── Linear scale (Google Forms style) ──────────────────────────────────── */
.gf-scale { display: flex; }
.gf-scale-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gf-scale-col span { font-size: 12px; color: var(--muted); user-select: none; }
.gf-scale-col .gf-scale-text {
  height: 45px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
}
.gf-scale-col input[type=radio] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
}

/* Small chip showing engineer reference score */
.gf-eval-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Textarea ────────────────────────────────────────────────────────────── */
.gf-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 14px/1.5 inherit;
  resize: vertical;
  outline: none;
  transition: border .15s;
  background: transparent;
  color: var(--text);
}
.gf-textarea:focus { border-color: var(--primary); border-width: 2px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.gf-btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font: 500 14px/1 inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
}
.gf-btn-primary  { background: var(--primary); color: #fff; }
.gf-btn-primary:hover  { background: var(--primary-dark); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.gf-btn-primary:disabled { background: var(--border); color: var(--muted); cursor: default; box-shadow: none; }
.gf-btn-outline  { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.gf-btn-outline:hover  { background: var(--primary-light); }
.gf-btn-sm { padding: 6px 14px; font-size: 13px; }
.gf-btn-danger { background: var(--red); color: #fff; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-pending  { background: #fce8e6; color: #c5221f; }
.badge-answered { background: #e8f0fe; color: #1a73e8; }
.badge-done     { background: #e6f4ea; color: #137333; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.gf-alert { padding: 12px 16px; border-radius: 4px; font-size: 14px; margin-top: 8px; }
.gf-alert-error   { background: #fce8e6; color: #c5221f; border-left: 4px solid #c5221f; }
.gf-alert-success { background: #e6f4ea; color: #137333; border-left: 4px solid #137333; }
.gf-alert-info    { background: #e8f0fe; color: #1a73e8; border-left: 4px solid #1a73e8; }

/* ── Table ───────────────────────────────────────────────────────────────── */
.gf-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
.gf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gf-table th {
  background: var(--primary-light);
  color: var(--primary-dark);
  text-align: left;
  padding: 10px 14px;
  font-weight: 500;
  white-space: nowrap;
}
/* Admin dashboard: table wrapper scrolls vertically; thead sticks at top of wrapper */
#dashboardTable .gf-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 190px);
}
#dashboardTable .gf-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--primary-light);
}
.gf-table td { padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.gf-table tr:hover td { background: #faf8fd; }
.gf-table-actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; min-width: 120px; height: 115px; justify-content: center; }
.gf-table-actions .gf-btn { width: 100%; text-align: center; }

/* ── Form controls ───────────────────────────────────────────────────────── */
.gf-field { margin-bottom: 16px; }
.gf-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.gf-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 14px/1 inherit;
  background: white;
  cursor: pointer;
  outline: none;
}
.gf-select:focus { border-color: var(--primary); }
.gf-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.gf-inline .gf-field { flex: 1; min-width: 160px; }
.gf-textarea-admin {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 14px/1.5 inherit;
  resize: vertical;
  outline: none;
}
.gf-textarea-admin:focus { border-color: var(--primary); }

/* ── Login page ──────────────────────────────────────────────────────────── */
.gf-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.gf-login-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 44px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  text-align: center;
}
.gf-login-logo { font-size: 48px; margin-bottom: 16px; }
.gf-login-card h1 { font-size: 22px; font-weight: 400; margin: 0 0 8px; }
.gf-login-card .note { font-size: 13px; color: var(--muted); margin: 0 0 28px; }
.gf-google-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
  font: 15px/1 inherit;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s;
}
.gf-google-btn:hover { box-shadow: 0 1px 5px rgba(0,0,0,.2); }
.gf-google-btn svg { flex-shrink: 0; }
.gf-google-btn span { flex: 1; text-align: center; }

/* ── Completion screen ───────────────────────────────────────────────────── */
.gf-complete {
  text-align: center;
  padding: 40px 24px;
}
.gf-check-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
}
.gf-complete h2 { font-size: 22px; font-weight: 400; margin: 0 0 8px; }
.gf-complete p  { color: var(--muted); margin: 0; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
hr.gf-hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Readonly eval rows ──────────────────────────────────────────────────── */
.eval-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.eval-row:last-child { border-bottom: none; }
.eval-row .label { color: var(--muted); flex: 1; min-width: 0; }
.eval-row .score { font-weight: 500; white-space: nowrap; flex-shrink: 0; margin-left: 16px; }

/* ── Admin filter bar (sticky below nav, contains filters + actions) ─────── */
.admin-filter-bar {
  position: sticky;
  top: 56px;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}
.admin-filter-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-filter-fields {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.admin-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Admin wide page container ───────────────────────────────────────────── */
.gf-page-admin {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* Evaluation form layout tuning */
.gf-eval-wide { max-width: 1080px; }
.gf-eval-wide .gf-scale {
  max-width: 560px;
  margin: 0 auto;
}
.gf-eval-wide .gf-qlabel {
  text-align: center;
}

/* ── Input (filter fields) ───────────────────────────────────────────────── */
.gf-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 14px/1 inherit;
  outline: none;
  background: white;
  color: var(--text);
}
.gf-input:focus { border-color: var(--primary); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gf-nav { padding: 0 12px; }
  .gf-nav-brand { font-size: 14px; }
  .gf-page { padding: 12px 8px 60px; }
  .gf-page-wide { padding: 12px 8px 60px; }
  .gf-card { padding: 16px; }
  .gf-card-header h1 { font-size: 20px; }
  .gf-login-card { padding: 28px 20px; }
}
