/* Allgemeine Styles */
:root {
  --primary-color: #d40511; /* DPD Rot */
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --body-bg: #f5f5f5;
  --card-bg: #ffffff;
  --dpd-blue: #209bd8; /* DPD Blau */
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--body-bg);
  color: #333;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header Styles */
.main-header {
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
  position: relative;
  z-index: 100;
}

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

.logo img {
  max-height: 50px;
}

.main-nav .nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav .nav-item {
  margin-left: 20px;
}

.main-nav .nav-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  display: flex;
  align-items: center;
}

.main-nav .nav-link i {
  margin-right: 5px;
}

.main-nav .nav-link:hover {
  color: var(--dpd-blue);
}

/* Main Content Styles */
.main-content {
  padding: 30px 0;
  min-height: calc(100vh - 180px);
}

/* Welcome Section */
.welcome-section {
  background-color: var(--dpd-blue);
  color: white;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.welcome-title {
  margin: 0 0 10px;
  font-size: 2rem;
  font-weight: 700;
}

.welcome-text {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.user-welcome {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

/* Card Styles */
.card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  overflow: visible !important;
}

.card-header {
  background-color: #f8f9fa;
  padding: 20px;
  border-bottom: 1px solid #eee;
  overflow: visible !important;
  position: relative;
  z-index: 1;
}

.card-title {
  margin: 0 0 5px;
  font-size: 1.5rem;
  color: #333;
}

.card-description {
  margin: 0;
  color: #666;
}

.card-content {
  padding: 20px;
}

.card-body {
  overflow: visible !important;
  position: relative;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
  position: relative; /* Wichtig für Dropdown-Positionierung */
  overflow: visible !important;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--dpd-blue);
  box-shadow: 0 0 0 2px rgba(0, 99, 163, 0.2);
}

.form-check {
  display: flex;
  align-items: center;
}

.form-check-input {
  margin-right: 10px;
}

.form-text {
  font-size: 0.875rem;
  color: #666;
  margin-top: 5px;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn i {
  margin-right: 5px;
}

.btn-primary {
  background-color: var(--dpd-blue);
  color: #fff;
}

.btn-primary:hover {
  background-color: #1a7bb8;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #fff;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: var(--danger-color);
  color: #fff;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.875rem;
}

.btn-outline-primary {
  background-color: transparent;
  border: 1px solid var(--dpd-blue);
  color: var(--dpd-blue);
}

.btn-outline-primary:hover {
  background-color: var(--dpd-blue);
  color: white;
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Status Badge Styles */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-created {
  background-color: #e3f2fd;
  color: #0d47a1;
}

.status-picked_up {
  background-color: #fff8e1;
  color: #ff8f00;
}

.status-in_transit {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-out_for_delivery {
  background-color: #fff3e0;
  color: #e65100;
}

.status-delivered {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-exception {
  background-color: #ffebee;
  color: #c62828;
}

.status-self_delivery {
  background-color: #e0f7fa;
  color: #006064;
}

.status-active {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-inactive {
  background-color: #ffebee;
  color: #c62828;
}

/* Alert Styles */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.alert-icon {
  margin-right: 10px;
  font-size: 1.25rem;
}

.alert-success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #2e7d32;
}

.alert-danger {
  background-color: #ffebee;
  color: #c62828;
  border-left: 4px solid #c62828;
}

.alert-warning {
  background-color: #fff8e1;
  color: #ff8f00;
  border-left: 4px solid #ff8f00;
}

.alert-info {
  background-color: #e3f2fd;
  color: #0d47a1;
  border-left: 4px solid #0d47a1;
}

/* Hero Section Styles */
.hero {
  background-color: var(--dpd-blue);
  color: #fff;
  padding: 60px 0;
  margin-bottom: 30px;
  border-radius: 8px;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.hero-description {
  font-size: 1.25rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* Admin Section Styles */
.admin-section {
  margin-bottom: 30px;
}

.admin-section h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.admin-tabs {
  margin-bottom: 30px;
}

.nav-tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  border-bottom: 1px solid #ddd;
}

.nav-tabs .nav-item {
  margin-bottom: -1px;
}

.nav-tabs .nav-link {
  display: block;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  text-decoration: none;
  color: #666;
  transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
  border-color: #eee #eee #ddd;
}

.nav-tabs .nav-link.active {
  color: #495057;
  background-color: #fff;
  border-color: #ddd #ddd #fff;
}

.tab-content > .tab-pane {
  display: none;
}

.tab-content > .active {
  display: block;
}

.admin-settings-section {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.admin-settings-section h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.admin-settings-section p {
  margin-bottom: 15px;
}

/* Stat Box Styles */
.stat-box {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s;
  margin-bottom: 20px;
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 2.5rem;
  color: var(--dpd-blue);
  margin-bottom: 10px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 1rem;
  color: #666;
}

/* Form Row Styles */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.form-row > .form-group {
  padding-right: 10px;
  padding-left: 10px;
  flex: 1;
}

.col-md-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-md-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

/* Utility Classes */
.mt-2 {
  margin-top: 10px;
}

.mt-3 {
  margin-top: 15px;
}

.mt-4 {
  margin-top: 20px;
}

.mb-3 {
  margin-bottom: 15px;
}

.mb-4 {
  margin-bottom: 20px;
}

.text-center {
  text-align: center;
}

.text-end {
  text-align: right;
}

/* Footer Styles */
.main-footer {
  background-color: #fff;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
  padding: 20px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-info p {
  margin: 0;
  color: #666;
}

.footer-links ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-left: 20px;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--dpd-blue);
}

/* Row and Column Styles */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-12,
.col-md-3,
.col-md-4,
.col-md-6,
.col-md-8 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-md-3 {
  flex: 0 0 25%;
  max-width: 25%;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
  }

  .logo {
    margin-bottom: 15px;
  }

  .main-nav .nav-list {
    flex-direction: column;
  }

  .main-nav .nav-item {
    margin: 5px 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-info {
    margin-bottom: 15px;
  }

  .footer-links ul {
    flex-direction: column;
  }

  .footer-links li {
    margin: 5px 0;
  }

  .form-row {
    flex-direction: column;
  }

  .col-md-4,
  .col-md-6,
  .col-md-8 {
    max-width: 100%;
  }

  .welcome-section .row {
    flex-direction: column;
  }

  .welcome-section .text-end {
    text-align: center;
    margin-top: 15px;
  }
}

/* Dropdown-Menü Fixes - Hinzugefügt für die Kundennummer-Suche */
#customer-suggestions-container {
  position: relative;
  margin-top: -1px;
  z-index: 9999 !important; /* Sehr hoher z-index */
}

#customer-suggestions {
  position: absolute;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000 !important; /* Noch höherer z-index */
  background-color: #fff;
  border: 1px solid #007bff; /* Blaue Umrandung für bessere Sichtbarkeit */
  border-radius: .25rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); /* Stärkerer Schatten */
  left: 0;
  right: 0;
}

.form-control[readonly] {
  background-color: #e9ecef;
  opacity: 1;
}

/* Ändern Sie die Klasse .selected-customer-info von grün zu hellblau */
.selected-customer-info {
  background-color: #e3f2fd; /* Hellblau statt #d4edda (grün) */
  border-color: #b3e0ff; /* Passende Rahmenfarbe */
  color: #0d47a1; /* Dunklere blaue Textfarbe */
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  margin-bottom: 15px;
  font-weight: bold;
  text-align: center;
}

/* Stellen Sie sicher, dass das Dropdown-Menü nicht abgeschnitten wird */
.card-body {
  overflow: visible !important;
  position: relative; /* Hinzugefügt, um den z-index-Kontext zu erstellen */
}

/* Stellen Sie sicher, dass alle übergeordneten Container das Dropdown nicht abschneiden */
.container,
.row,
.col-md-6,
.col-md-12,
.card,
.card-body,
.form-group {
  overflow: visible !important;
}

/* Template-Vorschläge Styling */
#template-suggestions-container {
  position: relative;
  margin-top: -1px;
  z-index: 9999 !important;
}

#template-suggestions {
  position: absolute;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000 !important;
  background-color: #fff;
  border: 1px solid #007bff;
  border-radius: .25rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  left: 0;
  right: 0;
}

#template-suggestions .list-group-item {
  padding: 8px 12px;
  font-size: 0.9rem;
}

#template-suggestions .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Verbesserte Styles für die Template-Suche */
#template-suggestions-container {
  position: relative;
  z-index: 9999 !important;
  margin-bottom: 15px;
}

#template-suggestions {
  position: absolute;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000 !important;
  background-color: #fff;
  border: 1px solid #007bff;
  border-radius: .25rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  left: 0;
  right: 0;
}

#template-suggestions .list-group-item {
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

#template-suggestions .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Stellen Sie sicher, dass alle Container das Dropdown nicht abschneiden */
.container,
.row,
.col-md-12,
.card,
.card-body,
.card-header {
  overflow: visible !important;
}

/* Stellen Sie sicher, dass das Suchfeld anklickbar ist */
#template_search {
  position: relative;
  z-index: 1001 !important;
}

/* Stellen Sie sicher, dass der Such-Button anklickbar ist */
#search-templates-btn {
  position: relative;
  z-index: 1001 !important;
}

/* Fügen Sie diese CSS-Regeln am Ende der Datei hinzu, um sicherzustellen, dass das Template-Suchfeld korrekt angezeigt wird und anklickbar ist */

/* Verbesserte Styles für die Template-Suche */
.card-header.d-flex {
  position: relative;
  z-index: 1;
  overflow: visible !important;
}

.form-inline {
  position: relative;
  z-index: 2;
}

.input-group-sm {
  position: relative;
  z-index: 3;
}

#template_search {
  position: relative;
  z-index: 1001 !important;
}

#search-templates-btn {
  position: relative;
  z-index: 1001 !important;
}

/* Stellen Sie sicher, dass der Card-Header das Suchfeld nicht überdeckt */
.card-header {
  overflow: visible !important;
}

/* Erhöhen Sie den z-index für das Template-Suchfeld */
.card-header .form-inline .input-group {
  position: relative;
  z-index: 1050 !important;
}

/* Stellen Sie sicher, dass das Dropdown über allem anderen liegt */
#template-suggestions {
  z-index: 1060 !important;
}

/* Füge am Ende der Datei diese Styles hinzu, um das Suchfeld hervorzuheben */

/* Hervorgehobenes Suchfeld für Empfänger-Vorlagen */
#template_search {
  border: 2px solid #209bd8;
  box-shadow: 0 0 5px rgba(0, 99, 163, 0.2);
}

#template_search:focus {
  border-color: #209bd8;
  box-shadow: 0 0 8px rgba(0, 99, 163, 0.4);
}

#search-templates-btn {
  background-color: #209bd8;
  border-color: #209bd8;
}

#search-templates-btn:hover {
  background-color: #1a7bb8;
  border-color: #1a7bb8;
}

/* Verbesserte Darstellung der Vorlagen-Ergebnisse */
#template-results .list-group-item {
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

#template-results .list-group-item:hover {
  background-color: #f0f7ff;
  border-left: 4px solid #209bd8;
  transform: translateX(5px);
}

#template-results h6 {
  color: #209bd8;
  font-weight: 600;
}

/* Füge am Ende der Datei die Drag & Drop Styles hinzu */

/* Drag & Drop Styles für Bulk Shipment */
.drag-drop-area {
  border: 2px dashed #ccc;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 20px;
  margin-bottom: 20px;
}

.drag-drop-hover {
  border-color: var(--dpd-blue);
  background-color: rgba(0, 99, 163, 0.05);
}

.selected-file {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
}

.selected-file-name {
  font-weight: 500;
}

.file-preview {
  padding: 10px;
}

/* Verbesserte Fortschrittsanzeige */
.progress {
  height: 10px;
  border-radius: 5px;
  margin-top: 15px;
  margin-bottom: 15px;
  overflow: hidden;
}

.progress-bar-animated {
  animation: progress-bar-stripes 1s linear infinite;
}

.progress-bar-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

/* Verbesserte Ergebnisdarstellung */
.result-summary-card {
  transition: all 0.3s ease;
  border-radius: 8px;
  margin-bottom: 20px;
}

.result-summary-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Verbesserte Badge-Styles */
.badge-success {
  background-color: #28a745;
  color: white;
}

.badge-danger {
  background-color: #dc3545;
  color: white;
}

.badge {
  padding: 0.5em 0.75em;
  font-weight: 500;
  border-radius: 4px;
}

/* Füge am Ende der Datei die Timeline-Styles hinzu */

/* Timeline-Styling */
.timeline {
  position: relative;
  padding-left: 30px;
  margin-bottom: 20px;
}

.timeline:before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e9ecef;
}

.timeline-item {
  position: relative;
  margin-bottom: 25px;
}

.timeline-marker {
  position: absolute;
  left: -30px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6c757d;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e9ecef;
}

.timeline-marker-current {
  background: #28a745;
}

.timeline-content {
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.timeline-title {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.timeline-date {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 5px;
}

.timeline-location,
.timeline-info {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.timeline-additional-code {
  margin-bottom: 2px;
}

/* Horizontale Timeline mit Pfeilen */
.status-timeline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
  position: relative;
  padding: 0 20px;
}

.status-timeline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #e9ecef;
  z-index: 1;
}

.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  min-width: 120px;
}

.status-point {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #e9ecef;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e9ecef;
  margin-bottom: 10px;
  position: relative;
  z-index: 3;
}

.status-point-active {
  background-color: #b3e0ff;
  box-shadow: 0 0 0 2px #209bd8;
}

.status-label {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  color: #333;
  max-width: 120px;
  word-wrap: break-word;
}

.status-arrow {
  position: absolute;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 1.2rem;
  z-index: 2;
}

.status-details {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #6c757d;
  text-align: center;
}

.status-date {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 5px;
}

@media (max-width: 768px) {
  .status-timeline {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 30px;
  }

  .status-timeline::before {
    top: 0;
    bottom: 0;
    left: 15px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .status-step {
    flex-direction: row;
    width: 100%;
    margin-bottom: 20px;
    align-items: flex-start;
  }

  .status-point {
    margin-right: 15px;
    margin-bottom: 0;
  }

  .status-label {
    text-align: left;
    max-width: none;
  }

  .status-arrow {
    display: none;
  }
}
