/* Grundsteuer-Manager Custom Styles */

:root {
  --status-red: #dc3545;
  --status-yellow: #ffc107;
  --status-green: #198754;
  --status-gray: #6c757d;
  --sidebar-width: 250px;
}

body {
  background-color: #f5f6fa;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Status badges */
.status-neutral { background-color: var(--status-gray); color: #fff; }
.status-pruefung { background-color: var(--status-yellow); color: #212529; }
.status-widerspruch { background-color: var(--status-red); color: #fff; }
.status-erledigt { background-color: var(--status-green); color: #fff; }

/* Clickable table rows & cards — visuelles Hover-Feedback */
.clickable-row,
tr[data-href] {
  cursor: pointer;
}

.table-hover tbody tr[data-href]:hover {
  background-color: rgba(13, 110, 253, 0.06);
}

.dashboard-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.dashboard-card-link:hover .dashboard-card {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bescheid-card {
  cursor: pointer;
}

.cursor-pointer {
  cursor: pointer;
}

/* Split-View Layout */
.split-view-container {
  display: flex;
  gap: 1.5rem;
  min-height: 60vh;
}

.split-view-column {
  flex: 1;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
}

.split-view-column.fa-column {
  border-left: 4px solid var(--status-green);
}

.split-view-column.kommune-column {
  border-left: 4px solid var(--status-yellow);
}

@media (max-width: 768px) {
  .split-view-container {
    flex-direction: column;
  }
}

/* Dashboard Cards */
.dashboard-card {
  border-radius: 0.75rem;
  border: none;
  transition: transform 0.15s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
}

.dashboard-card .card-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

/* Search */
.search-container {
  position: relative;
  max-width: 500px;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results-dropdown.active {
  display: block;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.1s;
}

.search-result-item:hover,
.search-result-item.highlighted {
  background-color: #f0f4ff;
}

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

/* Timeline for linked-list versioning */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.625rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--status-gray);
}

.timeline-item.current::before {
  background: var(--status-green);
  border-color: var(--status-green);
}

/* Global Search Bar Enhancements */
.global-search-input {
  border-radius: 2rem;
  padding-left: 2.5rem;
  background-color: #f0f2f5;
  border: none;
}

.global-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

/* Sidebar */
.sidebar {
  min-height: calc(100vh - 56px);
  background: #fff;
  border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
  color: #495057;
  padding: 0.75rem 1.25rem;
  border-radius: 0.375rem;
  margin: 0.125rem 0.5rem;
  transition: all 0.15s;
}

.sidebar .nav-link:hover {
  background-color: #f0f4ff;
  color: #0d6efd;
}

.sidebar .nav-link.active {
  background-color: #e7f1ff;
  color: #0d6efd;
  font-weight: 600;
}

.sidebar .nav-link i {
  width: 1.5rem;
  text-align: center;
  margin-right: 0.5rem;
}

/* Loading spinner for search */
.search-loading {
  display: none;
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.search-loading.active {
  display: block;
}

/* Version badge chain */
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.version-badge .version-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--status-gray);
}

.version-badge .version-dot.current {
  background: var(--status-green);
}

/* Money values */
.money-value {
  font-variant-numeric: tabular-nums;
}

/* Drop zone for document upload */
.drop-zone {
  border: 2px dashed #dee2e6;
  border-radius: 0.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: #fafbfc;
}

.drop-zone:hover {
  border-color: #86b7fe;
  background: #f0f7ff;
}

.drop-zone.drag-over {
  border-color: #0d6efd;
  background: #e7f1ff;
}

.drop-zone.uploading {
  opacity: 0.6;
  pointer-events: none;
}

.drop-zone.uploading .drop-zone-content::after {
  content: '';
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0.75rem auto 0;
  border: 2px solid #dee2e6;
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: drop-zone-spin 0.6s linear infinite;
}

@keyframes drop-zone-spin {
  to { transform: rotate(360deg); }
}

/* Dokument name clickable */
.dokument-name {
  cursor: pointer;
}

.dokument-name:hover {
  color: #0d6efd;
  text-decoration: underline;
}

/* Bescheid cards on detail page */
.bescheid-card {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-left-width: 4px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.bescheid-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateX(2px);
}

.bescheid-card.fa-card {
  border-left-color: var(--status-green);
}

.bescheid-card.kommune-card {
  border-left-color: var(--status-yellow);
}

/* Bescheid-Typ Auswahlkacheln */
.bescheid-typ-card {
  display: block;
  cursor: pointer;
}

.bescheid-typ-card .card {
  border: 2px solid #dee2e6;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.bescheid-typ-card:hover .card {
  border-color: #86b7fe;
  background: #f0f7ff;
}

.bescheid-typ-card.active .card {
  border-color: #0d6efd;
  background: #e7f1ff;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.bescheid-typ-card .card i {
  transition: transform 0.2s;
}

.bescheid-typ-card:hover .card i,
.bescheid-typ-card.active .card i {
  transform: scale(1.1);
}

/* Bescheid PDF-Vorschau */
.pdf-preview-wrap {
  position: relative;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  overflow: hidden;
  background: #fff;
}

.pdf-preview-iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: none;
}

.pdf-preview-expand {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  color: #495057;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.pdf-preview-wrap:hover .pdf-preview-expand {
  opacity: 1;
}

.pdf-preview-expand:hover {
  background: #fff;
  color: #0d6efd;
  border-color: #0d6efd;
}

/* Dokument-Vorschau Modal */
#dokument-preview-modal .modal-body {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#dokument-preview-modal .modal-body iframe {
  background: #fff;
  border-radius: 0;
}

#dokument-preview-modal .modal-body img {
  border-radius: 0.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
