/* =====================================================
   QIBLA FINDER — APPLE-LEVEL DESIGN
===================================================== */

/* ---------- ROOT & RESET ---------- */
:root {
  --bg: #ffffff;
  --card-bg: #f9fafb;
  --border: rgba(0, 0, 0, 0.06);

  --text-main: #111827;
  --text-muted: #6b7280;

  --accent: #facc15;
  --accent-dark: #eab308;
  
  --gold: #bfa642c9;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.12);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- BASE ---------- */
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Poppins",
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- APP SHELL ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- HEADER ---------- */
.app-header {
  height: 64px;
  padding: 0 1rem env(safe-area-inset-right) 0
    env(safe-area-inset-left);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255, 255, 255, 0.75);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -.3px;
}

.app-title span {
  color: var(--gold);
}


.header-icon {
  font-size: 1.25rem;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem;          /* ← THIS is the key */
  margin: 0 0.25rem;        /* subtle breathing room */

  transition: transform var(--transition), opacity var(--transition);
}

.app-header {
  height: 64px;
  padding:
    0
    calc(1rem + env(safe-area-inset-right))
    0
    calc(1rem + env(safe-area-inset-left));
}

.header-icon:hover {
  transform: scale(1.0);
  opacity: 0.8;
}



/* ---------- MAIN ---------- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.5rem) max(1rem, env(safe-area-inset-right)) clamp(1.5rem, 4vw, 2.5rem) max(1rem, env(safe-area-inset-left));
}

/* ---------- INTRO ---------- */
.page-intro {
  text-align: center;
  max-width: 420px;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- CARD ---------- */
.qibla-card {
  width: 100%;
  max-width: min(360px, calc(100vw - 2rem));
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 1.75rem);
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition),
    box-shadow var(--transition);
}

.qibla-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ---------- ICON ---------- */
.qibla-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

/* ---------- BUTTON ---------- */
.primary-button {
  width: 100%;
  padding: 1rem 1.2rem;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    var(--accent) 0%,
    var(--accent-dark) 100%
  );
  color: #111827;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.45);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(250, 204, 21, 0.55);
}

.primary-button:active {
  transform: scale(0.97);
}

/* ---------- NOTE ---------- */
.note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- FOOTER ---------- */
.app-footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}



/* ---------- Qibla SVG ICON CONTAINER ---------- */
.qibla-icon {
  display: flex;          /* Enable flexbox */
  justify-content: center; /* Center horizontally */
  align-items: center;     /* Center vertically */
  width: 100%;            /* Take full width of the card */
  margin-bottom: 2rem;    /* Spacing above the button */
  
  /* Keep your cool animation */
  animation: float 4s ease-in-out infinite;
}

.qibla-icon svg {
  display: block;
  max-width: 140px;       /* Controlled size */
  height: auto;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2)); /* Adds depth */
}


/* =====================================================
   DARK & DIM MODES (SYNC WITH theme.css)
===================================================== */


body.dark,
body.dim {
  background: linear-gradient(180deg, #020617 0%, #020617 100%);
}


body.dim {
  background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
}

body.dark .app-header,
body.dim .app-header {
  background: rgba(17, 24, 39, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark .qibla-card,
body.dim .qibla-card {
  background: #111827;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

body.dark .section-subtitle,
body.dark .note,
body.dark .app-footer,
body.dim .section-subtitle,
body.dim .note,
body.dim .app-footer {
  color: #9ca3af;
}

/* ---------- ACCESSIBILITY ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
