:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --primary: #1a73e8;
  --success: #34a853;
  --text-main: #202124;
  --text-muted: #5f6368;
  --divider: #e0e0e0;
}

/* Reset */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: Roboto, system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
  padding: 16px;
}

/* App card container */
.app {
  width: 100%;
  max-width: 420px;
  perspective: 1000px;
}

/* Flip container */
.flip-container {
  position: relative;
  width: 100%;
  min-height: 500px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-container.flipped {
  transform: rotateY(180deg);
}

/* Front and back faces */
.flip-face {
  position: relative;
  width: 100%;
  backface-visibility: hidden;
  background: var(--surface);
  border-radius: 28px;



  padding: 20px 18px 18px;
}

.flip-front {
  position: relative;
}

.flip-back {
  transform: rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
  min-height: 500px;
}

/* Header */
.header { text-align: center; }

.header h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 500;
}

.location {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.live {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--success);
}

/* Date nav */
.date-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin: 16px 0 12px;
}

.nav-btn {
  height: 40px;
  border-radius: 12px;
  border: none;
  background: #e0f0ff;
  color: #1a73e8;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-btn:hover:not(:disabled) { background: #c2e0ff; }

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.current-date {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 500;
}

/* Prayer list */
.prayers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Prayer row */
.prayer {
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}

.prayer:last-child { border-bottom: none; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Sunrise subrow */
.subrow {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Current prayer highlight */
.prayer.current .row span {
  color: var(--primary);
  font-weight: 600;
}

/* Action button */
button.action {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

/* Feedback email */
.feedback {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.feedback a {
  color: var(--primary);
  text-decoration: none;
}

/* Settings button */
button.settings-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Settings content styles */
.settings-content h2 {
  margin-top: 0;
  font-size: 1.2rem;
  margin-bottom: 16px;
  text-align: center;
}

.settings-content label {
  display: block;
  margin-top: 12px;
  font-weight: 500;
}

.settings-content select {
  width: 100%;
  padding: 8px 12px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid #d0d0d0;
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
}

/* Explanation */
.explanation {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.3;
  text-align: center;
}

/* Settings buttons */
.settings-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-actions button {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
}

button.save-btn { background-color: var(--primary); color: #fff; }
button.cancel-btn { background-color: #eee; color: var(--text-main); }

/* Close button */
.close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* =========================
   Card Slider + Tasbih
   ========================= */

/* viewport to hide offscreen card */
.card-viewport{
  width: 100%;
  overflow: hidden;
  border-radius: 28px;
}

/* holds both pages side-by-side */
.card-track{
  display: flex;
  width: 200%;
  transition: transform 0.45s ease;
  will-change: transform;
}

/* each page is full viewport width */
.card-page{
  width: 50%;
  flex: 0 0 50%;
}

.card-page .flip-container{ width: 100%; }

/* UPDATED: Tasbih “pill/link-ish” button under card */
.tasbih-linkwrap{
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

button.tasbih-nav{
  width: auto;
  padding: 8px 14px;       /* smaller */
  border-radius: 999px;    /* pill */
  border: 1px solid #d6e6ff;
  background: #f3f8ff;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
button.tasbih-nav:hover{
  background: #eaf3ff;
}

/* Tasbih card */
.tasbih-card{
  background: var(--surface);
  border-radius: 28px;

  padding: 20px 18px 18px;
  min-height: 500px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.tasbih-header{ text-align: center; }

.tasbih-header h1{
  margin: 0;
  font-size: 1.45rem;
  font-weight: 500;
}

.tasbih-sub{
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* back button inside tasbih */
button.back-btn{
  position: absolute;
  top: 16px;
  left: 16px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: #e0f0ff;
  color: #1a73e8;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Tasbih UI */
.tasbih-body{
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.dhikr-card{
  border: 1px solid var(--divider);
  border-radius: 18px;
  padding: 14px;
}

.dhikr-top{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}

.dhikr-name{
  font-weight: 600;
}

.dhikr-count{
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.progress{
  margin-top: 10px;
  width: 100%;
  height: 10px;
  background: #f0f2f5;
  border-radius: 999px;
  overflow: hidden;
}

.progress > div{
  height: 100%;
  width: 0%;
  background: var(--primary);
}

.dhikr-card.active{
  border-color: #cfe2ff;
  box-shadow: 0 6px 14px rgba(26,115,232,0.10);
}

.dhikr-card.done .dhikr-name{
  color: var(--success);
}

.tasbih-actions{
  margin-top: auto;
  display: flex;
  gap: 10px;
}

button.reset-btn{
  flex: 1;
  padding: 14px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

button.count-btn{
  flex: 2;
  padding: 16px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button.count-btn:active{
  transform: translateY(1px);
}


/* ======================
   Top Bar: Logo + Live Viewers
====================== */
.topbar {
  width: 100%;
  max-width: 420px; /* match your app card width */
  display: flex;
  justify-content: space-between; /* logo left, live right */
  align-items: center;
  margin: 0 auto 12px; /* center horizontally & add spacing below */
  padding-bottom: 20px;
}

.topbar .logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1;
  background: linear-gradient(to bottom, #2fa36b, #0f6f46);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.topbar .logo:hover {
  text-decoration: underline;
}

.topbar .live {
  font-size: 0.9rem;
  font-weight: 500;
  color: #2e7d5a;
  text-align: right;
  white-space: nowrap;
}
