/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --green:        #1B4332;
  --green-mid:    #2D6A4F;
  --gold:         #C9A84C;
  --gold-light:   #EDD98A;
  --bg:           #FAF7F2;
  --bg-card:      #FFFFFF;
  --text:         #2C2C2C;
  --text-muted:   #6B7280;
  --border:       #E5DDD3;
  --open-bg:      #DCFCE7;
  --open-text:    #166534;
  --closed-bg:    #F3F4F6;
  --closed-text:  #6B7280;
  --shadow:       0 2px 10px rgba(0, 0, 0, 0.07);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  line-height: 1.25;
}

address {
  font-style: normal;
}

a {
  color: inherit;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 2.5rem 0;
}

/* ── Section header ────────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 0.35rem;
}

.section-divider {
  width: 2.75rem;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-bottom: 1.4rem;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 20vh;
  display: flex;
  align-items: stretch;
  background-color: var(--green);
  background-image: url('../images/mosque.jpeg');
  background-size: 100% auto;
  background-position: center 50%;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(27, 67, 50, 0.15) 0%,
    rgba(27, 67, 50, 0.65) 50%,
    rgba(27, 67, 50, 0.96) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.25rem 1.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-logo {
  display: block;
  margin: 0 auto 0.85rem;
  opacity: 0.9;
}

.mosque-name {
  font-size: 2.4rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  letter-spacing: -0.01em;
}

.mosque-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--gold-light);
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
}

.mosque-address {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.85rem;
  letter-spacing: 0.01em;
}

/* ── Prayer Times ──────────────────────────────────────────────────────────── */
.prayer-times {
  background: var(--bg);
}

.today-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* Date navigation */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.date-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--green);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.date-nav-btn:hover,
.date-nav-btn:focus-visible {
  background: #F0F7F4;
  border-color: var(--green);
}

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

.date-nav .today-date {
  min-width: 0;
  flex: 1;
}

/* Demo banner */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #FEF9C3;
  border: 1px solid #FDE047;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  color: #713F12;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.demo-banner code {
  font-family: monospace;
  background: rgba(0,0,0,0.06);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* Prayer list */
.prayer-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.prayer-list-header,
.prayer-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
}

.prayer-list-header {
  background: var(--green);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.prayer-list-header span {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
}

.prayer-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.prayer-row:last-child {
  border-bottom: none;
}

.prayer-row.is-closed {
  opacity: 0.45;
}

.prayer-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.prayer-time {
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-badge.open {
  background: var(--open-bg);
  color: var(--open-text);
}

.status-badge.closed {
  background: var(--closed-bg);
  color: var(--closed-text);
}

/* Friday note */
.friday-note {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: #FFFBEB;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

/* Loading / fallback */
.loading-msg,
.fallback-msg {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.75rem 0;
}

/* ── Open House ────────────────────────────────────────────────────────────── */
.open-house {
  background: var(--green);
}

.open-house .section-title {
  color: var(--gold-light);
}

.open-house .section-divider {
  background: var(--gold);
  opacity: 0.7;
}

.event-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
}

.event-date {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}

.event-time {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.event-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}

.no-event {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* ── About ─────────────────────────────────────────────────────────────────── */
.about {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-subheading {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--green);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.about-subheading em {
  font-style: italic;
  color: var(--green);
}

.about-text {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
}

.about-text + .about-text {
  margin-top: 1rem;
}

.about-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1.5px solid var(--gold);
  padding-bottom: 0.1rem;
  line-height: 1.5;
}

.about-link:hover,
.about-link:focus {
  color: var(--green-mid);
  border-bottom-color: var(--green-mid);
}

.motto-quote {
  border-left: 4px solid var(--gold);
  padding: 0.6rem 1.1rem;
  margin: 1.25rem 0;
  border-radius: 0 6px 6px 0;
  background: #FAF6EC;
}

.motto-quote p {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--green);
  font-weight: 600;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--green);
  color: rgba(255, 255, 255, 0.65);
  padding: 2.25rem 0 2rem;
  text-align: center;
}

.footer-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.4rem;
}

.footer-address {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.footer-contact {
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
}

.footer-contact a {
  color: var(--gold-light);
  text-decoration: none;
}

.footer-contact a:hover,
.footer-contact a:focus {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.775rem;
  color: rgba(255, 255, 255, 0.3);
}

/* ── Desktop enhancements ──────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .mosque-name {
    font-size: 3rem;
  }

  .hero {
    min-height: 20vh;
    background-size: cover;
    background-position: center 40%;
  }

  .hero-content {
    padding: 2.5rem 2rem 3.25rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .prayer-list-header,
  .prayer-row {
    padding-left: 1.4rem;
    padding-right: 1.4rem;
  }

  .event-card {
    padding: 1.5rem 1.75rem;
  }
}

@media (min-width: 900px) {
  section {
    padding: 3.5rem 0;
  }

  .hero {
    min-height: 20vh;
  }
}


/* ── Admin Panel ───────────────────────────────────────────────────────────── */
/* (Included here so admin.html can share this stylesheet) */

.admin-body {
  background: #F4F6F8;
  min-height: 100vh;
}

/* Login */
.login-view:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-logo {
  margin-bottom: 1rem;
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.2rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* Admin header */
.admin-header {
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
}

/* Admin main content */
.admin-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Admin cards */
.admin-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.4rem 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  line-height: 1.5;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--green);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  background: var(--green);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  background: var(--green-mid);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #991B1B;
  background: #FEE2E2;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: #FECACA;
}

.btn-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  min-height: 44px;
  text-decoration: underline;
}

.btn-link:hover {
  color: white;
}

/* File upload zone */
.upload-zone {
  position: relative;
  margin-bottom: 0.85rem;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.upload-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s;
  min-height: 52px;
}

.upload-zone:hover .upload-label,
.upload-zone:focus-within .upload-label {
  border-color: var(--green);
  background: #F0F7F4;
}

.upload-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

#file-name-display {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toggle switches */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: white;
  gap: 0.75rem;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.toggle-default-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toggle-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.override-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.btn-link-muted {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.825rem;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: underline;
  margin-top: 0.25rem;
}

.btn-link-muted:hover {
  color: var(--text);
}

.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 27px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #D1D5DB;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-track {
  background: var(--green);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(21px);
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Status messages */
.status-msg {
  font-size: 0.85rem;
  padding: 0.5rem 0;
  min-height: 1.5rem;
}

.status-msg.success { color: var(--open-text); }
.status-msg.error   { color: #991B1B; }
.status-msg.info    { color: var(--text-muted); }

/* 5-Day Schedule */
.schedule-day {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.schedule-day:last-child {
  margin-bottom: 0;
}

.schedule-day-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}

.schedule-day-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.today-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #065F46;
  background: #D1FAE5;
  border: 1px solid #6EE7B7;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.schedule-prayer-list {
  display: flex;
  flex-direction: column;
}

.schedule-prayer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: white;
  gap: 0.75rem;
}

.schedule-prayer-row:last-child {
  border-bottom: none;
}

.schedule-prayer-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.schedule-prayer-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.schedule-prayer-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.schedule-prayer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Error msg (login) */
.error-msg {
  font-size: 0.875rem;
  color: #991B1B;
  background: #FEE2E2;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}
