/**
 * cazuri.css - Cases page specific styles
 * Map layout, filters, case cards, mobile modal
 */

/* ========== PAGE HEADER ========== */
.page-header {
  text-align: center;
  padding: 24px 0 16px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 32px;
  margin: 0 0 8px;
  color: var(--blue);
}

.subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

/* ========== FILTERS SECTION ========== */
.filters-section {
  background: var(--card);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid #eef1f6;
}

.filters-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.filter-select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-family: inherit;
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--blue);
}

.stats-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}

.stat-item strong {
  color: var(--blue);
  font-weight: 700;
}

/* ========== MAIN LAYOUT: Map + List ========== */
.cases-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
  min-height: 600px;
}

/* ========== MAP CONTAINER ========== */
.map-container {
  background: #f9f9f9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  height: 700px;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
}

.map-placeholder-content {
  text-align: center;
  color: var(--muted);
}

.map-placeholder-content p {
  margin: 8px 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* ========== CASES LIST ========== */
.cases-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cases-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cases-list-header h2 {
  font-size: 22px;
  margin: 0;
}

.mobile-only {
  display: none;
}

.cases-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 660px;
  padding-right: 8px;
}

.cases-list::-webkit-scrollbar {
  width: 6px;
}

.cases-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.cases-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.cases-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ========== CASE CARDS ========== */
.case-card {
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.case-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--blue);
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.case-county {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.case-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-publicat {
  background: #dcfce7;
  color: #166534;
}

.status-verificat {
  background: #dbeafe;
  color: #1e40af;
}

.status-în-verificare,
.status-in-verificare {
  background: #fef3c7;
  color: #92400e;
}

.status-nou {
  background: #f3f4f6;
  color: #4b5563;
}

.status-respins {
  background: #fee2e2;
  color: #991b1b;
}

.case-title {
  font-size: 16px;
  margin: 0 0 8px;
  line-height: 1.3;
  color: var(--blue);
}

.case-description {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.case-domain {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.tag-sanatate,
.tag-sănătate {
  background: #fee2e2;
  color: #991b1b;
}

.tag-educatie,
.tag-educație {
  background: #e0e7ff;
  color: #3730a3;
}

.tag-justitie,
.tag-justiție {
  background: #fef3c7;
  color: #78350f;
}

.tag-administrație {
  background: #e5e7eb;
  color: #374151;
}

.tag-administratie {
  background: #e5e7eb;
  color: #374151;
}

.tag-mediu {
  background: #d1fae5;
  color: #065f46;
}

.tag-altele {
  background: #f3f4f6;
  color: #6b7280;
}

.case-date {
  font-size: 12px;
  color: var(--muted);
}

.case-authority {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.loading,
.error {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

.error {
  color: #dc2626;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ========== MAP MARKERS ========== */
.custom-marker {
  background: transparent;
  border: none;
}

/* ========== MAP POPUPS ========== */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0;
  min-width: 250px;
}

.popup-content {
  padding: 14px;
}

.popup-content h4 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--blue);
}

.popup-content p {
  margin: 6px 0;
  font-size: 13px;
  color: #555;
}

.popup-description {
  margin: 10px 0;
  line-height: 1.4;
}

.popup-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--blue);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}

.popup-link:hover {
  background: #1a3b6b;
}

.status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.popup-cases-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
}

.popup-case-item {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

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

.popup-case-item strong {
  color: var(--blue);
  display: block;
  margin-bottom: 4px;
}

.popup-case-item small {
  color: var(--muted);
  font-size: 11px;
}

/* ========== MAP MODAL (Mobile) ========== */
.map-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 1000;
  flex-direction: column;
}

.map-modal.active {
  display: flex;
}

.map-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 2px solid #f0f0f0;
  background: white;
}

.map-modal-header h2 {
  font-size: 20px;
  margin: 0;
}

.map-modal-content {
  flex: 1;
  position: relative;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 880px) {
  .cases-layout {
    grid-template-columns: 1fr;
  }

  .map-container {
    display: none; /* Hide desktop map on tablet/mobile */
  }

  .cases-list {
    max-height: none;
  }
}

@media (max-width: 600px) {
  .page-header h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 14px;
  }

  .filters-container {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .stats-summary {
    flex-direction: column;
    gap: 8px;
  }

  .mobile-only {
    display: inline-block;
    width: 100%;
  }

  .cases-list-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .case-card {
    padding: 12px;
  }

  .case-title {
    font-size: 15px;
  }

  .case-description {
    font-size: 12px;
  }
}
