/* ==========================================================================
   Shared Global Tool UI
   File: assets/icons.css
   ========================================================================== */

.global-tool-iframe-wrapper {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  height: 580px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 120px);
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.2), 0 8px 10px -6px rgba(0,0,0,.1);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

html[dir="ltr"] .global-tool-iframe-wrapper {
  right: auto;
  left: 24px;
}

.global-tool-iframe-wrapper.hidden { display: none !important; }

.global-tool-header {
  min-height: 48px;
  padding: 10px 16px;
  background: var(--bg-surface-hover, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-main, #0f172a);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.global-tool-header-close {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--text-muted, #64748b);
  transition: background-color .2s, color .2s;
}

.global-tool-header-close:hover {
  background-color: rgba(239,68,68,.1);
  color: #ef4444;
}

.global-tool-iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  flex: 1 1 auto;
}

@media (max-width: 640px) {
  .global-tool-iframe-wrapper {
    right: 8px;
    left: 8px;
    bottom: 76px;
    width: auto;
    max-width: none;
    height: min(580px, calc(100dvh - 92px));
    max-height: calc(100dvh - 92px);
    border-radius: 16px;
  }

  html[dir="ltr"] .global-tool-iframe-wrapper {
    left: 8px;
    right: 8px;
  }

  .global-tool-header {
    min-height: 44px;
    padding: 9px 12px;
  }
}
