/* ============================================================
   AI ASISTENT — plovoucí chat widget
   Používá heráldní paletu z core/css/style.css (--blue, --gold)
   ============================================================ */

.ai-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-dark, #1c3478) 0%, var(--blue, #2e50a0) 60%, var(--blue-light, #4a6ec0) 100%);
  border: 3px solid var(--gold, #e8aa00);
  box-shadow: 0 8px 24px rgba(28, 52, 120, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #e8aa00);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
}
.ai-launcher:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(28, 52, 120, 0.55);
}
.ai-launcher:focus-visible {
  outline: 3px solid var(--gold-light, #f5cc40);
  outline-offset: 3px;
}
.ai-launcher svg { width: 30px; height: 30px; }

.ai-launcher__pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--gold, #e8aa00);
  animation: ai-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes ai-pulse {
  0%   { transform: scale(1);    opacity: 0.65; }
  100% { transform: scale(1.45); opacity: 0; }
}

.ai-launcher__label {
  position: absolute;
  right: 78px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--blue-dark, #1c3478);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm, 8px);
  white-space: nowrap;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.18));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ai-launcher__label::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--blue-dark, #1c3478);
}
.ai-launcher:hover .ai-launcher__label,
.ai-launcher:focus-visible .ai-launcher__label { opacity: 1; }

/* ----- Panel s iframe ----- */
.ai-frame-wrap {
  position: fixed;
  right: 24px;
  bottom: 104px;
  z-index: 1101;
  width: min(520px, calc(100vw - 48px));
  height: min(780px, calc(100vh - 140px));
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: var(--radius-md, 14px);
  box-shadow: var(--shadow-lg, 0 30px 80px rgba(28, 52, 120, 0.4));
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 2px solid var(--gold, #e8aa00);
}
.ai-frame-wrap.open {
  display: flex;
  animation: ai-slide-in 0.25s ease;
}
@keyframes ai-slide-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-frame-bar {
  background: linear-gradient(135deg, var(--blue-dark, #1c3478), var(--blue, #2e50a0));
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--gold, #e8aa00);
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  font-size: 13px;
  font-weight: 600;
}
.ai-frame-bar__title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-frame-bar__title svg { color: var(--gold, #e8aa00); }

.ai-frame-bar__close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: background 0.15s ease;
}
.ai-frame-bar__close:hover { background: rgba(255,255,255,0.3); }

.ai-frame-wrap iframe {
  flex: 1;
  border: 0;
  width: 100%;
  background: #fff;
}

/* ----- Mobile ----- */
@media (max-width: 480px) {
  .ai-launcher { width: 56px; height: 56px; right: 16px; bottom: 16px; }
  .ai-launcher__label { display: none; }
  .ai-frame-wrap {
    right: 8px;
    left: 8px;
    width: auto;
    height: calc(100vh - 96px);
    bottom: 84px;
    max-height: calc(100vh - 96px);
  }
}
