:root {
  --primary-color: #d45a2a;
  --primary-hover: #e86b3a;
  --text-color: #222;
  --bg-color: #fff;
  --light-gray: #f5f5f5;
  --progress-bg: #f5f5f5;
  --progress-text: #333;
  --card-bg: #ffffff;
  --card-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  --select-bg: #fff;
  --select-border: #ddd;
}

[data-theme="dark"] {
  --primary-color: #ff7d4d;
  --primary-hover: #ff9a73;
  --text-color: #f5f5f5;
  --bg-color: #1a1a2e;
  --light-gray: #2a2a3e;
  --progress-bg: #2a2a3e;
  --progress-text: #f5f5f5;
  --card-bg: #252540;
  --card-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  --select-bg: #2a2a3e;
  --select-border: #3a3a4e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Roboto", "Poppins", "Open Sans", "Inter", "Noto Sans", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 20px;
  transition:
    background-color 0.3s,
    color 0.3s;
}

/* ========== Container ========== */

.container {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

/* ========== Header ========== */

.header {
  margin-bottom: 30px;
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
}

.header h1 {
  font-size: 3rem;
  margin-bottom: 10px;
}

.header h1 span {
  color: var(--primary-color);
  font-weight: bold;
}

.theme-toggle {
  position: absolute;
  right: 0;
  top: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* ========== Countdown ========== */

.countdown {
  font-size: 5rem;
  font-weight: bold;
  margin: 20px 0;
}

.time-labels {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin-bottom: 40px;
}

.time-label {
  font-size: 1.5rem;
}

/* ========== Progress Bar ========== */

.progress-container {
  width: 100%;
  height: 40px;
  background-color: var(--progress-bg);
  border-radius: 20px;
  margin-bottom: 30px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 20px;
  transition: width 1s;
  z-index: 5;
}

.percentage {
  position: absolute;
  color: var(--progress-text);
  font-weight: bold;
  z-index: 20;
  padding: 0 10px;
  line-height: 40px;
  transition:
    left 1s,
    transform 1s;
  top: 0;
}

/* ========== Location Selector ========== */

.location {
  font-size: 1.4rem;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.location svg {
  flex-shrink: 0;
}

.location svg path {
  stroke: var(--text-color);
  transition: stroke 0.3s;
}

.location-selectors {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.location-selectors select {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--select-border);
  background-color: var(--select-bg);
  color: var(--text-color);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.3s,
    background-color 0.3s,
    color 0.3s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  min-width: 140px;
}

.location-selectors select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.location-selectors select:hover {
  border-color: var(--primary-color);
}

/* ========== Date ========== */

.date {
  font-size: 1.5rem;
  margin-bottom: 40px;
}

/* ========== Prayer Times ========== */

.prayer-times {
  display: flex;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
}

.prayer-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px;
  flex: 1;
  min-width: 90px;
}

.prayer-name {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.active {
  color: var(--primary-color);
  font-weight: bold;
}

.prayer-hour {
  font-size: 1.8rem;
  font-weight: bold;
}

/* ========== Error ========== */

.error-message {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 20px 0;
  text-align: center;
  padding: 20px;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  background-color: rgba(212, 90, 42, 0.1);
}

/* ========== Loading ========== */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--light-gray);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 1.2rem;
  color: var(--text-color);
  opacity: 0.7;
}

/* ========== Disclaimer ========== */

.disclaimer {
  margin-top: 30px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
  padding: 10px;
  border-top: 1px solid var(--light-gray);
}

/* ========== Responsive ========== */

@media (max-width: 600px) {
  .countdown {
    font-size: 3.5rem;
  }

  .time-label {
    font-size: 1.2rem;
  }

  .prayer-times {
    justify-content: center;
  }

  .prayer-time {
    min-width: 80px;
  }

  .theme-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
  }

  .header h1 {
    font-size: 2.2rem;
    text-align: center;
    width: 100%;
  }

  .location-selectors select {
    min-width: 120px;
    font-size: 0.9rem;
  }
}
