/* ─────────────────────────────────────────────
   PINTAR — Modern Minimalist Slate (Dark Mode)
   Performance: ⚡ 60fps Scrolling  |  WCAG AAA
   ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── DESIGN TOKENS ─────────────────────────── */
:root {
  --blue-600:   #2563eb;
  --blue-500:   #3b82f6;
  --blue-400:   #60a5fa;
  --blue-900:   rgba(59, 130, 246, 0.15);
  
  --green-500:  #10b981;
  --green-900:  rgba(16, 185, 129, 0.15);
  --red-500:    #ef4444;

  --bg:         #090d16;
  --surface:    #131b2e;
  --surface-hover: #18233c;
  --border:     rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);
  
  --muted:      #94a3b8;
  --text:       #f8fafc;
  --text-dim:   #64748b;

  --radius:     14px;
  --radius-sm:  8px;
  --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md:  0 6px 24px rgba(0, 0, 0, 0.35);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul { list-style: none; }
button { cursor: pointer; font: inherit; }
input { font: inherit; color: inherit; }

/* ── BASE ───────────────────────────────────── */
body {
  font-family: var(--font);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── PAGE WRAPPER ───────────────────────────── */
.page-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── TOPBAR / HEADER ───────────────────────── */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 28px;
  box-shadow: var(--shadow-sm);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--blue-400);
}

.logo i { font-size: 1.5rem; }

.topbar-center {
  text-align: center;
}

.topbar-center h1 {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.live-date-line {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 4px;
}

.accent-text { color: var(--blue-400); font-weight: 600; }

.topbar-right {
  display: flex;
  justify-content: flex-end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-900);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--blue-400);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-500);
  animation: pulse 2s ease infinite;
  flex-shrink: 0;
  will-change: box-shadow;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* ── MAIN GRID ──────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  align-items: start;
  gap: 24px;
  content-visibility: auto;
}

.weather-card  { grid-column: 1; grid-row: 1; }
.summary-card  { grid-column: 1; grid-row: 2; }
.calendar-card { grid-column: 2; grid-row: 1; }
.agenda-card   { grid-column: 2; grid-row: 2; }

/* ── CARD ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  contain: layout style paint;
}
.card:hover { 
  border-color: rgba(255, 255, 255, 0.15); 
  box-shadow: var(--shadow-md); 
}

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

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
h2 i { color: var(--blue-400); font-size: 1.2rem; }

/* ── BUTTONS ────────────────────────────────── */
.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover {
  background: var(--blue-900);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--blue-400);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-600);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.primary-btn:hover   { background: #1d4ed8; }
.primary-btn:active  { transform: scale(0.98); }
.primary-btn.compact { padding: 0 16px; height: 40px; }

/* ── INPUTS ─────────────────────────────────── */
input[type="text"],
input[type="time"] {
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  color: var(--text);
}
input[type="text"]:focus,
input[type="time"]:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
input[type="time"] { min-width: 120px; width: auto; color-scheme: dark; }

/* ── SEARCH ROW ─────────────────────────────── */
.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.search-row input { flex: 1; }

/* ── WEATHER ────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 36px 0;
  color: var(--muted);
  font-size: 0.92rem;
  justify-content: center;
}

.spin-icon {
  font-size: 1.5rem;
  color: var(--blue-400);
  animation: spin 1s linear infinite;
  will-change: transform;
}
@keyframes spin { to { transform: rotate(360deg); } }

.weather-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.3s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.weather-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(13, 20, 36, 0.6) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.weather-icon-badge {
  background: var(--blue-900);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.weather-big-icon {
  font-size: 2.8rem;
  line-height: 1;
  color: var(--blue-400);
  display: flex;
}

.weather-hero-details {
  display: flex;
  flex-direction: column;
}

.temp-line {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text);
}
.temp-sup {
  font-size: 1.4rem;
  color: var(--blue-400);
  vertical-align: super;
  font-weight: 500;
}

.weather-condition-pill {
  display: inline-block;
  background: var(--blue-900);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--blue-400);
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 6px;
  width: fit-content;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.location-row i { color: var(--blue-400); font-size: 1.1rem; flex-shrink: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.stat-cell:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: #141f36;
}
.stat-cell i     { font-size: 1.2rem; color: var(--blue-400); }
.stat-label      { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.stat-val        { font-size: 0.88rem; font-weight: 600; color: var(--text); }

/* ── SUMMARY CARD ───────────────────────────── */
.summary-body {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.summary-item i {
  color: var(--green-500);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ── CALENDAR ───────────────────────────────── */
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.calendar-nav h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.calendar-day:hover {
  background: var(--blue-900);
  border-color: rgba(59, 130, 246, 0.3);
}
.calendar-day.other-month {
  color: var(--text-dim);
  background: transparent;
  cursor: default;
}
.calendar-day.other-month:hover {
  background: transparent;
  border-color: transparent;
}
.calendar-day.today {
  background: var(--blue-900);
  border-color: var(--blue-500);
  color: var(--blue-400);
  font-weight: 700;
}
.calendar-day.selected {
  background: var(--blue-600);
  color: #ffffff;
  font-weight: 700;
  border-color: var(--blue-600);
}
.calendar-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-500);
}
.calendar-day.selected.has-event::after {
  background: rgba(255, 255, 255, 0.9);
}

/* ── AGENDA ─────────────────────────────────── */
.agenda-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.agenda-input-row input[type="text"] { flex: 1; min-width: 160px; }

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 6px;
}
.agenda-list::-webkit-scrollbar { width: 5px; }
.agenda-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.event-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeUp 0.25s var(--ease) both;
  transition: border-color 0.15s;
}
.event-item:hover { border-color: rgba(255, 255, 255, 0.15); }

.event-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-900);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-400);
  white-space: nowrap;
  flex-shrink: 0;
}

.event-content {
  flex: 1;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-delete-event {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-size: 1.15rem;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.btn-delete-event i { pointer-events: none; }
.btn-delete-event:hover {
  color: var(--red-500);
  background: rgba(239, 68, 68, 0.12);
}

.empty-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 36px 0;
}

/* ── FOOTER ─────────────────────────────────── */
.page-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.84rem;
  padding: 20px 0 28px;
  border-top: 1px solid var(--border);
}

/* ── UTILITIES ──────────────────────────────── */
.hidden { display: none !important; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 868px) {
  .topbar {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 14px;
  }
  .topbar-right { justify-content: center; }
  .topbar-center h1 { font-size: 2rem; }

  .main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .weather-card, .calendar-card, .agenda-card {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
