:root {
  --bg: #ffffff;
  --card-bg: #ffffff;
  --surface: #f8f9fa;
  --primary: #ed3d54;
  --primary-dark: #d42a41;
  --primary-light: #fdeaed;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #e9e9ec;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 20px rgba(33, 37, 41, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
#site-header {
  background: #ffffff;
  color: var(--text);
  border-bottom: 3px solid var(--text);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--border);
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.tagline {
  margin: 2px 0 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}

/* Main content */
#main-content {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 20px 60px;
}

.section-title {
  font-size: 1.35rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  color: var(--primary);
  font-size: 1rem;
}

.timezone-note {
  margin: 0 0 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.timezone-note i {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Event card */
.event-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  gap: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.event-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--primary);
  transform: translateY(-1px);
}

.event-date-badge {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  border: 1px solid var(--border);
}

.badge-month {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.badge-day {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.event-date-badge.is-range {
  width: 66px;
}

.badge-day-range {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.event-body {
  flex: 1;
  min-width: 0;
}

.event-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.event-title {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.chip-highlight {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.chip-multiday {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.chip-multiday i {
  margin-right: 2px;
}

.event-meta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.event-meta-row i {
  width: 14px;
  text-align: center;
  color: #adb0b4;
}

.event-description {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-description a {
  color: var(--primary);
}

/* States */
.loading-state, .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.loading-state i, .empty-state i {
  font-size: 1.6rem;
  margin-bottom: 10px;
  display: block;
  color: var(--primary);
}

.empty-state.error-state i {
  color: #b3261e;
}

/* Footer */
#site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    align-self: flex-end;
  }
  .brand-divider {
    display: none;
  }
  .event-card {
    padding: 14px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.logout-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Login page */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 44px 40px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.login-logo {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto 22px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.login-subtitle {
  margin: 0 0 24px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
  background: var(--surface);
}

.login-input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

.login-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.login-submit:hover {
  background: var(--primary-dark);
}

.login-error {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: #b3261e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
