/* Copyright 2026-Heinrich Heintzmann, Grünberg */
/* Serifenlos, warm, keine Schreibschrift */
.warm-title {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.gallery-media-wrap {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drop-zone {
  border: 2px dashed #adb5bd;
  border-radius: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  background: #f8f9fa;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.drop-zone.drag-over {
  background: #e9ecef;
  border-color: #0d6efd;
}

.drop-zone-title {
  font-weight: 600;
}

.drop-zone-subtitle {
  color: #6c757d;
  font-size: 0.925rem;
}

.media-modal-image,
.media-modal-video {
  max-width: 100%;
  max-height: calc(100vh - 150px);
}

.media-modal-video {
  width: min(100%, 1200px);
}

.gallery-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
}


.modal-media-stack {
  width: 100%;
}

.modal-media-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-file-info {
  font-size: 0.95rem;
  color: rgba(255,255,255,.75);
}

.modal-comment-form {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}


.gallery-info {
  overflow-wrap: anywhere;
  word-break: normal;
}

.gallery-line {
  white-space: normal;
  line-height: 1.35;
  font-size: 0.92rem;
}

.gallery-filename {
  margin-bottom: 4px;
}

.gallery-exif {
  color: #666;
}

.gallery-actions {
  white-space: normal;
}

.gallery-media-wrap {
  width: 100%;
  height: 100%;
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}


.selected-files-box {
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.selected-files-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.selected-files-list {
  margin: 0;
  padding-left: 1.2rem;
}

.selected-files-list li {
  overflow-wrap: anywhere;
  word-break: normal;
}

.upload-spinner {
  width: 2rem;
  height: 2rem;
  border: 0.25rem solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
  animation: gallery-spin 0.9s linear infinite;
  margin: 0 auto 0.5rem auto;
}

.upload-progress-text {
  text-align: center;
  font-weight: 600;
}

@keyframes gallery-spin {
  to { transform: rotate(360deg); }
}

.modal-media-video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  background: #000;
}

#mediaModal .modal-body {
  text-align: center;
}


#mediaModal .modal-header {
  align-items: flex-start;
  gap: 0.75rem;
}

#mediaModal .modal-title {
  flex: 1 1 auto;
  min-width: 0;
}

.modal-title-compact {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.2;
}

.modal-title-name {
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: normal;
}

.modal-title-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 400;
  color: #666;
  overflow-wrap: anywhere;
}

#mediaModal .btn-close {
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

@media (max-width: 576px) {
  #mediaModal .modal-header {
    padding: 0.55rem 0.75rem;
  }

  .modal-title-name {
    font-size: 0.84rem;
  }

  .modal-title-meta {
    font-size: 0.68rem;
    gap: 0.12rem 0.5rem;
  }
}


#mediaModal .modal-header {
  background: #111;
  border-bottom-color: #222;
}

#mediaModal .modal-title {
  color: #fff;
}

.modal-title-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.75rem;
  width: 100%;
  min-width: 0;
}

.modal-title-name {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-title-meta-inline {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.15rem 0.7rem;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #fff;
}

.modal-title-meta-inline span {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

#mediaModal .btn-close {
  filter: invert(1);
}

@media (max-width: 576px) {
  .modal-title-inline {
    gap: 0.15rem 0.45rem;
  }

  .modal-title-name {
    font-size: 0.82rem;
  }

  .modal-title-meta-inline {
    font-size: 0.66rem;
    gap: 0.1rem 0.45rem;
  }
}


.modal-media-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

#mediaModal .modal-body {
  overflow: auto;
}



#mediaModal .modal-dialog {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  margin: 0;
}

#mediaModal .modal-content {
  height: 100vh;
  background: #000;
}

#mediaModal .modal-body {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mediaModal .modal-media-image,
#mediaModal .modal-media-video {
  max-width: 100%;
  max-height: calc(100vh - 95px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.media-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1060;
  border: 0;
  border-radius: 50%;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}

.media-modal-nav:disabled {
  opacity: 0.25;
}

.media-modal-prev {
  left: 0.75rem;
}

.media-modal-next {
  right: 0.75rem;
}

@media (max-width: 576px) {
  .media-modal-nav {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.7rem;
  }

  #mediaModal .modal-media-image,
  #mediaModal .modal-media-video {
    max-height: calc(100vh - 85px);
  }
}


.selected-files-box {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}


.user-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}


.password-rules {
  padding-left: 1.2rem;
}

.password-rules li {
  margin-bottom: 0.15rem;
}

.password-rule-ok {
  color: #198754;
}

.password-rule-bad {
  color: #dc3545;
}

#changePasswordBtn {
  line-height: 1;
  min-width: 2.1rem;
}


.js-toggle-password {
  min-width: 2.75rem;
}


.gallery-media-wrap {
  position: relative;
}

.gallery-download-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 4;
  border: 0;
  border-radius: 0.35rem;
  padding: 0.22rem 0.42rem;
  line-height: 1;
  font-size: 1rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
}

.gallery-download-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.gallery-select-checkbox {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 5;
  width: 1.25rem;
  height: 1.25rem;
  display: none;
}

.gallery-selection-mode .gallery-select-checkbox {
  display: block;
}

.gallery-selected .card {
  outline: 3px solid #0d6efd;
  outline-offset: 2px;
}


.gallery-title-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.gallery-sort-info {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: #495057;
}

.gallery-sort-direction-btn {
  border: 1px solid #ced4da;
  background: #fff;
  color: #212529;
  border-radius: 0.25rem;
  min-width: 1.55rem;
  height: 1.35rem;
  line-height: 1;
  padding: 0 0.25rem;
  font-size: 0.9rem;
}

.gallery-sort-direction-btn:hover {
  background: #f8f9fa;
}

.selection-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.gallery-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, max-content);
  column-gap: 1.25rem;
  row-gap: 0.75rem;
  align-items: end;
}

.gallery-filter-item {
  min-width: 0;
}


.form-select.form-select-sm {
  font-size: 0.875rem;
}

@media (max-width: 991.98px) {
  .gallery-filter-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}


/* Korrektur: einheitliche Thumbnail-Darstellung in allen Karten */
#galleryGrid .ratio.ratio-1x1 {
  position: relative;
  overflow: hidden;
}

#galleryGrid .gallery-media-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#galleryGrid .gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Download-Button nicht im Vorschaubild, sondern bei den Informationen */
.gallery-info-download-row {
  display: flex;
  justify-content: flex-start;
}

.gallery-info-download-row .btn {
  white-space: normal;
}

/* Auswahl-Checkbox bleibt im Bildbereich sichtbar, wenn Auswahlmodus aktiv ist */
.gallery-select-checkbox {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 5;
}

/* Alter Overlay-Downloadbutton wird, falls aus Cache/Altmarkup vorhanden, ausgeblendet */
.gallery-media-wrap > .gallery-download-btn {
  display: none !important;
}


/* Reparatur Thumbnail-Ausgabe: stabiler Stand mit Beschreibung unter dem Vorschaubild */
#galleryGrid .gallery-thumb-frame {
  overflow: hidden;
  background: #f8f9fa;
}

#galleryGrid .gallery-media-wrap {
  position: relative !important;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f8f9fa;
}

#galleryGrid .gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  display: block !important;
}

#galleryGrid video.gallery-thumb {
  object-fit: cover !important;
}

.gallery-info {
  overflow-wrap: anywhere;
  word-break: normal;
}

.gallery-line {
  white-space: normal;
  line-height: 1.35;
  font-size: 0.92rem;
}

.gallery-filename {
  margin-bottom: 4px;
}

.gallery-exif {
  color: #666;
}

.gallery-info-download-row {
  display: flex;
  justify-content: flex-start;
}

.gallery-media-wrap > .gallery-download-btn {
  display: none !important;
}


/* Finale Bereinigung Thumbnail-/Kartenlayout */
#galleryGrid .gallery-card {
  overflow: hidden;
}

#galleryGrid .gallery-thumb-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8f9fa;
  overflow: hidden;
  position: relative;
  display: block;
}

#galleryGrid .gallery-thumb-box .gallery-media-wrap {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  background: #f8f9fa;
  overflow: hidden;
  display: block;
}

#galleryGrid .gallery-thumb-box .gallery-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 !important;
  max-width: none !important;
  max-height: none !important;
}

#galleryGrid .gallery-thumb-box video.gallery-thumb {
  object-fit: cover !important;
}

#galleryGrid .ratio,
#galleryGrid .ratio::before {
  all: unset;
}

#galleryGrid .gallery-info {
  overflow-wrap: anywhere;
  word-break: normal;
}

#galleryGrid .gallery-line {
  white-space: normal;
  line-height: 1.35;
  font-size: 0.92rem;
}

#galleryGrid .gallery-filename {
  margin-bottom: 4px;
}

#galleryGrid .gallery-exif {
  color: #666;
}

/* Download bleibt im Beschreibungsteil */
.gallery-info-download-row {
  display: flex;
  justify-content: flex-start;
}

.gallery-media-wrap > .gallery-download-btn {
  display: none !important;
}


.gallery-video-badge {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  font-size: 1.05rem;
  line-height: 1;
  pointer-events: none;
}


.upload-error-message {
  color: #dc3545;
  font-weight: 600;
  margin-bottom: 0.5rem;
  white-space: normal;
  overflow-wrap: anywhere;
}


/* Inline-Fehleranzeige Upload */
.upload-error-message {
  color: #dc3545;
  font-weight: 600;
  margin-bottom: 0.5rem;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}


#mediaModalSlideshow {
  white-space: nowrap;
  font-size: 0.75rem;
}

@media (max-width: 576px) {
  #mediaModalSlideshow {
    font-size: 0.66rem;
    padding: 0.2rem 0.4rem;
  }
}


#mediaModal .modal-body {
  touch-action: pan-y;
}


/* Mobile Anpassung Upload-Hinweis */
.drop-zone-title-mobile {
  display: none;
}

@media (max-width: 767.98px) {
  .drop-zone-title-desktop {
    display: none;
  }

  .drop-zone-title-mobile {
    display: block;
  }

  .drop-zone-subtitle {
    display: none;
  }
}

/* Responsive Benutzerverwaltung: vollständige Anzeige auf kleinen Bildschirmen */
@media (max-width: 767.98px) {
  .user-admin-table {
    min-width: 760px;
    font-size: 0.86rem;
  }

  .user-admin-table th,
  .user-admin-table td {
    white-space: normal;
    vertical-align: middle;
  }

  .user-admin-table .col-password {
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .user-action-buttons {
    justify-content: flex-start;
    gap: 0.25rem;
  }

  .user-action-buttons .btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.35rem;
  }
}


/* Benutzerverwaltung mobil als Kartenansicht */
@media (max-width: 767.98px) {
  #usersTable.user-admin-table {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 0.85rem;
  }

  #usersTable.user-admin-table thead {
    display: none;
  }

  #usersTable.user-admin-table,
  #usersTable.user-admin-table tbody,
  #usersTable.user-admin-table tr,
  #usersTable.user-admin-table td {
    display: block;
    width: 100%;
  }

  #usersTable.user-admin-table tr {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.55rem 0.65rem;
    box-shadow: 0 0.1rem 0.35rem rgba(0, 0, 0, 0.05);
  }

  #usersTable.user-admin-table td {
    border: 0;
    padding: 0.35rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    text-align: right !important;
    white-space: normal !important;
  }

  #usersTable.user-admin-table td::before {
    content: attr(data-label);
    flex: 0 0 7.5rem;
    font-weight: 600;
    color: #495057;
    text-align: left;
  }

  #usersTable.user-admin-table .col-password {
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  #usersTable.user-admin-table .user-action-buttons {
    justify-content: flex-end;
    flex-wrap: wrap;
    white-space: normal;
  }

  #usersTable.user-admin-table .user-action-buttons .btn {
    font-size: 0.78rem;
    padding: 0.25rem 0.45rem;
  }
}


.navbar-dark .navbar-nav .nav-link.active-menu {
  color: #ffffff;
  background-color: #0d6efd;
  border-radius: 0.375rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}


@media (max-width: 767.98px) {
  .logs-table {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 0.85rem;
  }

  .logs-table thead {
    display: none;
  }

  .logs-table,
  .logs-table tbody,
  .logs-table tr,
  .logs-table td {
    display: block;
    width: 100%;
  }

  .logs-table tr {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.55rem 0.65rem;
    box-shadow: 0 0.1rem 0.35rem rgba(0, 0, 0, 0.05);
  }

  .logs-table td {
    border: 0;
    padding: 0.35rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    text-align: right !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .logs-table td::before {
    content: attr(data-label);
    flex: 0 0 7.5rem;
    font-weight: 600;
    color: #495057;
    text-align: left;
  }
}


@media (max-width: 767.98px) {
  .logs-table td.logs-online-time::before {
    content: none !important;
    display: none !important;
  }

  .logs-table td.logs-online-time {
    display: block;
    text-align: left !important;
  }
}


.logs-mobile-break {
  display: none;
}

.logs-mobile-break-inline {
  display: inline;
}

@media (max-width: 767.98px) {
  .logs-mobile-break {
    display: inline;
  }

  .logs-mobile-break-inline {
    display: none;
  }
}


/* Galerie Optionen Panel */
#viewOptionsPanel.d-none {
  display: none !important;
}

#viewOptionsPanel:not(.d-none) {
  display: block;
}


/* Medienkarten Informationszeilen */
.gallery-upload-line {
  font-style: italic;
}

.gallery-capture-date-line {
  font-weight: 700;
  font-style: normal;
  color: inherit;
}

.gallery-capture-date-line em,
.gallery-capture-date-line strong {
  font-style: normal;
  font-weight: 700;
}

.gallery-place-line {
  font-style: normal;
  font-weight: 400;
  color: inherit;
}

.gallery-place-line em {
  font-style: normal;
}


/* Abstände Medienkarten */
.gallery-upload-line {
  margin-top: -0.2rem;
  margin-bottom: 0.5rem;
}

.gallery-capture-date-line {
  margin-top: 0.5rem;
}


.gallery-capture-date-line strong,
.gallery-place-line strong {
  font-weight: 700;
}

.gallery-capture-date-line,
.gallery-place-line {
  font-weight: 400;
}


@media (max-width: 767.98px) {
  .statistics-table {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 0.85rem;
  }

  .statistics-table thead {
    display: none;
  }

  .statistics-table,
  .statistics-table tbody,
  .statistics-table tr,
  .statistics-table td {
    display: block;
    width: 100%;
  }

  .statistics-table tr {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.55rem 0.65rem;
    box-shadow: 0 0.1rem 0.35rem rgba(0, 0, 0, 0.05);
  }

  .statistics-table td {
    border: 0;
    padding: 0.35rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    text-align: right !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .statistics-table td::before {
    content: attr(data-label);
    flex: 0 0 8.5rem;
    font-weight: 600;
    color: #495057;
    text-align: left;
  }
}

/* Nach-oben-Button in der Galerie */
.gallery-scroll-top-btn {
  position: fixed;
  right: max(1rem, calc((100vw - 1320px) / 2 - 4.25rem));
  bottom: 1.5rem;
  z-index: 1030;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(13, 110, 253, 0.92);
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease-in-out, visibility 0.18s ease-in-out, background-color 0.18s ease-in-out;
}

.gallery-scroll-top-btn:hover,
.gallery-scroll-top-btn:focus {
  background: rgba(11, 94, 215, 0.98);
}

.gallery-scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 767.98px) {
  .gallery-scroll-top-btn {
    left: 50%;
    right: auto;
    bottom: 1rem;
    transform: translateX(-50%);
  }
}


.modal-image-zoom-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.modal-media-image-zoomable {
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  will-change: transform;
  touch-action: none;
}


.gallery-public-check .form-check-label {
  font-size: 0.92rem;
  line-height: 1.35;
}

.gallery-category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.gallery-category-label {
  font-size: 0.92rem;
  line-height: 1.35;
}

.gallery-category-select {
  font-size: 0.875rem;
  line-height: 1.35;
  width: auto;
  max-width: 100%;
  display: inline-block;
}
