/* TOOOL-CRM: Bootstrap 3 → Bootstrap 5 Compatibility Layer
 * Dieses CSS stellt Bootstrap 3 Styling in Bootstrap 5 wieder her
 * Füge diese Datei zur index.html hinzu NACH bootstrap.min.css
 */

/* ============================================
   PANELS → CARDS
   Bootstrap 5 hat keine .panel mehr
   ============================================ */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;
  margin-bottom: 20px;
}

.panel-default {
  border-color: #ddd;
}

.panel-primary {
  border-color: #337ab7;
}

.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
  background-color: #f5f5f5;
  font-weight: 600;
}

.panel-default > .panel-heading {
  background-color: #f5f5f5;
  border-color: #ddd;
  color: #333;
}

.panel-primary > .panel-heading {
  background-color: #337ab7;
  border-color: #337ab7;
  color: #fff;
}

.panel-body {
  flex: 1 1 auto;
  padding: 15px;
}

.panel-footer {
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  border-bottom-right-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: inherit;
}

/* ============================================
   WELLS
   Bootstrap 5 hat kein .well mehr
   ============================================ */

.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}

.well-sm {
  padding: 9px;
  border-radius: 3px;
}

.well-lg {
  padding: 24px;
  border-radius: 6px;
}

/* ============================================
   LABELS → BADGES
   Bootstrap 5 hat .label entfernt
   ============================================ */

.label {
  display: inline;
  padding: 0.2em 0.6em 0.3em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25em;
}

.label-default {
  background-color: #777;
}

.label-primary {
  background-color: #337ab7;
}

.label-success {
  background-color: #5cb85c;
}

.label-info {
  background-color: #5bc0de;
}

.label-warning {
  background-color: #f0ad4e;
}

.label-danger {
  background-color: #d9534f;
}

/* ============================================
   GRID SYSTEM CHANGES
   Bootstrap 5 entfernte .col-xs-*
   ============================================ */

/* XS Grid (Extra Small) - < 576px */
.col-xs-1 { width: 8.33333333%; }
.col-xs-2 { width: 16.66666667%; }
.col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.33333333%; }
.col-xs-5 { width: 41.66666667%; }
.col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.33333333%; }
.col-xs-8 { width: 66.66666667%; }
.col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.33333333%; }
.col-xs-11 { width: 91.66666667%; }
.col-xs-12 { width: 100%; }

@media (min-width: 576px) {
  .col-xs-1,
  .col-xs-2,
  .col-xs-3,
  .col-xs-4,
  .col-xs-5,
  .col-xs-6,
  .col-xs-7,
  .col-xs-8,
  .col-xs-9,
  .col-xs-10,
  .col-xs-11,
  .col-xs-12 {
    width: auto;
  }
}

/* ============================================
   BUTTON CHANGES
   Bootstrap 5 entfernte .btn-default
   ============================================ */

.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}

.btn-default:hover {
  color: #333;
  background-color: #e6e6e6;
  border-color: #adadad;
}

.btn-default:active,
.btn-default.active {
  background-color: #e6e6e6;
  border-color: #adadad;
}

/* ============================================
   FORM CHANGES
   Bootstrap 5 Form-Struktur geändert
   ============================================ */

.form-horizontal .form-group {
  margin-left: -15px;
  margin-right: -15px;
}

.form-horizontal .control-label {
  padding-top: 7px;
  margin-bottom: 0;
  text-align: right;
}

/* ============================================
   NAVBAR CHANGES
   Bootstrap 5 hat andere Navbar-Struktur
   ============================================ */

.navbar-default {
  background-color: #f8f8f8;
  border-color: #e7e7e7;
}

.navbar-default .navbar-nav > li > a {
  color: #777;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: #333;
  background-color: transparent;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: #555;
  background-color: #e7e7e7;
}

/* ============================================
   HELPER CLASSES
   Bootstrap 5 entfernte einige Helper
   ============================================ */

.pull-right {
  float: right !important;
}

.pull-left {
  float: left !important;
}

.text-left {
  text-align: left !important;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

/* ============================================
   LOADING SPINNER FIX
   Stelle sicher dass Spinner sichtbar ist
   ============================================ */

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   TABLE RESPONSIVE
   Bootstrap 5 hat andere Responsive-Tables
   ============================================ */

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   GLYPHICONS REPLACEMENT
   Bootstrap 5 hat keine Glyphicons mehr
   Font Awesome sollte bereits geladen sein
   ============================================ */

.glyphicon {
  font-family: 'FontAwesome';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.glyphicon-search:before { content: "\f002"; }
.glyphicon-envelope:before { content: "\f0e0"; }
.glyphicon-user:before { content: "\f007"; }
.glyphicon-plus:before { content: "\f067"; }
.glyphicon-remove:before { content: "\f00d"; }
.glyphicon-ok:before { content: "\f00c"; }
.glyphicon-trash:before { content: "\f1f8"; }
.glyphicon-pencil:before { content: "\f040"; }
.glyphicon-download:before { content: "\f019"; }
.glyphicon-upload:before { content: "\f093"; }

/* ============================================
   CUSTOM TOOOL-CRM FIXES
   Spezifische Anpassungen für die App
   ============================================ */

/* Fix für Card-Layout in Contract-View */
.card-container {
  margin-bottom: 20px;
}

.card-header {
  font-weight: 600;
  background-color: #f5f5f5;
}

/* Fix für Tabs */
.nav-tabs {
  border-bottom: 1px solid #ddd;
}

.nav-tabs > li > a {
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: #555;
  background-color: #fff;
  border: 1px solid #ddd;
  border-bottom-color: transparent;
  cursor: default;
}
