/* Import ITC Benguiat Font */
@import url('https://fonts.cdnfonts.com/css/itc-benguiat');

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  line-height: 1.6;
  color: #333;
  background-color: #f4f6f9;
}

/* Header & Navigation (Centered Layout) */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background-color: #43682b;
  color: #fff;
  gap: 1.25rem;
}

header .logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-img {
  max-height: 85px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

nav a:hover, 
nav a.active {
  opacity: 0.85;
  text-decoration: underline;
}

/* Dropdown Menu Styles (Seamless Hover) */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown-btn {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dropdown-btn .arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fbfbf8;
  min-width: 250px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.75rem 0;
  z-index: 1000;
  border: 1px solid #e2decb;
}

/* Invisible bridge preventing mouseout when hovering */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  height: 15px;
  background: transparent;
}

.dropdown-menu a {
  color: #2b3a22;
  padding: 0.65rem 1.25rem;
  display: block;
  font-family: 'ITC Benguiat', 'Times New Roman', Georgia, serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-menu a:hover {
  background-color: #edf2e8;
  color: #43682b;
  text-decoration: none;
  opacity: 1;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.nav-dropdown:hover .arrow {
  transform: rotate(180deg);
}

nav .btn-donate {
  background-color: #d4af37;
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  color: #000;
  font-weight: bold;
  text-decoration: none !important;
  transition: background-color 0.2s ease;
}

nav .btn-donate:hover {
  background-color: #c49f2e;
}

/* Prayer Times & Events Sections */
.prayer-times, .events {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

.prayer-times h2, .events h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #43682b;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

.time-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.time-card.highlight {
  border: 2px solid #d4af37;
  background-color: #fffdf0;
}

.time-card span {
  display: block;
  font-size: 0.9rem;
  color: #666;
}

.time-card strong {
  font-size: 1.2rem;
  color: #43682b;
}

.events ul {
  list-style: none;
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.events li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.events li:last-child {
  border-bottom: none;
}

/* Past events styling in homepage list */
.events li.event-past {
  opacity: 0.6;
}

.past-badge {
  display: inline-block;
  background-color: #888;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-weight: 600;
  vertical-align: middle;
}

.events-subheading {
  padding: 0.6rem 0 0.3rem 0;
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
  border-top: 1px dashed #ddd;
  margin-top: 0.75rem;
}

/* =========================================
   CALENDAR PAGE SPECIFIC STYLES
   ========================================= */

.calendar-page {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.calendar-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
}

.full-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.full-calendar-header h1 {
  font-size: 2rem;
  color: #43682b;
}

.nav-btn {
  background-color: #43682b;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s;
}

.nav-btn:hover {
  background-color: #314d1f;
}

.add-event-box {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.event-box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.event-box-top h3 {
  color: #43682b;
  font-size: 1.1rem;
}

.delete-toggle-btn {
  background-color: #c62828;
  color: #fff;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.delete-toggle-btn:hover {
  background-color: #a31f1f;
}

.delete-toggle-btn.active-mode {
  background-color: #455a64;
}

.delete-toggle-btn.active-mode:hover {
  background-color: #37474f;
}

.delete-notice {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #c62828;
}

.event-form-inputs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.event-form-inputs input[type="date"],
.event-form-inputs input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}

.event-form-inputs input[type="text"] {
  flex-grow: 1;
}

.add-btn {
  background-color: #43682b;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.add-btn:hover {
  background-color: #314d1f;
}

/* 7-Column Grid Setup */
.full-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: bold;
  background-color: #43682b;
  color: #fff;
  border-radius: 6px 6px 0 0;
  padding: 0.75rem 0;
}

.full-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.grid-cell {
  min-height: 100px;
  border-right: 1px solid #e0e0e0;
  border-top: 1px solid #e0e0e0;
  padding: 0.5rem;
  background-color: #fff;
}

.grid-cell.empty {
  background-color: #f9f9f9;
}

.date-num {
  font-weight: bold;
  color: #555;
  margin-bottom: 0.5rem;
}

.event-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  word-break: break-word;
}

.event-tag.custom-event {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-left: 3px solid #43682b;
}

/* Delete Mode Active State for Calendar Event Tags */
.delete-mode-active .event-tag.custom-event {
  background-color: #ffebee;
  color: #c62828;
  border-left: 3px solid #c62828;
  cursor: pointer;
  box-shadow: 0 0 0 1px #ef9a9a;
}

.delete-mode-active .event-tag.custom-event:hover {
  background-color: #ffcdd2;
}

.delete-btn-x {
  display: none;
  font-weight: bold;
  margin-left: 0.35rem;
  font-size: 0.85rem;
}

.delete-mode-active .delete-btn-x {
  display: inline;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  background-color: #222;
  color: #fff;
  margin-top: 3rem;
}

/* --- EDIT PRAYER TIMES ADDITION --- */
.prayer-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.prayer-section-header h2 {
  margin: 0;
}

.edit-prayers-btn {
  background: #f0f3f0;
  color: #3b5323;
  border: 1px solid #3b5323;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-prayers-btn:hover {
  background: #3b5323;
  color: #ffffff;
}

.prayer-edit-box {
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-top: 20px;
  border-top: 3px solid #3b5323;
}

.prayer-edit-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.prayer-edit-inputs label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: bold;
  color: #3b5323;
  gap: 6px;
}

.prayer-edit-inputs input {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.95rem;
}

.prayer-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.save-prayers-btn {
  background: #3b5323;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.cancel-prayers-btn {
  background: #e0e0e0;
  color: #333;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}