/* assets/reisetipps-admin.css - Modernes In-Page Admin & Drag-and-Drop */

/* Admin Bar am oberen Bildschirmrand */
.admin-toolbar {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(5, 11, 28, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border-bottom: 2px solid #d8b574;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.admin-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-badge {
  background: #d8b574;
  color: #050b1c;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e30613;
  display: inline-block;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.admin-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-admin {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-admin:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #fff;
  transform: translateY(-1px);
}

.btn-admin-primary {
  background: #e30613;
  border-color: #e30613;
  color: #fff;
}

.btn-admin-primary:hover {
  background: #c00410;
  border-color: #c00410;
}

.btn-admin-gold {
  background: #d8b574;
  border-color: #d8b574;
  color: #050b1c;
  font-weight: 700;
}

.btn-admin-gold:hover {
  background: #c49f5c;
  border-color: #c49f5c;
}

/* Kachel Styling im Admin-Modus */
.offer.admin-editable,
.offer.in {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.offer.admin-editable {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, opacity 0.25s ease;
  cursor: grab;
  overflow: visible !important; /* Verhindert jedes Abschneiden von Buttons */
}

.offer.admin-editable:active {
  cursor: grabbing;
}

.offer.is-dragging {
  opacity: 0.35 !important;
  transform: scale(0.93) !important;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2) !important;
  border: 2px dashed #888 !important;
  filter: grayscale(0.5);
}

.offer.admin-editable.is-dragging * {
  pointer-events: none !important;
}

/* Ziel-Kachel bewegt sich deutlich sichtbar bei Drag & Drop */
@keyframes card-drop-shift {
  0% {
    transform: translateY(18px) scale(0.95) rotate(0.8deg);
    box-shadow: 0 0 0 3px #e30613, 0 25px 45px rgba(227, 6, 19, 0.35);
  }
  50% {
    transform: translateY(26px) scale(0.93) rotate(-0.8deg);
    box-shadow: 0 0 0 4px #d8b574, 0 32px 60px rgba(216, 181, 116, 0.5);
  }
  100% {
    transform: translateY(18px) scale(0.95) rotate(0.8deg);
    box-shadow: 0 0 0 3px #e30613, 0 25px 45px rgba(227, 6, 19, 0.35);
  }
}

.offer.admin-editable.drag-over {
  animation: card-drop-shift 0.7s infinite ease-in-out !important;
  border: 3px dashed #e30613 !important;
  z-index: 40;
}

.offer.admin-editable.drag-over::after {
  content: '⇣ Hierhin verschieben (wird neue Position)';
  position: absolute;
  inset: 0;
  background: rgba(227, 6, 19, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border-radius: var(--r);
  z-index: 50;
  pointer-events: none;
  animation: drop-badge-pulse 0.7s infinite alternate ease-in-out;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4);
}

@keyframes drop-badge-pulse {
  0% { opacity: 0.92; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1.03); }
}

/* =========================================================
   Admin-Kopfzeile direkt auf jeder Kachel (100% voll sichtbar)
   ========================================================= */
.offer-admin-header {
  background: #050b1c;
  color: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top-left-radius: var(--r);
  border-top-right-radius: var(--r);
  border-bottom: 2px solid #d8b574;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 10;
}

/* Zeile 1: Neuer Reisetipp Links / Rechts Buttons */
.offer-insert-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-side-insert {
  background: #ffffff;
  color: #050b1c;
  border: 1.5px solid #e30613;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  white-space: nowrap;
}

.btn-side-insert:hover {
  background: #e30613;
  color: #ffffff;
  border-color: #e30613;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(227, 6, 19, 0.4);
}

.btn-insert-left {
  border-left: 4px solid #e30613;
}

.btn-insert-right {
  border-right: 4px solid #e30613;
}

/* Zeile 2: Drag Handle (Position) + Bearbeiten + Löschen */
.offer-admin-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.offer-admin-tools .offer-drag-handle {
  position: static;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #d8b574;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: grab;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.offer-admin-tools .offer-drag-handle:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.offer-admin-tools .offer-drag-handle:active {
  cursor: grabbing;
  background: rgba(216, 181, 116, 0.35);
  color: #fff;
}

.offer-admin-tools .offer-card-actions {
  position: static;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-card-action {
  background: rgba(5, 11, 28, 0.88);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-card-action:hover {
  background: #fff;
  color: #050b1c;
  transform: translateY(-1px);
}

.btn-card-insert {
  background: rgba(216, 181, 116, 0.95);
  color: #050b1c;
  border-color: #d8b574;
  font-weight: 700;
}

.btn-card-insert:hover {
  background: #fff;
  color: #050b1c;
}

.btn-card-delete:hover {
  background: #e30613;
  color: #fff;
  border-color: #e30613;
}

/* Add-Card am Ende des Grids */
.offer-add-card {
  border: 2.5px dashed #d8b574 !important;
  background: rgba(255, 255, 255, 0.7) !important;
  min-height: 440px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: none !important;
}

.offer-add-card:hover {
  background: #fff !important;
  border-color: #e30613 !important;
  transform: translateY(-8px) !important;
  box-shadow: 0 25px 50px -15px rgba(5, 11, 28, 0.18) !important;
}

.add-card-content {
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.add-card-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fdf6e9;
  color: #d8b574;
  font-size: 2.4rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(216, 181, 116, 0.2);
}

.offer-add-card:hover .add-card-icon {
  background: #e30613;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(227, 6, 19, 0.3);
}

.add-card-content h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #050b1c;
  margin: 0;
}

.add-card-content p {
  font-size: 0.92rem;
  color: #666;
  margin: 0;
  max-width: 260px;
  line-height: 1.4;
}

/* Einfügen-Buttons zwischen den Kacheln */
.insert-slot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  position: relative;
}

.insert-slot::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, #d8b574, #d8b574 6px, transparent 6px, transparent 12px);
  z-index: 1;
  opacity: 0.4;
}

.btn-insert-here {
  position: relative;
  z-index: 2;
  background: #fff;
  color: #050b1c;
  border: 2px solid #d8b574;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-insert-here:hover {
  background: #d8b574;
  color: #050b1c;
  transform: scale(1.05);
}

/* Modal Popup für Angebot erstellen / bearbeiten */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 11, 28, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.admin-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal {
  background: #fff;
  color: #050b1c;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0,0,0,0.5);
  border: 1px solid rgba(0,0,0,0.08);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  padding: 28px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.admin-modal-overlay.active .admin-modal {
  transform: scale(1);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.admin-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #050b1c;
  margin: 0;
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #888;
  padding: 4px 8px;
  border-radius: 6px;
}

.admin-modal-close:hover {
  color: #e30613;
  background: #f5f5f5;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #e30613;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.image-upload-zone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-upload-zone:hover,
.image-upload-zone.dragover {
  border-color: #e30613;
  background: #fff5f5;
}

.image-preview-box {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-preview-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.admin-modal-footer {
  border-top: 1px solid #eee;
  padding-top: 18px;
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Benachrichtigungen */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #050b1c;
  color: #fff;
  border-left: 4px solid #34a853;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  font-weight: 600;
  font-size: 0.92rem;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.admin-toast.toast-error {
  border-left-color: #e30613;
}
