:root {
  --bg-1: #0c0f1a;
  --bg-2: #151b2b;
  --accent: #f7c948;
  --accent-2: #57c7ff;
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.15);
  --text: #f5f7ff;
  --muted: rgba(245, 247, 255, 0.7);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, #2a3152 0%, transparent 60%),
    radial-gradient(1200px 800px at 120% 20%, #243a60 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px;
  min-height: 100vh;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.toolbar-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.toolbar-link:hover {
  color: var(--text);
}

.top-row,
.bottom-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.time-card {
  grid-column: span 6;
}

.weather-card {
  grid-column: span 6;
}

.events-card {
  grid-column: span 12;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.clock {
  font-size: clamp(2.8rem, 3.5vw, 4.5rem);
  font-weight: 700;
}

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

.weather-icon {
  width: 96px;
  height: 96px;
}

.weather-temp {
  font-size: clamp(2.2rem, 3vw, 3.5rem);
  font-weight: 700;
}

.weather-label,
.weather-wind {
  color: var(--muted);
  font-size: 1.1rem;
}

.weather-location {
  color: var(--muted);
  font-size: 1rem;
}

.weather-attrib {
  margin-top: 6px;
  font-size: 0.85rem;
}

.weather-attrib a {
  color: var(--muted);
  text-decoration: none;
}

.weather-attrib a:hover {
  color: var(--text);
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.events-refreshed {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.events-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.events-refresh {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 15, 26, 0.7);
  color: var(--text);
  cursor: pointer;
}

.event-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(12, 15, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.event-time,
.event-location {
  color: var(--muted);
  font-size: 0.95rem;
}

.event-time {
  white-space: pre-line;
  line-height: 1.3;
}

.event-countdown {
  font-size: 1.1rem;
  color: var(--accent);
}

.event-empty {
  color: var(--muted);
  font-size: 1.1rem;
}

.music-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.music-cover {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  object-fit: cover;
}

.music-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-track {
  font-size: 1.2rem;
  font-weight: 600;
}

.music-artist {
  color: var(--muted);
}

.apple-music-connect,
.apple-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.music-note {
  margin-top: 12px;
  color: var(--muted);
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 90vw);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-title {
  font-size: 2.2rem;
  font-weight: 700;
}

.login-subtitle {
  color: var(--muted);
  margin: 8px 0 20px;
}

.apple-button {
  background: #000;
  color: #fff;
}

.apple-logo {
  font-size: 1.4rem;
}

.login-warning {
  color: var(--accent);
}

.admin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.admin-card {
  width: min(720px, 92vw);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

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

.admin-title {
  font-size: 2rem;
  font-weight: 700;
}

.admin-link {
  color: var(--muted);
  text-decoration: none;
}

.admin-link:hover {
  color: var(--text);
}

.admin-message {
  background: rgba(87, 199, 255, 0.15);
  border: 1px solid rgba(87, 199, 255, 0.4);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.admin-error {
  background: rgba(247, 201, 72, 0.15);
  border: 1px solid rgba(247, 201, 72, 0.5);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 20, 0.6);
  color: var(--text);
  font-size: 1rem;
}

.admin-textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-input::placeholder {
  color: rgba(245, 247, 255, 0.4);
}

.admin-help {
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-save {
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #0c0f1a;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 1200px) {
  .time-card,
  .weather-card,
  .events-card,
  .music-card {
    grid-column: span 12;
  }

  .events-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
