body {
  font-family: Arial, sans-serif;
  background-color: #f4f6fb;
  color: #002b5c;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  color: #003366;
}

#year-selector {
  margin: 20px auto;
  text-align: center;
}

.month {
  margin-bottom: 30px;
  background-color: #ffffff;
  border: 1px solid #cce0ff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

.month-name {
  background-color: #003366;
  color: white;
  text-align: center;
  padding: 10px;
  font-size: 1.5em;
}

.table {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid #cce0ff;
}

.day {
  padding: 10px;
  border-bottom: 1px solid #eee;
  border-right: 1px solid #eee;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.9em;
}

.day:last-child {
  border-right: none;
}

.gregorian {
  font-weight: bold;
}

.hijri {
  color: #004080;
  font-size: 0.8em;
}

.weekday-header {
  background-color: #dce9f9;
  font-weight: bold;
  text-align: center;
  padding: 8px;
  border-bottom: 1px solid #cce0ff;
  border-right: 1px solid #cce0ff;
}

.weekday-header:last-child {
  border-right: none;
}

@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 14pt;
    direction: rtl;
  }

  header,
  .print-btn,
  #year-selector {
    display: none !important;
  }

  .month {
    page-break-after: always;
    border: none;
    padding: 0;
    margin-bottom: 50px;
  }

  .month-name {
    font-size: 24pt;
    text-align: center;
    margin-bottom: 10px;
  }

  .table {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }

  .weekday-header {
    font-weight: bold;
    background: #ccc !important;
    padding: 5px;
  }

  .day {
    border: 1px solid #aaa;
    padding: 10px;
    min-height: 80px;
  }

  .gregorian {
    font-weight: bold;
  }

  .hijri {
    font-style: italic;
    font-size: 11pt;
  }
}
body.dark {
  background-color: #121212;
  color: #eee;
}

body.dark .month {
  background-color: #1e1e1e;
  border-color: #333;
}

body.dark .month-name {
  color: #fff;
}

body.dark .weekday-header {
  background-color: #333;
  color: #fff;
}

body.dark .day {
  border: 1px solid #444;
  background-color: #181818;
}

body.dark .gregorian {
  color: #fff;
}

body.dark .hijri {
  color: #ccc;
}

.signature {
  text-align: center;
  font-size: 12px;
  margin-top: 40px;
  color: #666;
}

body.dark .signature {
  color: #999;
}

@media print {
  .signature {
    display: block;
    margin-top: 80px;
    font-size: 10pt;
    color: #555;
    text-align: center;
    page-break-before: always;
  }
}

.knowledge-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f9f9ff;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 20px;
  margin-top: 30px;
  text-align: center;
}

.knowledge-logo {
  width: 120px;
  max-width: 90%;
  margin-bottom: 15px;
}

.knowledge-text {
  font-size: 16px;
  color: #003366;
  line-height: 1.8;
}

.knowledge-text a {
  display: inline-block;
  margin-top: 10px;
  font-weight: bold;
  color: #0066cc;
  text-decoration: none;
}

.knowledge-text a:hover {
  text-decoration: underline;
}

body.dark .knowledge-section {
  background: #1b1b2f;
  border-color: #333;
}

body.dark .knowledge-text {
  color: #cce6ff;
}

body.dark .knowledge-text a {
  color: #66aaff;
}
