/* =====================================================
   DISPOSITION CSS
   Ausgelagerte Styles für disposition.js
===================================================== */

/* Karten-Modal Overlay */
#dispMapOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999997 !important;
}

/* Karten-Modal Container */
#dispMapContainer {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 1400px;
  max-width: 96vw;
  height: calc(100vh - 60px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 999998 !important;
  overflow: hidden;
}

/* Karten-Modal Header */
#dispMapContainer .modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  color: #212529;
}

#dispMapContainer .modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

#dispMapContainer .modal-header .close-btn {
  background: #e9ecef;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: #495057;
  transition: all 0.2s;
}

#dispMapContainer .modal-header .close-btn:hover {
  background: #dee2e6;
}

/* Karten-Modal Content */
#dispMapContainer .modal-content {
  display: flex;
  flex-direction: row; /* Horizontal: Sidebar links, Karte rechts */
  width: 100%;
  height: calc(100% - 76px);
}

/* Route Sidebar */
#routeSidebar {
  order: 0; /* Immer links */
  width: 420px;
  flex-shrink: 0; /* Fixe Breite */
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  background: #f8f9fa;
}

/* Map Container */
#dispMapDiv {
  order: 1; /* Immer rechts */
  flex: 1;
  position: relative;
  border: none; /* Entferne doppelte Border */
  box-sizing: border-box;
}

/* Drag & Drop Placeholder */
.route-drag-placeholder {
  border: 2px dashed #007bff;
  border-radius: 4px;
  background: rgba(0, 123, 255, 0.1);
  margin-bottom: 4px;
}

/* Route Stop Item Dragging */
.route-stop-item.dragging {
  opacity: 0.4;
}

/* Error Modal */
.error-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000000;
}

.error-modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.error-modal-title {
  margin-top: 0;
  color: #dc3545;
}

.error-modal-subtitle {
  color: #666;
  margin-bottom: 20px;
}

.error-address-box {
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 6px;
  background: #f8f9fa;
}

.error-address-header {
  font-weight: bold;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-address-text {
  margin-bottom: 12px;
  font-family: monospace;
  background: white;
  padding: 8px;
  border-radius: 4px;
}

.error-sendungen-list {
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid #ddd;
}

.error-sendung-item {
  font-size: 13px;
  margin: 4px 0;
}

/* Edit Modal */
.edit-address-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
}

.edit-address-modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1000000 !important;
}

.edit-address-modal h3 {
  margin-top: 0;
  color: #333;
}

.edit-address-modal .form-group {
  margin-bottom: 15px;
}

.edit-address-modal label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.edit-address-modal input,
.edit-address-modal select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Search Input Styles */
.disposition-search-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* Search Results Box */
.search-results-box {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.search-results-box:hover {
  background: #f5f5f5;
}

/* =====================================================
   SWEETALERT2 MODAL STYLES
===================================================== */

/* Zwischenstopp Modal Container */
.swal-form-container {
  text-align: left;
}

.swal-form-grid {
  display: grid;
  gap: 20px;
}

/* Fieldsets */
.swal-fieldset {
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 6px;
}

.swal-legend {
  font-weight: 600;
  color: #333;
  padding: 0 10px;
}

/* Labels */
.swal-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

/* Form Groups */
.swal-form-group {
  display: grid;
  gap: 12px;
}

/* Input Fields */
.swal-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Zwischenstopp Select */
.zwischenstopp-select {
  position: relative;
}

.search-select-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.zwischenstopp-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  max-height: 250px;
  overflow: hidden;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-top: 2px;
}

.zwischenstopp-search-input {
  width: calc(100% - 20px);
  margin: 10px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.zwischenstopp-search-results-list {
  max-height: 180px;
  overflow-y: auto;
}

/* Grid Layouts */
.swal-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.swal-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.swal-col-span-full {
  grid-column: 1 / -1;
}

.swal-col-span-2 {
  grid-column: 2 / -1;
}

/* SweetAlert2 Button Styling - gleich wie andere Modals */
.swal2-actions {
  margin-top: 20px !important;
  gap: 10px !important;
}

.swal2-confirm,
.swal2-cancel {
  padding: 12px 24px !important;
  font-size: 15px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  margin: 0 !important;
}

.swal2-confirm.primary {
  background-color: #4CAF50 !important;
  color: white !important;
  border: none !important;
}

.swal2-confirm.primary:hover {
  background-color: #45a049 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3) !important;
}

.swal2-cancel {
  background-color: #f5f5f5 !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
}

.swal2-cancel:hover {
  background-color: #e9e9e9 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* =====================================================
   UNSAVED CHANGES INDICATOR
===================================================== */

/* Speichern-Button mit ungespeicherten Änderungen */
#btnSaveTourentag.has-unsaved-changes {
  animation: pulse-save 2s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

#btnSaveTourentag .unsaved-badge {
  display: inline-block;
  color: #4CAF50;
  font-size: 20px;
  margin-left: 6px;
  animation: blink 1.5s ease-in-out infinite;
  vertical-align: middle;
  line-height: 1;
}

@keyframes pulse-save {
  0%, 100% { 
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3); 
  }
  50% { 
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.5); 
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
