/* 🌙 Hijri Calendar Styles */
/* Inherits from style.css – Hijri-specific overrides and additions */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ===========================
     Layout & Structure
  =========================== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  direction: rtl;
  transition: all 0.3s ease-in-out;
}

.calendar-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
}

.calendar-header .month-title {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1;
  font-size: 1.25rem;
  gap: 1rem;
}

.calendar-header .month-title span {
  white-space: nowrap;
}

.calendar-header #backToday {
  display: none;
  background-color: #198754;
  color: #fff;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  font-size: 1.2rem;
  white-space: nowrap;
  margin: 0 1rem;
  transition: background-color 0.3s ease;
}

.calendar-header #backToday:hover {
  background-color: #146c43;
  color: #fff;
}

/* ===========================
     Calendar Day Styling
  =========================== */
.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-weight: bold;
  background: #f9f9f9;
  padding: 8px;
}

.calendar-day.today {
  background-color: #ffd700 !important;
  color: black;
}

.calendar-day.friday,
.calendar-day.weekend,
.calendar-day.saturday {
  background-color: #dff0ff;
  color: #005577;
}

.calendar-day.holiday {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  box-shadow: 0 0 5px #ffeeba;
}

.calendar-day div:first-child {
  color: #198754;
  /* Hijri green */
}

.calendar-day div:last-child {
  color: #0d6efd;
  /* Gregorian blue */
}

/* ===========================
     Output Styles
  =========================== */
.output-text.hijri {
  color: #198754;
}

.output-text.gregorian {
  color: #0d6efd;
}

.output-box .badge-weekday {
  font-size: 1.8rem;
  font-weight: 600;
  background-color: #0d6efd;
  color: white;
  padding: 0.4em 1em;
  border-radius: 1.25rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.output-box .timezone-label {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

/* ===========================
     Custom Date Picker
  =========================== */
.custom-date {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  margin-top: 2rem;
}

.col-md-3 {
  flex: auto;
  width: auto;
}

.custom-date select,
.custom-date input {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 200px;
  padding: 0.5rem 0.75rem;
  font-size: 1.2rem;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  direction: rtl;
  text-align: right;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
}

.custom-date input:focus,
.custom-date select:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.custom-date input.invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ===========================
     Responsive Design
  =========================== */
@media (max-width: 576px) {
  .calendar-grid {
    gap: 2px;
  }

  .calendar-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .calendar-header .month-title {
    flex-direction: column;
    text-align: center;
  }

  .calendar-day {
    padding: 4px;
    font-size: 0.65rem;
  }

  .calendar-day div {
    font-size: 0.7rem;
  }

  .output-box .output-text {
    font-size: 0.9rem;
  }

  .output-box .badge-weekday {
    font-size: 0.85rem;
    padding: 0.3em 0.75em;
  }

  .button-set .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .custom-date {
    flex-direction: column;
    align-items: normal;
    gap: 0.5rem;
  }

  .custom-date select,
  .custom-date input {
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .converter-container {
    padding: 0 8px;
  }
}

.progress {
  height: 6px;
  border-radius: 3px;
}

.prayer-card {
  width: 100%;
  /* Ensures it uses full available space */
  max-width: 600px;
  /* Matches .prayer-wrapper */
  margin: 0 auto;
  /* Centers the card */
  padding: 1.2rem;
}


.prayer-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.prayer-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}



.prayer-countdown {
  font-size: 0.6rem;
  color: #888;
  margin-top: 0.25rem;
}

.prayer-divider {
  display: inline-block;
  color: #bbb;
  margin: 0 0.5rem;
}

.prayer-highlight {
  font-weight: bold;
  color: #0d6efd;
  background-color: lightblue !important;
}

.prayer-progress {
  height: 6px;
  margin-top: 1rem;
}

.prayer-wrapper {
  grid-template-columns: repeat(3, 1fr);
  /* Forces three items per row */
  grid-auto-rows: auto;
  /* Automatically adjust row height */
  gap: 10px;
  /* Space between items */
  justify-items: center;
  text-align: center;
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #666;
  max-width: 600px;
  /* Adjust this if needed */
  margin: 0 auto;
  /* Center the container */
}


#nextMonth,
#prevMonth {
  transform: scaleX(-1);
}


div.calendar-dayselected-day {
  background-color: #faff4196 !important;
  /* Or a more opaque color if the transparency is the issue */
  border: 3px solid #fc0000d1 !important;
  /* Keep or remove !important as needed after testing */
  border-radius: 8px;
}

#estimationMessage,
#islamicEventsList {
  font-size: 0.9rem !important;
  color: #6c757d !important;
  margin-top: 0.5rem !important;
  text-align: right !important;
}

#calendarContainer>div.calendar-grid.animate>div.calendar-day.selected-day {
  background-color: #faff4196 !important;
  /* Or a more opaque color if the transparency is the issue */
  border: 3px solid #fc0000d1 !important;
  /* Keep or remove !important as needed after testing */
  border-radius: 8px;
}

#btnHijri {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 08px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

#btnGregorian {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 08px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#btnHijri:active,
#btnGregorian:active {
  background-color: #0d6efd !important;
  color: white !important;
}

.end-0 {
  right: -20px !important;
}

.events-section {
  margin-top: 1rem;
  padding: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  text-align: right;
}

/* =================================
   Prayer Times Styling Enhancements
   ================================= */

/* 1. Ensure a 3-column layout for prayer items */
.prayer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Creates 3 equal-width columns */
  gap: 0.75rem;
  /* Adds a small space between the items */
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .prayer-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on smaller screens */
  }
}

.prayer-item {
  display: flex;
  flex-direction: column;
  /* Stacks icon, name, and time vertically */
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border-radius: 0.5rem;
  background-color: #f0f0f0;
  font-size: 0.9rem;
  text-align: center;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.prayer-item .prayer-name {
  font-weight: bold;
}

.prayer-item .prayer-time {
  color: #0d6efd;
  /* Blue color for the time */
  font-family: monospace;
  /* Gives a nice digital clock feel */
  font-size: 1rem;
  font-weight: bold;
}


/* 2. Style the progress bar with a green-to-red gradient */
.prayer-progress .progress-bar {
  /* Remove the default background color and apply a gradient */
  background-color: transparent;
  background-image: linear-gradient(to left, #28a745, #ffc107, #dc3545);
  /* Green-to-Yellow-to-Red gradient from right to left */
  transition: width 0.6s ease;
}

.end-0 {
  left: auto !important;
}