:root {
  --bg-color: #f8f9fa;
  --bg-gradient: linear-gradient(135deg, #f8f9fa, #e9ecef);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.1);
  --primary-color: #e35205; /* FPRE Orange */
  --primary-hover: #cc4904;
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent-color: #e35205;
}

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

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
}

.app-container {
  width: 100%;
  max-width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.glass-header {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 4px solid var(--primary-color);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo img {
  height: 40px;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  height: calc(100vh - 150px);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.glass-card h2 {
  font-size: 1.25rem;
  font-weight: 500;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.75rem;
}

.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-zone:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
}

.primary-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s ease, transform 0.1s ease;
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: translateY(0);
}

.upload-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  color: var(--accent-color);
}

.loader {
  border: 2px solid rgba(16, 185, 129, 0.2);
  border-top: 2px solid var(--accent-color);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.results-box {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.results-box h3 {
  font-size: 1rem;
  color: var(--text-secondary);
}

#result-json {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.85rem;
  overflow-y: auto;
  flex-grow: 1;
  color: #e2e8f0;
}

/* Dashboard Card Styles */
.servitude-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.servitude-card:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.servitude-card.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary-color);
}

.servitude-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
}

.badges-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge.recht {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.last {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.mutual {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.parcel-list {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
  flex: 1;
}

.source-toggle {
  font-size: 0.75rem;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.source-toggle:hover {
  color: #1e293b;
}

.source-text-box {
  background: rgba(0, 0, 0, 0.05);
  border-left: 3px solid var(--primary-color);
  padding: 10px;
  font-size: 0.8rem;
  color: #334155;
  border-radius: 0 6px 6px 0;
  display: none;
  line-height: 1.5;
}

.source-text-box.open {
  display: block;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .glass-card {
    min-height: 400px;
  }
}


/* Tile Classes */
.servitude-card {
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  color: #333333;
}
.servitude-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.servitude-card.active {
  transform: scale(1.02);
  box-shadow: 0 0 0 2px #3b82f6;
}

.tile-recht {
  background-color: #ecfdf5;
  border-color: #10b981;
}
.tile-recht h3 { color: #047857; }

.tile-last {
  background-color: #fef2f2;
  border-color: #ef4444;
}
.tile-last h3 { color: #b91c1c; }

.tile-mixed {
  background-color: #eff6ff;
  border-color: #3b82f6;
}
.tile-mixed h3 { color: #1d4ed8; }

.tile-neutral {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}
.tile-neutral h3 { color: #334155; }
