/* =============================================
   Jadwal Buka Puasa Masjid Jogja — style.css
   ============================================= */

/* ── VARIABLES ── */
:root {
  --gold: #C9933A;
  --gold-light: #F0C97A;
  --gold-pale: #FDF3DC;
  --gold-border: rgba(201, 147, 58, 0.2);
  --teal: #1A5C4E;
  --teal-light: #2D8A74;
  --teal-dark: #0C3328;
  --night: #070F0D;
  --cream: #FEFAF2;
  --cream2: #F5EDD8;
  --text: #1C1C1C;
  --text-soft: #6B6452;
  --card-bg: #FFFFFF;
  --border: rgba(201, 147, 58, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 32px rgba(26, 92, 78, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.header {
  background: var(--teal-dark);
  position: relative;
  overflow: hidden;
  padding: 36px 24px 100px;
  text-align: center;
}

.header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(201, 147, 58, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(45, 138, 116, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

/* Islamic geometric pattern */
.header-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(255, 255, 255, 0.5) 0deg 15deg,
    transparent 15deg 30deg
  );
  background-size: 60px 60px;
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 2;
}

/* Stars canvas area */
.stars {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--d) ease-in-out infinite;
  animation-delay: var(--delay);
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: var(--opacity); transform: scale(1.5); }
}

/* Moon */
.moon-svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: block;
  animation: floatMoon 5s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(240, 201, 122, 0.4));
}

@keyframes floatMoon {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%       { transform: translateY(-10px) rotate(5deg); }
}

.header h1 {
  font-family: 'Amiri', serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  color: var(--gold-light);
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.header-sub {
  font-size: 0.78rem;
  color: rgba(255, 250, 235, 0.45);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 10px;
}

.header-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  line-height: 0;
}

/* ══════════════════════════════════════════
   DATE NAVIGATOR STRIP
══════════════════════════════════════════ */
.date-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--teal-dark);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.date-strip-outer {
  overflow: hidden;
  position: relative;
}

/* Fade edges */
.date-strip-outer::before,
.date-strip-outer::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}

.date-strip-outer::before {
  left: 0;
  background: linear-gradient(to right, var(--teal-dark), transparent);
}

.date-strip-outer::after {
  right: 0;
  background: linear-gradient(to left, var(--teal-dark), transparent);
}

.date-strip {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.date-strip::-webkit-scrollbar {
  display: none;
}

/* Each date pill */
.date-pill {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 40px;
  cursor: pointer;
  border: 1.5px solid rgba(201, 147, 58, 0.2);
  background: transparent;
  color: rgba(255, 250, 235, 0.5);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 58px;
  font-family: 'DM Sans', sans-serif;
  user-select: none;
}

.date-pill:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(201, 147, 58, 0.08);
}

.date-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--teal-dark);
  font-weight: 600;
  box-shadow: 0 0 18px rgba(201, 147, 58, 0.4);
}

.date-pill.today-pill:not(.active) {
  border-color: rgba(201, 147, 58, 0.6);
  color: var(--gold-light);
}

.pill-day   { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.pill-num   { font-size: 1.05rem; font-weight: 700; line-height: 1.1; }
.pill-r     { font-size: 0.56rem; opacity: 0.75; }

/* ══════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════ */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ── Search Bar ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(45, 138, 116, 0.1);
}

.search-bar svg {
  color: var(--text-soft);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
}

.search-bar input::placeholder {
  color: #bbb;
}

.search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.2s;
  display: none;
}

.search-clear:hover { color: var(--text); }
.search-clear.visible { display: block; }

.search-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}

/* ── Day Arrows ── */
.day-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.nav-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(26, 92, 78, 0.3);
}

.nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.nav-label {
  font-size: 0.8rem;
  color: var(--text-soft);
  min-width: 110px;
  text-align: center;
  font-weight: 500;
}

/* ── Day Header ── */
.day-header {
  text-align: center;
  margin-bottom: 28px;
}

.day-date-big {
  font-family: 'Amiri', serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--teal);
  line-height: 1.25;
}

.day-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-ramadan {
  background: var(--gold-pale);
  color: var(--gold);
  border: 1px solid rgba(201, 147, 58, 0.3);
}

.badge-today {
  background: var(--teal);
  color: white;
}

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Individual Card ── */
.mosque-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}

.mosque-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: var(--radius) var(--radius) 0 0;
}

.mosque-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-hover);
  border-color: rgba(201, 147, 58, 0.35);
}

.card-index {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gold-pale);
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-mosque {
  font-size: 0.71rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--teal);
  margin-bottom: 10px;
  padding-right: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.card-mosque svg {
  width: 13px; height: 13px;
  flex-shrink: 0;
}

.card-menu {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.55;
}

.card-menu.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-no-menu {
  font-size: 0.83rem;
  color: #ccc;
  font-style: italic;
}

.card-expand {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.2s;
}
.card-expand:hover { color: var(--teal-light); }

/* ── Card pop animation with stagger ── */
@keyframes cardPop {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-animated {
  animation: cardPop 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Content transitions ── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.slide-right { animation: slideInRight 0.35s cubic-bezier(0.4, 0, 0.2, 1) both; }
.slide-left  { animation: slideInLeft 0.35s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* ── Day Stats ── */
.day-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* ── Empty / No results ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-soft);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.25;
}

/* ── Search result date group ── */
.result-group {
  margin-bottom: 36px;
}

.result-group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.result-group-date {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--teal);
}

.jump-btn {
  margin-left: auto;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 5px 13px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: background 0.2s;
}
.jump-btn:hover { background: var(--teal-light); }

/* ══════════════════════════════════════════
   SCROLL TO TOP
══════════════════════════════════════════ */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 44px; height: 44px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(12, 51, 40, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}

.scroll-top.show {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ══════════════════════════════════════════
   LOADING SCREEN
══════════════════════════════════════════ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--teal-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-moon {
  width: 60px; height: 60px;
  animation: floatMoon 2s ease-in-out infinite;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 16px rgba(240, 201, 122, 0.5));
}

.loading-text {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 24px 14px 60px;
  }

  .day-nav {
    gap: 10px;
  }

  .nav-label {
    font-size: 0.72rem;
    min-width: 90px;
  }

  .day-stats {
    gap: 16px;
  }
}

@media (min-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
