:root {
  --primary-light: #e6f3ff;
  --primary: #4a90e2;
  --primary-dark: #2c6cb0;
  --accent: #ff6b6b;
  --text-light: #333333;
  --text-dark: #e2e8f0;
  --bg-light: #f8fafc;
  --bg-dark: #1a202c;
  --card-light: #ffffff;
  --card-dark: #2d3748;
  --nav-light: #4a90e2;
  --nav-dark: #1a202c;
  --footer-light: #2c6cb0;
  --footer-dark: #171923;
}

.light-mode {
  --primary-color: var(--primary-light);
  --secondary-color: var(--primary);
  --accent-color: var(--accent);
  --text-color: var(--text-light);
  --bg-color: var(--bg-light);
  --card-color: var(--card-light);
  --nav-color: var(--nav-light);
  --footer-color: var(--footer-light);
}

.dark-mode {
  --primary-color: #1a202c;
  --secondary-color: #2d3748;
  --accent-color: #fc8181;
  --text-color: var(--text-dark);
  --bg-color: var(--bg-dark);
  --card-color: var(--card-dark);
  --nav-color: var(--nav-dark);
  --footer-color: var(--footer-dark);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.nav-bg {
  background-color: var(--nav-color);
}

.card-bg {
  background-color: var(--card-color);
}

.section-bg {
  background-color: var(--primary-color);
}

.footer-bg {
  background-color: var(--footer-color);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #4a90e2;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #fc8181;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Netflix-style carousel */
.carousel-container {
  position: relative;
  margin: 2rem 0;
  overflow: hidden;
}

.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

.carousel-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
}

.carousel-nav {
  display: flex;
  gap: 0.5rem;
}

.carousel-nav button {
  background-color: var(--card-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-nav button:hover {
  background-color: var(--accent-color);
  color: white;
}

.carousel {
  display: flex;
  gap: 1rem;
  padding: 0 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.carousel::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.report-card {
  flex: 0 0 300px;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: var(--card-color);
  cursor: pointer;
}

.report-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.report-image {
  height: 180px;
  width: 100%;
  object-fit: cover;
}

.report-content {
  padding: 1rem;
}

.report-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.category-infrastruktur {
  background-color: #e6f3ff;
  color: #2c6cb0;
}

.dark-mode .category-infrastruktur {
  background-color: #2c5282;
  color: #bee3f8;
}

.category-kebersihan {
  background-color: #e6fffa;
  color: #2d7d6c;
}

.dark-mode .category-kebersihan {
  background-color: #285e61;
  color: #b2f5ea;
}

.category-aspirasi {
  background-color: #fff5f5;
  color: #c53030;
}

.dark-mode .category-aspirasi {
  background-color: #742a2a;
  color: #fed7d7;
}

.report-title {
  font-size: 1.125rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.report-description {
  font-size: 0.875rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.7;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.status-selesai {
  background-color: #c6f6d5;
  color: #276749;
}

.status-proses {
  background-color: #fefcbf;
  color: #744210;
}

.status-diterima {
  background-color: #bee3f8;
  color: #2c6cb0;
}

/* Filter Section */
.filter-section {
  padding: 1.5rem;
  background-color: var(--card-color);
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.filter-option label {
  color: var(--text-color);
}

/* Search Bar */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border-radius: 50px;
  border: 1px solid #cbd5e0;
  background-color: var(--card-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #718096;
}

/* Modal Detail Laporan */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--card-color);
  margin: 2rem auto;
  border-radius: 8px;
  width: 90%;
  max-width: 900px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark-mode .modal-header {
  border-bottom: 1px solid #4a5568;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-meta-label {
  font-weight: bold;
  color: var(--text-color);
}

.modal-meta-value {
  color: var(--text-color);
}

.modal-description {
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 1.5rem;
}

.modal-map-container {
  height: 300px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
  position: relative;
}

.dark-mode .modal-map-container {
  border: 1px solid #4a5568;
}

.modal-updates {
  margin-top: 2rem;
}

.modal-updates-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.update-item {
  padding: 1rem;
  border-left: 4px solid var(--primary);
  background-color: var(--primary-color);
  margin-bottom: 1rem;
  border-radius: 0 4px 4px 0;
}

.update-date {
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.update-content {
  color: var(--text-color);
}

/* Custom marker untuk peta */
.custom-marker {
  background-color: var(--accent-color);
  border: 3px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-mode .leaflet-popup-content-wrapper {
  background-color: var(--card-dark);
  color: var(--text-dark);
}

.dark-mode .leaflet-popup-tip {
  background-color: var(--card-dark);
}

/* Fix untuk peta Leaflet */
.leaflet-container {
  background-color: var(--card-color) !important;
}

/* Alert Styles */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.alert-message {
  flex: 1;
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
  opacity: 0.7;
  transition: opacity 0.2s;
  color: inherit;
}

.alert-close:hover {
  opacity: 1;
}

.alert-success {
  background-color: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.dark-mode .alert-success {
  background-color: #064e3b;
  border-left-color: #10b981;
  color: #6ee7b7;
}

.alert-error {
  background-color: #fee2e2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.dark-mode .alert-error {
  background-color: #7f1d1d;
  border-left-color: #ef4444;
  color: #fca5a5;
}

.alert-message ul {
  margin-top: 0.5rem;
  padding-left: 1rem;
}

.alert-message li {
  margin-top: 0.25rem;
}
