:root {
  --cream: #faf6ef;
  --gold: #c9963a;
  --gold-light: #e8c16e;
  --gold-dark: #8a6420;
  --green: #1a3d2b;
  --green-mid: #2d6148;
  --green-light: #4a8f6a;
  --white: #fffdf8;
  --text-dark: #1c1208;
  --text-mid: #3d2f10;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Lora', Georgia, serif;
  background-color: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,150,58,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(26,61,43,0.08) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9963a' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HEADER */
header {
  position: relative;
  background: linear-gradient(-45deg, #0f2318, var(--green), #1a3d2b, #0a1a11);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  padding: 70px 20px 80px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
  border-bottom: 3px solid var(--gold);
}

.header-ornament {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  color: var(--gold-light);
  filter: drop-shadow(0 0 15px rgba(232, 193, 110, 0.4));
  margin-bottom: 16px;
  animation: fadeDown 0.8s ease forwards 0.2s;
  opacity: 0;
  display: block;
}

header h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  background: linear-gradient(to bottom, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.1em;
  font-weight: 700;
  animation: fadeDown 0.8s ease forwards 0.4s;
  opacity: 0;
}

/* NAVIGATION */
.nav-tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(26, 61, 43, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--gold-dark);
}

.nav-tabs a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 25px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  white-space: nowrap;
}

main {
  max-width: 100%;
  padding: 20px 15px;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tabs a, .nav-item-dropdown {
  flex: 0 0 auto;
  padding: 15px 20px;
}

.nav-tabs a i { color: var(--gold-light); }

.nav-tabs a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* IMSAKIYAH */
.imsakiyah-page {
  background: #fdfaf4;
}

.selector-card {
  margin-bottom: 20px;
  padding: 20px;
  border-top: 3px solid var(--gold-dark);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
  background: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.selection-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.flex-1 {
  flex: 1;
}

.input-field,
#citySelect,
.suggestion-item,
.tab-link {
  cursor: pointer;
}

#citySelect:hover {
  border-color: var(--gold-dark);
  background-color: #fffdf8;
}

.suggestion-item {
  cursor: pointer;
  transition: background 0.2s;
}

.suggestion-item:hover {
  background-color: rgba(201, 150, 58, 0.1);
}

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

.search-results {
  position: absolute;
  width: 100%;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--gold-light);
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Lora', serif;
}

thead {
  background: var(--gold-dark);
  color: white;
}

th {
  padding: 15px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: center;
  color: #444;
}

.today-highlight {
  background-color: rgba(201, 150, 58, 0.15) !important;
  border-left: 5px solid var(--gold-dark);
}

.today-highlight td {
  font-weight: 700;
  color: var(--gold-dark);
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--gold-dark);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--gold-dark);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.d-none { display: none; }
.today-highlight {
  background-color: rgba(201, 150, 58, 0.2) !important;
  border-left: 6px solid #C9963A;
  transform: scale(1.01);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1;
}

.today-highlight td {
  font-weight: 800;
  color: #8B6E37;
}

.today-highlight td:first-child::after {
  font-size: 0.7rem;
  font-style: italic;
  display: block;
  color: #C9963A;
}

/* FOOTER */
footer {
  background: #0a1a11;
  padding: 25px 20px;
  color: #fff;
  text-align: center;
}

footer p {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold-light);
  letter-spacing: 2px;
  font-size: 0.9rem;
}