html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #008B8A;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  padding-bottom: 30px;
  background: linear-gradient(135deg, rgba(0, 43, 54, 0.08) 0%, rgba(0, 139, 138, 0.12) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* 🔹 Main-Bereich: Padding/Margin reduzieren, damit alles auf eine Seite passt */
main[role="main"] {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* 🔹 Navbar Styling - Farbverlauf für den gesamten Header */
.navbar {
  background: linear-gradient(135deg, rgba(0, 43, 54, 0.95) 0%, rgba(0, 139, 138, 0.95) 100%) !important;
  box-shadow: 0 2px 4px rgba(0, 43, 54, 0.1);
  min-height: 70px !important; /* Um 1cm höher (von 56px auf ~70px) */
  padding: 0.5rem 0 !important;
  margin-bottom: 0 !important; /* Kein Margin-Bottom, damit alles auf eine Seite passt */
}

.navbar .container {
  background: #212529 !important;
  border-radius: 6px;
  padding: 0.2rem 0.75rem !important; /* 2mm größer als Schrift (ca. 0.2rem = ~3mm) */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  min-height: auto !important;
  height: auto !important;
  line-height: 1.2;
  display: flex;
  align-items: center;
}

.navbar-brand,
.nav-link {
  font-size: 1rem !important; /* Um 1 Größe vergrößert (von 0.9rem auf 1rem) */
  padding: 0.1rem 0.5rem !important; /* Minimales Padding - nur für Klickbereich */
  line-height: 1.2;
  margin: 0;
}

.navbar-nav {
  align-items: center;
}

.navbar-brand,
.nav-link {
  color: #ffffff !important;
  font-weight: 500;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 🔹 Footer Styling */
.footer {
  background: linear-gradient(135deg, rgba(0, 43, 54, 0.85) 0%, rgba(0, 139, 138, 0.85) 100%);
  color: #ffffff;
  padding: 0.15rem 0;
  font-size: 0.7rem;
  height: 30px;
  line-height: 1.2;
  border-top: none !important;
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

.footer .container {
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 0.5rem;
  box-shadow: none !important;
  border: none !important;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer a:hover {
  color: #ffffff;
}

/* 🔹 Button Styling */
.btn-primary {
  background: linear-gradient(135deg, #008B8A 0%, #006B6A 100%);
  border: none;
  color: #ffffff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #006B6A 0%, #004B4A 100%);
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(135deg, #008B8A 0%, #006B6A 100%);
  border: none;
}

.btn-success:hover {
  background: linear-gradient(135deg, #006B6A 0%, #004B4A 100%);
}

/* 🔹 Card/Container Styling */
.container:not(.container-fluid):not(.footer .container) {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 43, 54, 0.1);
  margin-top: 1rem;
  margin-bottom: 1rem;
  max-width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

/* IDD-Viewer Container: Noch breiter, weniger Rand */
#viewerPage.container-fluid {
  max-width: 100%;
  padding-left: 15px;
  padding-right: 15px; /* Padding wieder normal für bessere Darstellung */
}

/* 🔹 Betriebsmittel-Seite behält ihren Stil */
.container-fluid {
  padding: 1rem;
  background: transparent;
}

/* 🔹 Table Styling bleibt unverändert */
.table {
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
}

/* 🔹 Alert Styling */
.alert {
  border-radius: 6px;
  border: none;
}

.alert-success {
  background: linear-gradient(135deg, rgba(0, 139, 138, 0.1) 0%, rgba(0, 107, 106, 0.1) 100%);
  color: #006B6A;
  border-left: 4px solid #008B8A;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
  color: #856404;
  border-left: 4px solid #ffc107;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(200, 33, 49, 0.1) 100%);
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.alert-info {
  background: linear-gradient(135deg, rgba(0, 139, 138, 0.1) 0%, rgba(0, 107, 106, 0.1) 100%);
  color: #006B6A;
  border-left: 4px solid #008B8A;
}

/* 🔹 Logo Container */
.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}

.logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo-item img.logo-img {
  height: 120px;
  width: auto;
  max-width: none;
  object-fit: contain;
  display: block !important;
}

/* 🔹 Landing Page Styling */
.landing-page {
  background: #ffffff;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.landing-page h1 {
  color: #002B36;
  font-weight: 600;
  margin-bottom: 2rem;
}

.landing-page .welcome-text {
  color: #008B8A;
  font-size: 1.2rem;
  margin-bottom: 3rem;
  text-align: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  display: inline-block;
  white-space: normal;
  word-break: keep-all;
  hyphens: none;
}

/* 🔹 Viewer-Seite: Fenster enden genau am Footer */
#viewerPage .row {
  margin-bottom: 0 !important;
}

/* MAIN-Fenster: feste Höhe 800px (statt 839px), damit alles auf eine Seite passt */
#viewerPage .row.g-0 {
  height: 800px !important;
  max-height: 800px !important;
}

/* Spalten col-md-3, col-md-4, col-md-5: Höhe 700px (statt 716px) */
#viewerPage #ifcPanel,
#viewerPage #viewerPanel,
#viewerPage #propsPanel {
  height: 700px !important;
}

#viewerPage #ifcPanel .card,
#viewerPage #propsPanel .card {
  height: 700px !important;
  min-height: 700px !important;
}

#viewerPage .card,
#viewerPage #viewerContainer {
  height: 700px !important;
  min-height: 400px;
}

/* Eigenschaften-Panel: Flexibel, aber mindestens 300px */
#propsPanel {
  min-width: 300px;
  padding-right: 0 !important;
  margin-right: 0 !important;
}

/* Properties-Panel Card: Normal */
#propsPanel .card {
  border-radius: 0.375rem; /* Normale abgerundete Ecken */
}

#propsPanel .card-body {
  overflow-x: hidden !important;
  word-wrap: break-word;
}

#propsPanel .table {
  table-layout: auto;
  width: 100%;
}

#propsPanel .table td {
  word-break: break-word;
  max-width: 0;
  overflow-wrap: break-word;
}

/* IFC-Panel: Gleiche Hintergrundfarbe wie Eigenschaften-Panel (Grau) */
#ifcPanel .card {
  background-color: #f5f5f5 !important;
}

#ifcPanel .card-body,
#ifcPanel .tab-content {
  background-color: #f5f5f5 !important;
}

#ifcPanel .card-header {
  background-color: #f5f5f5 !important;
  border-bottom: 1px solid #dee2e6;
}

/* IFC-Tabs: Schriftgröße erhöht */
#ifcTabs .nav-link {
  font-size: 1.1rem !important;
}

/* IFC-Tabs: Gleiche Schriftfarbe wie "Eigenschaften" (schwarz) */
#ifcTabs .nav-link {
  color: #212529 !important; /* Schwarz wie "Eigenschaften" h5 */
}

#ifcTabs .nav-link:hover {
  color: #212529 !important;
  background-color: rgba(0, 0, 0, 0.05);
}

#ifcTabs .nav-link.active {
  color: #ffffff !important; /* Weiße Schrift für besseren Kontrast auf Farbverlauf */
  background: linear-gradient(135deg, rgba(0, 43, 54, 0.95) 0%, rgba(0, 139, 138, 0.95) 100%) !important;
  border-color: #dee2e6 #dee2e6 #f5f5f5;
  border-bottom-color: #f5f5f5 !important;
  font-weight: 600;
}

/* Trennstriche zwischen Tabs */
#ifcTabs .nav-item {
  border-right: 1px solid #dee2e6;
}

#ifcTabs .nav-item:last-child {
  border-right: none;
}

/* Historie-Tabs: Gleiches Styling wie IFC-Tabs */
#historyTabs .nav-link {
  font-size: 1.1rem !important;
  color: #212529 !important; /* Schwarz wie "Eigenschaften" */
}

#historyTabs .nav-link:hover {
  color: #212529 !important;
  background-color: rgba(0, 0, 0, 0.05);
}

#historyTabs .nav-link.active {
  color: #ffffff !important; /* Weiße Schrift für besseren Kontrast auf Farbverlauf */
  background: linear-gradient(135deg, rgba(0, 43, 54, 0.95) 0%, rgba(0, 139, 138, 0.95) 100%) !important;
  border-color: #dee2e6 #dee2e6 #f5f5f5;
  border-bottom-color: #f5f5f5 !important;
  font-weight: 600;
}

/* Trennstriche zwischen Historie-Tabs */
#historyTabs .nav-item {
  border-right: 1px solid #dee2e6;
}

#historyTabs .nav-item:last-child {
  border-right: none;
}

/* 🔹 Fullscreen Layout für Viewer-Seite */
.fullscreen-mode #viewerContainer {
  height: calc(100vh - 30px - 60px) !important;
}

.fullscreen-mode .card {
  height: calc(100vh - 30px - 70px) !important;
}

.fullscreen-mode .card-body {
  height: calc(100vh - 30px - 120px) !important;
  overflow-y: auto;
}

.fullscreen-mode #viewerCanvas {
  width: 100% !important;
  height: 100% !important;
}

/* 🔹 Viewer-Panel Anpassung wenn Seitenpanels ausgeblendet */
#viewerPanel.col-md-12 {
  width: 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

#viewerPanel.col-md-9 {
  width: 75% !important;
  flex: 0 0 75% !important;
  max-width: 75% !important;
}

#viewerPanel.col-md-6 {
  width: 50% !important;
  flex: 0 0 50% !important;
  max-width: 50% !important;
}