/*
Author: Ville Heikkiniemi
Date: 2025-10-06
*/

/* COLOR GUIDELINES
   - Page background: very light gray (#f6f8fb)
   - Main text: dark gray (#1f2937)
   - Header background: deep blue (#273e73), text white
   - Table header row: same deep blue, text white
   - Table rows: alternate white (#fff) / light blue (#eef3ff)
   - Borders: light gray (#d0d7e2)
*/

:root {
  --base-size: 1rem;
  --h1-size: 1.6rem;

  --page-bg: #f6f8fb;
  --text: #1f2937;
  --brand: #273e73;
  --table-alt: #eef3ff;
  --border: #d0d7e2;

  --radius: 8px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: var(--base-size);
}

/* Header */
.site-header {
  padding-top: 2rem;
  padding-bottom: 1rem;
  background: var(--brand);
  color: #fff;
}

.site-header h1 {
  font-size: var(--h1-size);
  margin: 0;
  text-align: center;
}

/* Content container with side margins */
.content {
  margin-left: 15%;
  margin-right: 15%;
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* --- NEW: top row split (50% + 50%) --- */
.top-grid {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.student-info,
.controls {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.student-info {
  flex: 1 1 30%;
}

.controls {
  flex: 1 1 70%;
}

.student-info p {
  margin: 0;
}

.student-info p+p {
  margin-top: 0.5rem;
}

.controls-title,
.student-info-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.form-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.form-row input[type="text"] {
  flex: 1 1 auto;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.days-group {
  margin: 0.5rem 0 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.days-group legend {
  padding: 0 0.25rem;
  font-weight: 600;
  color: #334155;
}

.btn {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}

.btn:hover {
  background: #eef2f7;
}

.btn-secondary {
  background: #ffffff;
}

/* Table container */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

/* Header cells */
.table thead th {
  background: var(--brand);
  color: #fff;
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Body cells */
.table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Alternate row color */
.table tbody tr:nth-child(even) {
  background: var(--table-alt);
}

/* Column widths: 40% + 12%*5 = 100% */
.table thead th:nth-child(1),
.table tbody td:nth-child(1) {
  width: 40%;
}

.table thead th:nth-child(n+2),
.table tbody td:nth-child(n+2) {
  width: 12%;
  text-align: center;
}

/* Small screens: stack the top blocks */
@media (max-width: 860px) {
  .content {
    margin-left: 5%;
    margin-right: 5%;
  }

  .top-grid {
    flex-direction: column;
  }
}

/* ≤ 768px: margins 5% */
@media (max-width: 768px) {
  .content {
    margin-left: 5%;
    margin-right: 5%;
  }

  .site-header,
  .intro,
  .other-content {
    display: none;
  }

  .student-info,
  .table-wrap {
    display: block;
  }
}

/* ≤ 640px: margins 1%, show only the table */
@media (max-width: 640px) {
  .content {
    margin-left: 1%;
    margin-right: 1%;
  }

  .student-info {
    display: none;
  }
}