/* =========================
   ROOT VARIABLES
========================= */
:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --card-bg-secondary: #eef1f5;

  --text: #333;
  --text-light: #555;
  --text-muted: #777;

  --accent: #4a6cf7;

  --radius: 18px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);

  --shadow-soft: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-strong: 0 6px 22px rgba(0,0,0,0.14);
}

/* =========================
   BASE
========================= */
body {
  margin: 0;
  padding: 40px 20px;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h1 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.6em;
  font-weight: 700;
}

/* =========================
   CARDS (GLOBAL)
========================= */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.15);
}

.card-title {
  font-size: 1.4em;
  font-weight: 600;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.card-header img {
  width: 48px;
  height: 48px;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-tracker {
  box-shadow: var(--shadow-strong);
  background: var(--card-bg);
  border-left: 8px solid var(--accent);
  display: block;
}

/* =========================
   BUTTONS
========================= */
.btn-update {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-update:hover {
  filter: brightness(1.1);
}

/* =========================
   TEXT HELPERS
========================= */
.status {
  font-weight: bold;
}

.label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.value {
  font-size: 0.9rem;
  text-align: right;
}

.datetime {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 6px;
}

/* =========================
   METRICS
========================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.metric-box {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.metric-value {
  font-size: 1.4em;
  font-weight: bold;
}

.metric-label {
  font-size: 0.85em;
  color: var(--text-light);
}

/* =========================
   WEEK / TRAINING GRID
========================= */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-box {
  min-height: 70px;
  padding: 6px;
  font-size: 13px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.day-box.today {
  outline: 2px solid #5cb85c;
  outline-offset: 2px;
}

/* --- Sports --- */
.day-box.WeightTraining,
.day-box.training {
  background: #d7ffd9;
  border-color: #62c46b;
}

.day-box.Run {
  background: #d6ecff;
  border-color: #7fb8e6;
}

.day-box.Ride {
  background: #ffe7c2;
  border-color: #e0a86a;
}

.day-box.Hike {
  background: #e9e6ff;
  border-color: #a39bdd;
}

.day-title {
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
}

.muscle {
  font-size: 11px;
  line-height: 1.2;
}

/* =========================
   LAYOUT SECTIONS
========================= */
.top-widgets {
  max-width: 1600px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}

.top-widgets h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.top-widgets .card {
  box-shadow: var(--shadow-soft);
  background: var(--card-bg-secondary);
  border-left: 4px solid #cfd6ff;
  padding: 14px 16px;
  font-size: 0.85rem;
}

.tracker-section {
  max-width: 1600px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 32px;
}

.tracker-section .card {
  padding: 28px;
}

.tracker-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.card-tracker:focus-within {
  outline: 3px solid rgba(74,108,247,0.25);
  outline-offset: 2px;
}

/* =========================
   WEATHER
========================= */
.weather-station {
  margin-bottom: 12px;
}

.weather-station strong {
  font-size: 1.05em;
}

.card-weather-mini {
  min-width: 300px;
  max-width: 350px;
  padding: 12px 14px;
  background: #eef3ff;
  border-left: 4px solid #4cafef;
  font-size: 0.85rem;
}

/* =========================
   WEBCAM
========================= */
.webcam-section {
  max-width: 1200px;
  margin: 80px auto 0;
}

.webcam-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

.card-webcam {
  background: #111;
  color: #fff;
}

/* =========================
   MISC
========================= */
.tracker-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.site-title {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(90deg, #4a6cf7, #6b8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 4px;
}


/* =========================
   STATUS / URGENCY
========================= */

.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-date {
  margin-left: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Levels --- */

.status-ok {
  background: #e6f7ea;
  color: #2f8f46;
}

.status-warn {
  background: #fff3e0;
  color: #b26a00;
}

.status-alert {
  background: #fdecea;
  color: #b3261e;
}


@media (max-width: 768px) {
  .top-widgets {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }

  .header-left,
  .header-center,
  .header-right {
    justify-self: center;
    width: 100%;
  }

  .card-weather-mini {
    margin: 0 auto;
    max-width: 100%;
  }

  .header-right {
    display: flex;
    justify-content: center;
    gap: 12px;
  }
}
