/* ===== Ticket-Modul: Layout & Styling (Bootstrap-basiert) ===== */

/* Icon-Kreise */
.ticket-icon-circle {
  width: 4rem;
  height: 4rem;
}
.ticket-icon-circle-sm {
  width: 3rem;
  height: 3rem;
}

/* Chat-Nachrichtenbereich */
.ticket-chat-messages {
  min-height: 280px;
  max-height: 58vh;
  overflow-y: auto;
  contain: layout;
}

/* Ticket-Detail: kompaktes Chat – feste Höhe, nur Nachrichten scrollen */
.ticket-detail-page {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.ticket-detail-page .ticket-detail-card {
  display: flex;
  flex-direction: column;
  height: 70vh;
  min-height: 400px;
}
.ticket-detail-card .ticket-detail-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}
/* Chat-Nachrichten: 90 % der verfügbaren Höhe im Card-Body, Rest für Eingabezeile */
.ticket-detail-card .ticket-chat-messages {
  flex: 0 0 90%;
  min-height: 0;
  max-height: 90%;
  overflow-y: auto;
}
.ticket-detail-card .ticket-reply-area {
  flex-shrink: 0;
}

/* Chat-Bubbles */
.ticket-msg-bubble {
  max-width: 80%;
}
.ticket-msg-internal {
  background-color: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.5);
}
.ticket-msg-bubble .ticket-msg-delete-btn {
  opacity: 0.7;
  vertical-align: middle;
  color: var(--bs-danger) !important;
}
.ticket-msg-bubble .ticket-msg-delete-btn:hover {
  opacity: 1;
  color: var(--bs-danger) !important;
}
.ticket-msg-bubble .ticket-img-link,
.ticket-msg-bubble .admin-chat-img-link {
  display: inline-block;
  max-width: 220px;
}
.ticket-msg-bubble img,
.ticket-chat-messages .ticket-msg-bubble img {
  max-width: 220px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: cover;
}

/* Listen-Cards (Meine Tickets / Alle Tickets) */
.ticket-list-item {
  transition: box-shadow 0.2s, border-color 0.2s;
}
.ticket-list-item:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  border-color: var(--bs-primary);
}
.ticket-row-clickable {
  cursor: pointer;
}

/* Verstecktes File-Input (klickbar via Label) */
.ticket-file-input-hidden {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* Form-Constraints */
.ticket-search-input {
  max-width: 260px;
}
.ticket-filter-select {
  max-width: 200px;
}

/* Alle Tickets: Suche und Filter einheitlich */
#alle-tickets-filter-form .input-group > .form-control,
#alle-tickets-filter-form .input-group > .form-select,
#alle-tickets-filter-form .input-group > .btn {
  min-height: 38px;
}
#alle-tickets-filter-form .ticket-alle-search-input {
  min-width: 200px;
  flex: 1 1 300px;
}
#alle-tickets-filter-form .ticket-alle-filter-select {
  width: 200px;
  flex: 0 0 200px;
}
.ticket-reply-template-select {
  max-width: 280px;
}
.ticket-admin-header.sticky-top {
  z-index: 1020;
}
.ticket-btn-group-max {
  max-width: 280px;
}

/* Erfolgs-Toast (Ticket erstellt) */
.ticket-created-toast {
  position: fixed !important;
  bottom: 1rem !important;
  right: 1rem !important;
  left: auto !important;
  top: auto !important;
  z-index: 9999;
  max-width: 360px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.ticket-created-toast.ticket-created-toast-hide {
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
}

/* Startseite Ticket-Modul */
.ticket-start-card .card-body {
  padding: 2rem 1.5rem 2.5rem !important;
}
@media (min-width: 576px) {
  .ticket-start-card .card-body {
    padding: 2.5rem 2rem 3rem !important;
  }
}
/* Ticket-Start: Hero-Bereich */
.ticket-start-hero {
  padding: 0 0 1rem;
  margin-bottom: 0.25rem;
}
.ticket-start-hero-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  margin-bottom: 1.25rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.12) 0%, rgba(13, 110, 253, 0.06) 100%);
  color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0.25rem 1rem rgba(13, 110, 253, 0.15);
}
.ticket-start-hero-icon {
  font-size: 2.25rem;
}
.ticket-start-hero-logo-wrap {
  display: inline-block;
  margin-bottom: 1.25rem;
}
.ticket-start-hero-logo-wrap .ticket-start-hero-logo {
  display: block;
  vertical-align: middle;
}
@media (min-width: 576px) {
  .ticket-start-hero-logo-wrap {
    margin-bottom: 1.5rem;
  }
}
.ticket-start-hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bs-body-color, #212529);
  margin-bottom: 0.6rem;
  line-height: 1.25;
}
.ticket-start-hero-lead {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--bs-secondary-color, #6c757d);
  max-width: 32em;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
}
@media (min-width: 576px) {
  .ticket-start-hero {
    padding: 0 0 1.25rem;
  }
  .ticket-start-hero-icon-wrap {
    width: 5.5rem;
    height: 5.5rem;
    margin-bottom: 1.5rem;
    border-radius: 1.5rem;
  }
  .ticket-start-hero-icon {
    font-size: 2.5rem;
  }
  .ticket-start-hero-title {
    font-size: 2rem;
  }
  .ticket-start-hero-lead {
    font-size: 1.1rem;
  }
}
/* Typische Anfragen-Box */
.ticket-start-topics {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
  margin-top: 1rem !important;
  padding-top: 1rem;
  text-align: center;
}
.ticket-start-topics-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.1rem;
  color: var(--bs-body-color, #212529);
}
.ticket-start-topics-subtitle {
  font-size: 0.8rem;
  margin-bottom: 0.5rem !important;
}
.ticket-start-topics-list {
  max-width: 420px;
  text-align: left;
  font-size: 0.875rem;
  color: var(--bs-secondary-color, #6c757d);
  line-height: 1.5;
}
.ticket-start-topics-list li {
  padding: 0.2rem 0;
  padding-left: 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.ticket-start-topics-list li:last-child {
  border-bottom: none;
}
.ticket-start-topics-list .fa-check-circle {
  font-size: 0.85em;
  opacity: 0.9;
}
.ticket-start-buttons {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  flex-wrap: wrap;
  justify-content: center;
}
.ticket-start-buttons-row {
  flex-direction: row;
}
.ticket-start-buttons-column {
  flex-direction: column;
  align-items: center;
}
.ticket-start-btn {
  flex: 1 1 95px;
  min-width: 95px;
  max-width: 130px;
  aspect-ratio: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem;
  border-radius: 0.3rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
  box-sizing: border-box;
}
.ticket-start-buttons-column .ticket-start-btn {
  flex: 0 1 auto;
  width: 100%;
  max-width: 140px;
}
.ticket-start-btn-icon {
  font-size: 2.1rem;
}
@media (max-width: 499px) {
  .ticket-start-buttons-row .ticket-start-btn {
    min-width: 85px;
    flex: 1 1 85px;
  }
  .ticket-start-btn {
    aspect-ratio: auto;
    min-height: 36px;
    flex-direction: row;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
  .ticket-start-btn-icon {
    font-size: 0.95rem;
  }
}

/* Bildvorschau (Erstellen) */
.ticket-preview-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
}
.ticket-preview-remove {
  padding: 0.1rem 0.35rem;
}

/* Bildvorschau (Chat) */
.ticket-image-preview-box {
  max-width: 120px;
}
.ticket-image-preview-img {
  max-height: 100px;
  object-fit: cover;
}

/* Modal-Bild */
.ticket-modal-img {
  max-height: 85vh;
}

/* URLs in Nachrichten */
.ticket-msg-link {
  color: inherit;
  text-decoration: underline;
}
.ticket-msg-link:hover {
  color: inherit;
  text-decoration: underline;
  opacity: 0.9;
}

/* Fokus & Accessibility */
.ticket-form-control:focus,
.ticket-chat-messages .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}
.ticket-list-item:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* Switch größer */
.ticket-switch-lg {
  width: 3em;
  height: 1.5em;
  cursor: pointer;
}
.ticket-switch-label {
  cursor: pointer;
}

/* Ticket erstellen: Schritte */
.ticket-create-step {
  padding-left: 1.25rem;
  margin-left: 0.25rem;
}
.ticket-create-step-1 { border-left: 4px solid var(--bs-primary); }
.ticket-create-step-1 .ticket-step-badge { background: var(--bs-primary); }
.ticket-create-step-2 { border-left: 4px solid var(--bs-success); }
.ticket-create-step-2 .ticket-step-badge { background: var(--bs-success); }
.ticket-create-step-3 { border-left: 4px solid var(--bs-warning); }
.ticket-create-step-3 .ticket-step-badge { background: var(--bs-warning); color: var(--bs-dark); }
.ticket-create-step-4 { border-left: 4px solid var(--bs-info); }
.ticket-create-step-4 .ticket-step-badge { background: var(--bs-info); color: var(--bs-dark); }
.ticket-create-step-5 { border-left: 4px solid var(--bs-secondary); }
.ticket-create-step-5 .ticket-step-badge { background: var(--bs-secondary); }
.ticket-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}



/* Ticket erstellen: Kategorie-Grid */
.ticket-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}
.ticket-category-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  border: 2px solid #dee2e6;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.ticket-category-option:hover {
  border-color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}
.ticket-category-option.active {
  border-color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}
.ticket-category-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ticket-category-icon {
  font-size: 1.5rem;
  color: var(--bs-primary);
  margin-bottom: 0.25rem;
}
.ticket-category-label {
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.2;
}

.ticket-title-counter {
  display: block;
  margin-top: 0.25rem;
}

/* Ticket erstellen: Responsive */
@media (max-width: 768px) {
  .ticket-create-title.form-control-lg,
  .ticket-create-title.form-control {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }
  .ticket-category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }
  .ticket-category-option {
    padding: 0.4rem 0.25rem;
  }
  .ticket-category-icon {
    font-size: 1rem;
    margin-bottom: 0.15rem;
  }
  .ticket-category-label {
    font-size: 0.65rem;
    line-height: 1.15;
  }
}

/* Mobile: Größere Touch-Targets */
@media (max-width: 768px) {
  .ticket-chat-messages + .p-3 .btn,
  .ticket-chat-messages + .p-3 textarea,
  .ticket-chat-messages + .p-3 .form-check-input {
    min-height: 44px;
  }
  .ticket-chat-messages + .p-3 .btn-sm {
    min-height: 38px;
    padding: 0.4rem 0.6rem;
  }
}

