:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --primary: #0ea5e9;
  --primary-light: #e0f2fe;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #1e293b;
    --surface-hover: #334155;
    --primary: #38bdf8;
    --primary-light: #0284c7;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);

    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.brand h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.date-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Switch */
.notify-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
}
.notify-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.notify-label {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.1;
}
.notify-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); transition: 0.3s; border-radius: 99px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--text-main); transition: 0.3s; border-radius: 50%; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); background: #fff; }

/* Hero */
.hero-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
}

@media (prefers-color-scheme: dark) {
  .hero-card {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
  }
}

.hero-top, .hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.hero-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
}

.hero-countdown {
  font-size: 1.6rem;
  font-weight: 800;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Grid */
.schedule-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.prayer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.prayer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.prayer-card.passed {
  opacity: 0.5;
  filter: grayscale(0.5);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.card-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.arrives-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.time-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--bg);
}

.time-block.highlight {
  background: var(--primary-light);
  color: var(--primary);
}

@media (prefers-color-scheme: dark) {
  .time-block.highlight {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
  }
}

.tb-label {
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tb-time {
  font-weight: 800;
  font-size: 1.15rem;
}

/* Responsive constraints */
@media (max-width: 600px) {
  .app-container { padding: 1.25rem 1rem; }
  .hero-card { padding: 1.5rem; gap: 1rem; }
  .hero-title { font-size: 2rem; }
  .hero-time { font-size: 1.25rem; }
  .hero-countdown { font-size: 1.4rem; width: 100%; text-align: left; }
  .times-grid { grid-template-columns: 1fr; }
}
