/* ─── Tim Hortons Brand Variables ─────────────────────────────────────────── */
:root {
  --th-red: #C8102E;
  --th-red-dark: #a00e26;
  --th-red-light: #e8102e;
  --th-cream: #FFF8F0;
  --th-warm: #FAF0E6;
  --th-brown: #3D1F00;
  --th-brown-light: #6B3A1F;
  --th-gray: #F4F4F4;
  --th-border: #E0D5CC;
  --th-text: #1A1A1A;
  --th-muted: #6B6B6B;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
}

/* ─── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--th-cream);
  color: var(--th-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Header / Nav ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--th-red);
  padding: 0;
  box-shadow: 0 2px 12px rgba(200,16,46,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 92px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-main { height: 180px; object-fit: contain; filter: brightness(0) invert(1); display: block; }
.header-inner a { line-height: 0; }

/* ─── Nav ─────────────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  transition: all var(--transition);
  letter-spacing: 0.2px;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.18);
  color: white;
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--th-red) 0%, var(--th-red-dark) 60%, var(--th-brown) 100%);
  color: white;
  padding: 72px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-maple {
  position: absolute;
  width: 520px;
  height: 520px;
  object-fit: contain;
  top: 50%;
  left: -380px;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
  opacity: 0.28;
}

.hero-content { position: relative; max-width: 680px; margin: 0 auto; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  line-height: 1.15;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 0.95rem;
  opacity: 0.75;
  margin-top: 8px;
}

/* ─── Main container ─────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Section heading ────────────────────────────────────────────────────── */
.section-title {
  text-align: center;
  padding: 48px 0 32px;
}

.section-title h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--th-brown);
  margin-bottom: 8px;
}

.section-title p { color: var(--th-muted); font-size: 1rem; }

.divider {
  width: 60px;
  height: 4px;
  background: var(--th-red);
  border-radius: 2px;
  margin: 12px auto;
}

/* ─── Job cards grid ─────────────────────────────────────────────────────── */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

.job-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.job-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--th-red);
}

.job-card.active {
  border-color: var(--th-red);
  box-shadow: var(--shadow-lg);
}

.job-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--th-red) 0%, var(--th-brown) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-card-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--th-red) 0%, var(--th-brown) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-card-image-placeholder span {
  font-size: 3rem;
  opacity: 0.6;
}

.job-card-body { padding: 20px; }

.job-number {
  display: inline-block;
  background: var(--th-red);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.job-card-body h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--th-brown);
  margin-bottom: 8px;
  line-height: 1.3;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-type {
  background: var(--th-warm);
  color: var(--th-brown-light);
  border: 1px solid var(--th-border);
}

.badge-store {
  background: #FFF0F3;
  color: var(--th-red-dark);
  border: 1px solid rgba(200,16,46,0.2);
}

.job-card-body p {
  font-size: 0.9rem;
  color: var(--th-muted);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--th-red);
  color: white;
  width: 100%;
}

.btn-primary:hover { background: var(--th-red-dark); transform: translateY(-1px); }

.btn-secondary {
  background: white;
  color: var(--th-red);
  border: 2px solid var(--th-red);
}

.btn-secondary:hover { background: var(--th-red); color: white; }

.btn-outline {
  background: transparent;
  color: var(--th-muted);
  border: 1.5px solid var(--th-border);
}

.btn-outline:hover { border-color: var(--th-red); color: var(--th-red); }

/* ─── Job Detail Panel ────────────────────────────────────────────────────── */
#job-detail-panel {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 60px;
  overflow: hidden;
  border: 1px solid var(--th-border);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-header {
  background: linear-gradient(135deg, var(--th-red) 0%, var(--th-brown) 100%);
  color: white;
  padding: 32px 40px;
}

.detail-header h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 10px; }

.detail-body { padding: 36px 40px; }

.detail-section { margin-bottom: 28px; }
.detail-section h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--th-red);
  margin-bottom: 10px;
}

.detail-section p { color: var(--th-text); line-height: 1.7; }

.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--th-text);
}

.detail-list li::before {
  content: '✓';
  color: var(--th-red);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-actions {
  padding: 24px 40px;
  background: var(--th-gray);
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--th-border);
}

/* ─── Apply Form ──────────────────────────────────────────────────────────── */
.apply-wrapper {
  max-width: 680px;
  margin: 48px auto;
  padding: 0 24px 80px;
}

.apply-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.apply-card-header {
  background: linear-gradient(135deg, var(--th-red) 0%, var(--th-brown) 100%);
  color: white;
  padding: 32px 36px;
}

.apply-card-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.apply-card-header p { opacity: 0.85; font-size: 0.95rem; }

.apply-card-body { padding: 36px; }

.form-section {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--th-border);
}

.form-section:last-of-type { border-bottom: none; margin-bottom: 0; }

.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--th-red);
  margin-bottom: 18px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.full { grid-template-columns: 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--th-brown);
}

.required-star { color: var(--th-red); margin-left: 2px; }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--th-border);
  border-radius: 8px;
  font-size: 0.93rem;
  font-family: inherit;
  color: var(--th-text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--th-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.1);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.8rem; color: var(--th-muted); margin-top: 2px; }

/* Radio / Checkbox groups */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.radio-option, .check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--th-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  user-select: none;
}

.radio-option:has(input:checked),
.check-option:has(input:checked) {
  border-color: var(--th-red);
  background: #FFF0F3;
  color: var(--th-red-dark);
}

.radio-option input, .check-option input { accent-color: var(--th-red); }

.availability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.submit-area {
  padding: 28px 36px;
  background: var(--th-gray);
  border-top: 1px solid var(--th-border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.submit-area .btn { padding: 13px 32px; font-size: 1rem; }

.error-banner {
  background: #FFF0F3;
  border: 1.5px solid var(--th-red);
  color: var(--th-red-dark);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* ─── Thank You Animation ─────────────────────────────────────────────────── */
.thankyou-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.thankyou-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 60px 48px;
  text-align: center;
  max-width: 520px;
  width: 100%;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.thankyou-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 24px;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.thankyou-check {
  width: 72px;
  height: 72px;
  background: var(--th-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.thankyou-check svg {
  width: 36px;
  height: 36px;
  stroke: white;
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawCheck 0.5s ease 0.8s forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.thankyou-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--th-brown);
  margin-bottom: 12px;
  line-height: 1.3;
}

.thankyou-card p {
  color: var(--th-muted);
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.7;
}

.thankyou-tagline {
  font-style: italic;
  color: var(--th-red);
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 16px;
  margin-bottom: 28px;
}

.confetti-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--th-red);
  animation: bounce 0.6s ease infinite alternate;
}

.dot:nth-child(2) { animation-delay: 0.15s; background: var(--th-brown); }
.dot:nth-child(3) { animation-delay: 0.3s; }
.dot:nth-child(4) { animation-delay: 0.15s; background: var(--th-brown); }
.dot:nth-child(5) { animation-delay: 0.3s; }

@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--th-brown);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  margin-top: auto;
}

/* ─── Admin ───────────────────────────────────────────────────────────────── */
.admin-wrapper { max-width: 1300px; margin: 0 auto; padding: 32px 24px; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--th-brown); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--th-red);
  text-align: center;
}

.stat-card .stat-number { font-size: 2rem; font-weight: 800; color: var(--th-red); }
.stat-card .stat-label { font-size: 0.82rem; color: var(--th-muted); margin-top: 4px; }

.admin-section { margin-bottom: 40px; }

.admin-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--th-brown);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--th-border);
}

.admin-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.88rem;
}

.admin-table th {
  background: var(--th-red);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--th-border);
  vertical-align: top;
}

.admin-table tr:hover td { background: var(--th-gray); }
.admin-table tr:last-child td { border-bottom: none; }

.admin-form-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-form-card .form-group input,
.admin-form-card .form-group select,
.admin-form-card .form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--th-border);
  border-radius: 7px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.admin-form-card .form-group input:focus,
.admin-form-card .form-group select:focus,
.admin-form-card .form-group textarea:focus {
  border-color: var(--th-red);
}

.admin-form-card .form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--th-brown);
  margin-bottom: 4px;
}

.tag-yes { color: #16803c; font-weight: 600; }
.tag-no  { color: var(--th-red); font-weight: 600; }

/* ─── Loading indicator ───────────────────────────────────────────────────── */
.htmx-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--th-muted);
  font-size: 0.9rem;
  padding: 20px;
}

.htmx-request .htmx-indicator { display: flex; }

.spinner {
  width: 20px; height: 20px;
  border: 3px solid var(--th-border);
  border-top-color: var(--th-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Status Badges ───────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending   { background: #F4F4F4; color: #6B6B6B; }
.status-reviewed  { background: #FFFBEB; color: #B45309; }
.status-interview { background: #EFF6FF; color: #1D4ED8; }
.status-hired     { background: #F0FDF4; color: #15803D; }
.status-rejected  { background: #F9FAFB; color: #6B6B6B; }

/* ─── Status Page ─────────────────────────────────────────────────────────── */
.status-wrapper {
  max-width: 600px;
  margin: 48px auto;
  padding: 0 24px 80px;
}

.status-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.status-card-header {
  background: linear-gradient(135deg, var(--th-red) 0%, var(--th-brown) 100%);
  color: white;
  padding: 32px 36px;
}

.status-card-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.status-card-header p { opacity: 0.85; font-size: 0.95rem; }

.status-card-body { padding: 36px; }

.status-result-card {
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  animation: slideDown 0.3s ease;
}

.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.timeline-step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 2px solid var(--th-border);
  background: var(--th-gray);
  color: var(--th-muted);
}

.timeline-dot.active {
  background: var(--th-red);
  border-color: var(--th-red);
  color: white;
}

.timeline-dot.done {
  background: #15803D;
  border-color: #15803D;
  color: white;
}

.timeline-label { color: var(--th-text); }
.timeline-label.muted { color: var(--th-muted); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .availability-grid { grid-template-columns: 1fr; }
  .detail-body, .detail-header, .detail-actions { padding: 24px 20px; }
  .apply-card-body, .apply-card-header { padding: 24px 20px; }
  .submit-area { flex-direction: column; padding: 20px; }
  .admin-form-grid { grid-template-columns: 1fr; }
}
