:root {
  --bg-dark: #0a0f1e;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --gold: #ffd700;
  --gold-dim: rgba(255, 215, 0, 0.6);
  --text-main: #e0e0e0;
  --text-dim: #a0a0a0;
  --accent: #4a1c40;
  --lantern-gold: #ffc857;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: "Amiri", serif;
  overflow-x: hidden;
  min-height: 100vh;
}

#skyCanvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -2;
}

.pattern-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://www.transparenttextures.com/patterns/islamic-art.png");
  opacity: 0.03;
  z-index: -1;
  pointer-events: none;
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s ease,
    visibility 0.5s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.crescent-loader {
  font-size: 4rem;
  color: var(--gold);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1) rotate(15deg);
    opacity: 1;
  }
}

.loader p {
  margin-top: 20px;
  font-family: "Cinzel", serif;
  color: var(--gold-dim);
  letter-spacing: 2px;
}

/* Lanterns */
.lantern {
  position: fixed;
  font-size: 2.5rem;
  z-index: 10;
  opacity: 0;
  transition: opacity 2s ease;
  filter: drop-shadow(0 0 10px var(--lantern-gold));
  animation: swing 3s infinite ease-in-out;
}

.lantern.visible {
  opacity: 1;
}

.lantern-1 {
  top: 20px;
  left: 5%;
  animation-delay: 0s;
}

.lantern-2 {
  top: 50px;
  right: 8%;
  animation-delay: 0.5s;
}

.lantern-3 {
  top: 150px;
  left: 12%;
  animation-delay: 1s;
}

@keyframes swing {

  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(5deg);
  }
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.location-badge {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--bg-card);
  padding: 8px 15px;
  border-radius: 50px;
  border: 1px solid rgba(255, 215, 0, 0.1);
}

.crescent-icon {
  color: var(--gold);
  font-size: 1.2rem;
}

.city-search-wrapper {
  position: relative;
  /* for absolute positioning of suggestions */
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-input {
  background: transparent;
  border: none;
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  padding: 5px;
  width: 200px;
  outline: none;
}

.city-search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s;
}

.city-search-btn:hover {
  transform: scale(1.2);
}

/* Autocomplete suggestions */
.suggestions-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.suggestions-container.active {
  display: block;
}

.suggestion-item {
  padding: 10px 12px;
  color: var(--text-main);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  transition: background 0.2s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
}

.suggestion-attribution {
  font-size: 0.7rem;
  color: rgba(255, 215, 0, 0.3);
  text-align: center;
  padding: 5px;
}

.date-display {
  font-family: "Cinzel", serif;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 1px;
  background: var(--bg-card);
  padding: 5px 15px;
  border-radius: 50px;
  border: 1px solid rgba(255, 215, 0, 0.1);
}

/* Next Prayer Card */
.next-prayer-card {
  background: linear-gradient(135deg,
      rgba(255, 215, 0, 0.1) 0%,
      rgba(74, 28, 64, 0.3) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  margin-bottom: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.next-prayer-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.next-prayer-label {
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.next-prayer-name {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 10px 0;
  color: var(--gold);
}

.countdown-large {
  font-size: 4rem;
  font-family: "Cinzel", serif;
  font-weight: 600;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.next-prayer-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Progress Section */
.progress-section {
  margin-bottom: 40px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-label {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.progress-percent {
  color: var(--gold);
  font-weight: bold;
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.milestones-container {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.milestone {
  text-align: center;
  flex: 1;
  position: relative;
}

.milestone-dot {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin: 0 auto 8px;
  transition: var(--transition);
  border: 2px solid transparent;
}

.milestone-dot.completed {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.milestone-dot.active {
  background: var(--accent);
  border-color: var(--gold);
  transform: scale(1.3);
}

.milestone-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.milestone-time {
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: bold;
}

/* Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 40px;
}

.time-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}

.time-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-5px);
  border-color: rgba(255, 215, 0, 0.2);
}

.time-card.active {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.05);
}

.time-card.completed {
  opacity: 0.6;
}

.time-card.highlight {
  background: rgba(74, 28, 64, 0.2);
  border-color: rgba(74, 28, 64, 0.5);
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.card-label {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.card-time {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--gold);
}

/* Eid Countdown */
.eid-countdown-container {
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  margin-bottom: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
}

.hijri-date {
  font-family: "Cinzel", serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.eid-countdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.countdown-label {
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.countdown-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Day Info */
.day-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.ramadan-badge {
  background: var(--accent);
  color: var(--gold);
  padding: 5px 15px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-family: "Cinzel", serif;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.phase-indicator {
  background: var(--bg-card);
  color: var(--text-dim);
  padding: 5px 15px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-family: "Cinzel", serif;
  border: 1px solid rgba(255, 215, 0, 0.1);
}

/* Footer */
.urdu-footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 215, 0, 0.05);
}

.urdu-text {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 1.4rem;
  line-height: 2.2;
  color: var(--gold-dim);
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
    gap: 15px;
  }

  .city-input {
    width: 150px;
  }

  .countdown-large {
    font-size: 2.5rem;
  }

  .next-prayer-name {
    font-size: 1.8rem;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .milestone-label {
    display: none;
  }
}
