/* Reset and general styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

body {
  font-family: Arial, sans-serif;
  background-color: #ffffff;
}

/* Page layout - base styles (mobile-first) */
.page {
  width: 100%;
  max-width: 297mm;
  margin: 0 auto;
  background: white;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: auto;
}

.page__header-image {
  width: 51%;
  height: auto;
  margin: 0 auto;
}

/* Ramadan title */
.ramadan-title {
  text-align: right;
  font-size: 12pt;
  font-weight: bold;
  color: #333;
  margin-bottom: 2px;
}

/* Table styles */
.table-grid {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.table-grid__half {
  flex: 1;
  min-width: 300px;
}

.prayer-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1.5px;
}

.prayer-table__cell {
  text-align: center;
  padding: 4px 3px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #ffffff;
  position: relative;
  overflow: hidden;
  font-size: 10pt;
  line-height: 1.2;
}

.prayer-table__header {
  background-color: #f8f9fa !important;
  font-weight: bold;
  white-space: nowrap;
}

.prayer-table__cell--asr {
  background-color: #e6f3ff !important;
}

.prayer-table__cell--maghreb {
  background-color: #ffe6e6 !important;
}

.prayer-table__cell--day {
  background-color: #f0f8ff !important;
}

.prayer-table__cell--special {
  background-color: #fff0f0 !important;
}

.prayer-table__cell--friday {
  background-color: #ffebeb !important;
}

/* Today's row highlight */
.prayer-table__row--today .prayer-table__cell {
  background-color: #e8f5e9 !important;
  font-weight: 600;
}

/* Footer styles */
.footer {
  margin-top: auto;
  position: relative;
  width: 100%;
  aspect-ratio: 1200/120;
}

.footer__mosque-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.footer__zakat-image {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 100px;
  height: auto;
}

/* Screen-only styles */
@media screen {
  body {
    background: #f0f0f0;
    padding: 20px;
  }

  .page {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }
}

/* ============================================
   RESPONSIVE BREAKPOINTS (screen only)
   Print styles are handled separately in print.css
   ============================================ */

/* Desktop: Fixed A4 landscape layout */
@media screen and (min-width: 1200px) {
  .page {
    width: 297mm;
    height: 210mm;
    margin: 20px auto;
    padding: 10mm 8mm;
  }
}

/* Tablet: Fluid width, side-by-side tables */
@media screen and (max-width: 1199px) and (min-width: 768px) {
  body {
    padding: 15px;
  }

  .page {
    max-width: 900px;
    padding: 15px;
  }

  .page__header-image {
    width: 60%;
  }

  .prayer-table__cell {
    font-size: 9pt;
    padding: 3px 2px;
  }

  .ramadan-title {
    font-size: 11pt;
  }
}

/* Mobile: Stacked tables */
@media screen and (max-width: 767px) {
  body {
    padding: 10px;
  }

  .page {
    padding: 10px;
    box-shadow: none;
  }

  .page__header-image {
    width: 80%;
  }

  .table-grid {
    flex-direction: column;
    gap: 15px;
  }

  .table-grid__half {
    min-width: 100%;
  }

  .prayer-table__cell {
    font-size: 8pt;
    padding: 2px 1px;
  }

  .ramadan-title {
    font-size: 10pt;
    text-align: center;
    margin-bottom: 5px;
  }

  .footer__zakat-image {
    max-width: 80px;
  }
}

/* Small mobile: Minimal padding, smallest fonts */
@media screen and (max-width: 480px) {
  body {
    padding: 5px;
  }

  .page {
    padding: 8px;
  }

  .page__header-image {
    width: 95%;
  }

  .prayer-table__cell {
    font-size: 7pt;
    padding: 1px;
    border-radius: 2px;
  }

  .prayer-table {
    border-spacing: 1px;
  }

  .ramadan-title {
    font-size: 9pt;
  }

  .footer__zakat-image {
    max-width: 60px;
  }
}
