/* ============================================================
   Oeschger´s EDV Systeme Supportportal
   Hotfix v1.2.7 - Inline-Bilder/Screenshots
   ============================================================ */

:root {
  --oe-inline-img-max: 500px;
  --oe-inline-img-border: rgba(17, 24, 39, .16);
  --oe-inline-img-shadow: 0 10px 30px rgba(0,0,0,.10);
  --oe-inline-toolbar-bg: #ffffff;
  --oe-inline-toolbar-text: #111827;
  --oe-inline-toolbar-border: rgba(17, 24, 39, .14);
  --oe-inline-toolbar-shadow: 0 14px 38px rgba(0,0,0,.18);
  --oe-inline-primary: #C41212;
}

html[data-theme="dark"],
body[data-theme="dark"],
.theme-dark,
.dark {
  --oe-inline-img-border: rgba(255, 255, 255, .18);
  --oe-inline-img-shadow: 0 10px 30px rgba(0,0,0,.38);
  --oe-inline-toolbar-bg: #101722;
  --oe-inline-toolbar-text: #f9fafb;
  --oe-inline-toolbar-border: rgba(255, 255, 255, .18);
  --oe-inline-toolbar-shadow: 0 18px 45px rgba(0,0,0,.48);
}

.oe-inline-resizable-image,
.inline-screenshot,
.rich-render img,
.rich-text img,
.rich-message img,
.ticket-message img,
.ticket-message-body img,
.ticket-body img,
.event-body img,
.event-content img,
.message-html img,
.oe-rich-html img,
.oe-ticket-richtext img,
.rich-editor img,
[contenteditable="true"] img {
  max-width: min(var(--oe-inline-img-max), 100%) !important;
  height: auto !important;
  border-radius: 12px;
  border: 1px solid var(--oe-inline-img-border);
  box-shadow: var(--oe-inline-img-shadow);
  display: inline-block;
  vertical-align: top;
}

.rich-editor .oe-inline-resizable-image,
[contenteditable="true"] .oe-inline-resizable-image {
  cursor: nwse-resize;
}

.oe-inline-resizable-image.oe-image-selected {
  outline: 3px solid var(--oe-inline-primary);
  outline-offset: 4px;
}

.oe-image-resize-toolbar {
  position: fixed;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--oe-inline-toolbar-border);
  background: var(--oe-inline-toolbar-bg);
  color: var(--oe-inline-toolbar-text);
  box-shadow: var(--oe-inline-toolbar-shadow);
  font: 700 13px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.oe-image-resize-toolbar[hidden] { display: none !important; }

.oe-image-resize-toolbar button {
  appearance: none;
  border: 1px solid var(--oe-inline-toolbar-border);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  padding: 7px 10px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.oe-image-resize-toolbar button:hover,
.oe-image-resize-toolbar button:focus-visible {
  border-color: var(--oe-inline-primary);
  color: var(--oe-inline-primary);
  outline: none;
}

.oe-image-resize-toolbar input[type="range"] {
  width: 150px;
  max-width: 30vw;
  accent-color: var(--oe-inline-primary);
}

.oe-image-resize-toolbar .oe-resize-label {
  min-width: 58px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: .86;
}

.oe-image-resize-handle {
  position: fixed;
  z-index: 100000;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 2px solid #fff;
  background: var(--oe-inline-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,.32);
  cursor: nwse-resize;
  touch-action: none;
}

.oe-image-resize-handle[hidden] { display: none !important; }

.rich-toolbar button {
  user-select: none;
}

.auth-links,
.login-links {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 14px;
}

.login-links a,
.auth-links a {
  color: #C41212;
  font-weight: 800;
  text-decoration: none;
}

.login-links a:hover,
.auth-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .oe-inline-resizable-image,
  .inline-screenshot,
  .rich-render img,
  .rich-text img,
  .rich-message img,
  .ticket-message img,
  .ticket-message-body img,
  .ticket-body img,
  .event-body img,
  .event-content img,
  .message-html img,
  .oe-rich-html img,
  .oe-ticket-richtext img,
  .rich-editor img,
  [contenteditable="true"] img {
    max-width: 100% !important;
  }

  .oe-image-resize-toolbar {
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 14px !important;
    justify-content: center;
    flex-wrap: wrap;
  }

  .oe-image-resize-toolbar input[type="range"] {
    width: 100%;
    max-width: 100%;
  }
}
