/* Skucast AI Panel — embedded chat drawer
   Drops in via <link rel="stylesheet" href="/ai-drawer.css"> on any page.
   Keep z-indexes < 9999 so Shopify App Bridge modals can still overlay. */

.skd-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #cc0000, #8a0000);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.skd-fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(204, 0, 0, 0.35); }
.skd-fab:active { transform: scale(0.98); }

.skd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.skd-drawer.open { transform: translateX(0); }

.skd-header {
  background: #1a1a1a;
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.skd-header h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.skd-header .skd-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.skd-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skd-msg { padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; max-width: 92%; word-wrap: break-word; }
.skd-msg-user { background: #1a1a1a; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.skd-msg-assistant { background: #fff; color: #1a1a1a; border: 1px solid #e5e7eb; align-self: flex-start; border-bottom-left-radius: 4px; }
.skd-msg-assistant table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 12px; }
.skd-msg-assistant th, .skd-msg-assistant td { border: 1px solid #e5e7eb; padding: 5px 8px; text-align: left; }
.skd-msg-assistant th { background: #f4f4f4; font-weight: 600; }
.skd-msg-assistant strong { font-weight: 700; }
.skd-msg-assistant code { background: #f4f4f5; padding: 1px 5px; border-radius: 3px; font-family: 'JetBrains Mono', Consolas, monospace; font-size: 11px; color: #9a0000; }

.skd-tool-card {
  font-size: 11px;
  color: #555;
  background: #fff5f5;
  border-left: 3px solid #cc0000;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin: 4px 0;
  align-self: flex-start;
  max-width: 92%;
  font-family: 'JetBrains Mono', Consolas, monospace;
}
.skd-tool-card .skd-tool-name { color: #9a0000; font-weight: 700; }

.skd-thinking { align-self: flex-start; padding: 10px 14px; font-size: 13px; color: #888; font-style: italic; }
.skd-thinking::after { content: '…'; animation: skd-dots 1.2s infinite; }
@keyframes skd-dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '…'; }
}

.skd-input-area {
  border-top: 1px solid #e5e7eb;
  padding: 12px 14px;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.skd-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  min-height: 38px;
  max-height: 140px;
  line-height: 1.4;
}
.skd-input:focus { outline: none; border-color: #cc0000; box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.12); }
.skd-send {
  padding: 10px 16px;
  background: linear-gradient(180deg, #cc0000, #8a0000);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.skd-send:disabled { background: #ccc; cursor: not-allowed; }

.skd-starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 14px; background: #f8f9fa; }
.skd-starter {
  padding: 6px 11px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 99px;
  font-size: 11px;
  color: #555;
  cursor: pointer;
}
.skd-starter:hover { border-color: #cc0000; color: #1a1a1a; }

.skd-empty { padding: 24px 16px; text-align: center; color: #888; font-size: 13px; }
