* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

header {
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

main {
  min-height: 60vh;
}

footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid #eee;
  margin-top: 2rem;
  color: #666;
  font-size: 0.875rem;
}

/* Month Navigation */
.month-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.month-nav button {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  border-radius: 4px;
}

.month-nav button:hover {
  background: #f5f5f5;
}

.month-nav .today-btn {
  background: #4a90d9;
  color: #fff;
  border-color: #3a7bc8;
}

.month-nav .today-btn:hover {
  background: #3a7bc8;
}

.month-nav span {
  font-weight: bold;
  min-width: 150px;
  text-align: center;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e5e5e5;
  border: 1px solid #e5e5e5;
  margin-top: 1rem;
}

.calendar-header {
  background: #f0f0f0;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: bold;
  font-size: 0.875rem;
  color: #555;
}

.calendar-day {
  background: #fff;
  padding: 0.75rem 0.5rem;
  text-align: center;
  min-height: 60px;
  font-size: 1rem;
  cursor: pointer;
}

.calendar-day:hover {
  background: #f9f9f9;
}

.calendar-day.overflow-day {
  color: #bbb;
  background: #fafafa;
}

/* Day number */
.day-number {
  display: block;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

/* Balinese labels */
.balinese-labels {
  font-size: 0.7rem;
  line-height: 1.3;
}

.wuku-label {
  display: block;
  color: #8b4513;
  font-weight: 500;
}

.wewaran-label {
  display: block;
  color: #666;
}

.overflow-day .wuku-label,
.overflow-day .wewaran-label {
  color: #ccc;
}

/* Selected day */
.calendar-day.selected {
  background: #e8f4ff;
  border: 2px solid #4a90d9;
}

/* Day Detail Panel */
.day-detail {
  margin-top: 2rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.day-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  background: #f8f8f8;
  border-radius: 8px 8px 0 0;
}

.day-detail-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.25rem 0.5rem;
}

.close-btn:hover {
  color: #333;
}

.day-detail-content {
  padding: 1.5rem;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section h3 {
  font-size: 1rem;
  color: #8b4513;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.detail-item .label {
  color: #666;
}

.detail-item .value {
  font-weight: 500;
  color: #333;
}

.wewaran-grid,
.paringkelan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem 1.5rem;
}

@media (max-width: 600px) {
  .wewaran-grid,
  .paringkelan-grid {
    grid-template-columns: 1fr;
  }
}

/* Rerainan List */
.rerainan-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rerainan-item {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: #f8f4e8;
  border-left: 3px solid #8b4513;
  border-radius: 0 4px 4px 0;
  color: #5a3d1a;
  font-weight: 500;
}

.rerainan-item:last-child {
  margin-bottom: 0;
}

.empty-state {
  color: #888;
  font-style: italic;
  padding: 0.5rem 0;
}

/* Main Navigation */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #666;
  border-radius: 4px;
  font-weight: 500;
}

.nav-link:hover {
  background: #f5f5f5;
  color: #333;
}

.nav-link.active {
  background: #4a90d9;
  color: #fff;
}

/* Filter Form */
.filter-form-section {
  background: #f8f8f8;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.filter-form-section h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: #333;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.date-range {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .date-range {
    grid-template-columns: 1fr;
  }
}

.filter-field {
  display: flex;
  flex-direction: column;
}

.filter-field label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #555;
}

.filter-field select,
.filter-field input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-primary {
  padding: 0.6rem 1.5rem;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.btn-primary:hover {
  background: #3a7bc8;
}

.btn-secondary {
  padding: 0.6rem 1rem;
  background: #fff;
  color: #555;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

/* Filter Results */
.filter-results {
  margin-top: 2rem;
}

.filter-results h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: #333;
}

.results-count {
  color: #666;
  margin-bottom: 1rem;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
}

@media (max-width: 600px) {
  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

.result-date {
  font-weight: 600;
  color: #333;
}

.result-date a {
  color: #4a90d9;
  text-decoration: none;
}

.result-date a:hover {
  text-decoration: underline;
}

.result-wewaran {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge.wuku {
  background: #f0e6d6;
  color: #8b4513;
}

.badge.pancawara {
  background: #e6f0d6;
  color: #4a7c23;
}

.badge.saptawara {
  background: #d6e6f0;
  color: #235a7c;
}

.badge.triwara {
  background: #f0d6e6;
  color: #7c235a;
}

/* Share Section */
.share-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f8f8;
  border-radius: 8px;
}

.share-section h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.share-url {
  display: flex;
  gap: 0.5rem;
}

.share-url input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}

.copy-message {
  margin-top: 0.5rem;
  color: #4a7c23;
  font-size: 0.875rem;
}

/* Rerainan Page Updates */
.rerainan-container {
  max-width: 600px;
  margin: 0 auto;
}

.rerainan-date-group {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
}

.date-header {
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.loading-state {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.rerainan-items {
  list-style: none;
  padding: 0;
}

/* Piodalan Page Styles */
.piodalan-container {
  max-width: 600px;
  margin: 0 auto;
}

.piodalan-date-group {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
}

.piodalan-items {
  list-style: none;
  padding: 0;
}

.piodalan-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.piodalan-item:last-child {
  border-bottom: none;
}

.temple-name {
  font-weight: 600;
  color: #333;
}

.piodalan-description {
  color: #666;
  font-size: 0.9rem;
}
