/* Islamic Calendar Styles */
body {
  background: linear-gradient(to bottom right, #f0fdfa, #ccfbf1);
  min-height: 100vh;
}

.printable-area {
  padding: 2rem 1rem;
}

.year-navigation {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
  padding: 1rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.year-title {
  color: rgba(13, 148, 136, 0.8);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
}

.nav-button {
  background: rgba(13, 148, 136, 0.1);
  color: rgba(13, 148, 136, 0.8);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.nav-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(13, 148, 136, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.nav-button:hover {
  background: rgba(13, 148, 136, 0.2);
  transform: translateY(-2px);
}

.nav-button:hover::before {
  left: 100%;
}

.month-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.month-card:hover {
  transform: translateY(-5px);
}

.month-header {
  background: linear-gradient(
    135deg,
    rgba(13, 148, 136, 0.8),
    rgba(13, 148, 136, 0.6)
  );
  color: white;
  padding: 1rem;
  text-align: center;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: rgba(13, 148, 136, 0.1);
  padding: 1px;
}

.day-name {
  background: rgba(13, 148, 136, 0.1);
  color: rgba(13, 148, 136, 0.8);
  padding: 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.day-cell {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.day-cell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(13, 148, 136, 0.1);
  transform: scale(0);
  transition: transform 0.2s ease;
  z-index: -1;
}

.day-cell:hover:not(.empty):not(.today)::before {
  transform: scale(1);
}

.day-cell:hover:not(.empty):not(.today) {
  color: rgba(13, 148, 136, 0.8);
  font-weight: 600;
}

.day-cell.today {
  background: linear-gradient(
    135deg,
    rgba(13, 148, 136, 0.8),
    rgba(13, 148, 136, 0.6)
  );
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(13, 148, 136, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
  }
}

.day-cell.empty {
  visibility: hidden;
}

.print-button {
  background: linear-gradient(
    135deg,
    rgba(13, 148, 136, 0.8),
    rgba(13, 148, 136, 0.6)
  );
  color: white;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin: 2rem auto;
}

.print-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.print-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3);
}

.print-button:hover::before {
  left: 100%;
}

.calendar-info {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}

.calendar-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.calendar-info:hover::before {
  opacity: 1;
}

.info-title {
  color: rgba(13, 148, 136, 0.8);
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(13, 148, 136, 0.2);
  padding-bottom: 0.5rem;
  position: relative;
}

.info-title::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.8), transparent);
}

.info-text {
  color: #4a5568;
  line-height: 1.6;
}

/* Dark mode styles */
.dark-mode {
  background: linear-gradient(to bottom right, #1a202c, #2d3748);
  color: #f7fafc;
}

.dark-mode .month-card {
  background: rgba(26, 32, 44, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .month-header {
  background: linear-gradient(
    135deg,
    rgba(13, 148, 136, 0.9),
    rgba(13, 148, 136, 0.7)
  );
}

.dark-mode .day-name {
  color: rgba(13, 148, 136, 0.9);
}

.dark-mode .day-cell {
  color: #e2e8f0;
}

.dark-mode .day-cell:hover:not(.empty):not(.today) {
  color: #f7fafc;
}

.dark-mode .year-navigation {
  background: rgba(26, 32, 44, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .nav-button {
  background: rgba(13, 148, 136, 0.2);
  color: #f7fafc;
  border-color: rgba(13, 148, 136, 0.3);
}

.dark-mode .calendar-info {
  background: rgba(26, 32, 44, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .info-text {
  color: #e2e8f0;
}

/* Responsive styles */
@media (max-width: 768px) {
  .month-card {
    margin-bottom: 1.5rem;
  }

  .day-cell {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }
}

/* Print styles */
@media print {
  body * {
    visibility: hidden;
  }

  .printable-area,
  .printable-area * {
    visibility: visible;
  }

  .printable-area {
    position: absolute;
    left: 0;
    top: 0;
  }

  .month-card {
    break-inside: avoid;
    page-break-inside: avoid;
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
    margin-bottom: 2rem !important;
  }

  .month-header {
    background: #f3f4f6 !important;
    color: black !important;
    border-bottom: 2px solid #0d9488 !important;
  }

  .day-name {
    color: #4b5563 !important;
    font-weight: 600 !important;
  }

  .day-cell {
    border: 1px solid #e5e7eb !important;
    color: black !important;
  }

  .day-cell.today {
    background: #f3f4f6 !important;
    color: black !important;
    font-weight: bold !important;
    border: 2px solid #0d9488 !important;
  }

  .theme-toggle,
  .nav-button,
  .print-button,
  .modal,
  .date-modal {
    display: none !important;
  }

  .calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
    margin: 0 !important;
  }

  .month-card:nth-child(3n) {
    page-break-after: always;
  }

  * {
    text-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    margin: 1cm;
  }

  .calendar-container::before {
    content: "Islamic Calendar " attr(data-year);
    display: block;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 1rem;
  }

  .calendar-container::after {
    content: "Generated on " attr(data-date);
    display: block;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 1rem;
  }
}

/* Base styles */
.calendar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.year-display {
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-primary);
}

.navigation-buttons {
  display: flex;
  gap: 1rem;
}

.nav-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.nav-button:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.month-card {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.month-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.month-header {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.5rem;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-primary);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-cell:hover {
  background: var(--accent-color);
  color: white;
  transform: scale(1.1);
}

.day-cell.today {
  background: var(--accent-color);
  color: white;
  font-weight: bold;
  animation: pulse 2s infinite;
}

.day-cell.empty {
  cursor: default;
}

/* Theme variables */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6;
  --bg-card: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --accent-color: #0d9488;
  --accent-rgb: 13, 148, 136;
}

.dark-mode {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-card: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --accent-color: #14b8a6;
  --accent-rgb: 20, 184, 166;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calendar-container {
    padding: 1rem;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .month-card {
    padding: 1rem;
  }

  .day-cell {
    font-size: 0.875rem;
  }
}

/* Print styles */
@media print {
  .calendar-container {
    max-width: none;
    padding: 0;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .month-card {
    break-inside: avoid;
    page-break-inside: avoid;
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
  }

  .month-card:nth-child(3n) {
    page-break-after: always;
  }
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 100;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--accent-color);
  color: white;
}

.theme-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}
