/*
 * inky.css — Inky Portfolio Widget Styles
 *
 * ALL colors come from CSS custom properties (--inky-*).
 * No raw hex in this file below the :root block.
 * Override any --inky-* token here, or in WP → Additional CSS.
 *
 * Three design layers (easiest → deepest):
 *  1. Settings page → accent color (overrides --inky-butter)
 *  2. This file → override any --inky-* variable
 *  3. WP Appearance → Additional CSS → override --inky-* site-wide
 */

/* ------------------------------------------------------------------ */
/* CSS custom properties — the ONLY place hex appears                  */
/* ------------------------------------------------------------------ */

:root,
#inky-widget {
  --inky-navy:       #01374C;
  --inky-navy-dark:  #012A3B;
  --inky-navy-ear:   #063E53;
  --inky-royal:      #2F6FA6;
  --inky-butter:     #EFD27C;
  --inky-cream:      #E9E3D5;
  --inky-cream-text: #F3F0E7;
  --inky-text:       #0E3340;
  --inky-on-butter:  #3A2E08;
  --inky-muted:      #8AA9B0;
  --inky-radius:     18px;
  --inky-bubble-r-inky:   13px 13px 13px 4px;
  --inky-bubble-r-visitor: 13px 13px 4px 13px;
  --inky-panel-w:    360px;
  --inky-panel-h:    520px;
}

/* ------------------------------------------------------------------ */
/* Widget root container                                                */
/* ------------------------------------------------------------------ */

#inky-widget {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--inky-cream-text);
  box-sizing: border-box;
}

#inky-widget *,
#inky-widget *::before,
#inky-widget *::after {
  box-sizing: inherit;
}

/* ------------------------------------------------------------------ */
/* Panel                                                                */
/* ------------------------------------------------------------------ */

.inky-panel {
  background: var(--inky-navy);
  border-radius: var(--inky-radius);
  border: 1px solid rgba(239, 210, 124, 0.22); /* butter hairline — one allowed rgba with var fallback */
  width: var(--inky-panel-w);
  height: var(--inky-panel-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(1, 55, 76, 0.4);
}

/* Inline: always visible */
.inky-panel--inline {
  display: flex;
}

/* Floating: hidden until launcher click */
.inky-panel--floating {
  position: fixed;
  bottom: 80px;
  right: 20px;
  display: none;
  z-index: 9998;
}

.inky-panel--floating.inky-panel--open {
  display: flex;
}

/* ------------------------------------------------------------------ */
/* Header bar                                                           */
/* ------------------------------------------------------------------ */

.inky-panel__header {
  background: var(--inky-navy-dark);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.inky-panel__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.inky-panel__name-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.inky-panel__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--inky-cream-text);
}

.inky-panel__sub {
  font-size: 11px;
  color: var(--inky-muted);
}

.inky-panel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--inky-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}

.inky-panel__dot--active {
  background: var(--inky-butter);
}

/* ------------------------------------------------------------------ */
/* Body                                                                 */
/* ------------------------------------------------------------------ */

.inky-panel__body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------ */
/* Panes (wake / chat / ended)                                          */
/* ------------------------------------------------------------------ */

.inky-pane {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 0.25s;
}

.inky-pane--hidden {
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Wake screen                                                           */
/* ------------------------------------------------------------------ */

.inky-pane--wake {
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 20px;
  background: var(--inky-navy);
}

.inky-wake__body {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(1, 55, 76, 0.6));
}

.inky-wake__copy {
  color: var(--inky-muted);
  font-size: 12px;
  margin: 0;
  text-align: center;
}

/* Hold wrap + ring */

.inky-hold-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inky-hold-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(239, 210, 124, 0.25);
  overflow: hidden;
}

.inky-hold-ring__fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--inky-butter) 0%, transparent 0%);
  transform-origin: center;
  animation: none;
}

.inky-hold-ring__fill--filling {
  animation: inky-ring-fill linear forwards;
  /* duration set inline via JS */
}

@keyframes inky-ring-fill {
  from { background: conic-gradient(var(--inky-butter) 0%, transparent 0%); }
  to   { background: conic-gradient(var(--inky-butter) 100%, transparent 100%); }
}

.inky-hold-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--inky-butter);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: transform 0.1s, box-shadow 0.1s;
}

.inky-hold-btn:active {
  transform: scale(0.94);
}

.inky-hold-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Chat pane                                                            */
/* ------------------------------------------------------------------ */

.inky-pane--chat {
  flex-direction: column;
  overflow: hidden;
}

.inky-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: var(--inky-navy-dark) transparent;
}

.inky-messages::-webkit-scrollbar {
  width: 4px;
}
.inky-messages::-webkit-scrollbar-track {
  background: transparent;
}
.inky-messages::-webkit-scrollbar-thumb {
  background: var(--inky-navy-dark);
  border-radius: 2px;
}

/* Message rows */

.inky-msg {
  display: flex;
  max-width: 85%;
}

.inky-msg--inky {
  align-self: flex-start;
  align-items: flex-end;
}

.inky-msg--visitor {
  align-self: flex-end;
  flex-direction: row-reverse;
}

/* Bubbles */

.inky-bubble {
  padding: 8px 12px;
  font-size: 13px;
  word-break: break-word;
  white-space: pre-wrap;
}

.inky-msg--inky .inky-bubble {
  background: var(--inky-cream);
  color: var(--inky-text);
  border-radius: var(--inky-bubble-r-inky);
}

.inky-msg--visitor .inky-bubble {
  background: var(--inky-butter);
  color: var(--inky-on-butter);
  border-radius: var(--inky-bubble-r-visitor);
}

/* Typing indicator */

.inky-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}

.inky-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--inky-muted);
  animation: inky-dot-bounce 1.2s ease-in-out infinite;
}

.inky-typing span:nth-child(2) { animation-delay: 0.2s; }
.inky-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes inky-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Attachments */

.inky-attachment {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin-top: 4px;
}

/* ------------------------------------------------------------------ */
/* Footer (input + send)                                                */
/* ------------------------------------------------------------------ */

.inky-footer {
  background: var(--inky-navy-dark);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-top: 1px solid rgba(239, 210, 124, 0.1);
}

.inky-input {
  flex: 1;
  background: var(--inky-navy-dark);
  border: 1px solid var(--inky-butter);
  border-radius: 20px;
  color: var(--inky-cream-text);
  font-size: 13px;
  padding: 8px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.inky-input::placeholder {
  color: var(--inky-muted);
}

.inky-input:focus {
  border-color: var(--inky-butter);
  box-shadow: 0 0 0 2px rgba(239, 210, 124, 0.18);
}

.inky-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.inky-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--inky-butter);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s, opacity 0.2s;
}

.inky-send:active {
  transform: scale(0.92);
}

.inky-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.inky-send img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Ended pane (CTA card + disabled state)                              */
/* ------------------------------------------------------------------ */

.inky-pane--ended {
  background: var(--inky-navy);
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  /* Overlaid on chat pane — show above it */
  z-index: 2;
}

.inky-cta-card {
  background: var(--inky-cream);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
}

.inky-cta-card__title {
  color: var(--inky-text);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.inky-cta-card__email {
  border: 1px solid var(--inky-muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--inky-text);
  background: var(--inky-cream-text);
  outline: none;
  transition: border-color 0.2s;
}

.inky-cta-card__email:focus {
  border-color: var(--inky-navy);
}

.inky-cta-card__email:disabled {
  opacity: 0.5;
}

.inky-cta-card__btn {
  background: var(--inky-butter);
  color: var(--inky-on-butter);
  border: none;
  border-radius: 20px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.inky-cta-card__btn:hover {
  opacity: 0.88;
}

.inky-cta-card__btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.inky-cta-card__hint {
  font-size: 11px;
  color: var(--inky-muted);
  margin: 0;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* "Powered by" badge                                                   */
/* ------------------------------------------------------------------ */

.inky-badge {
  text-align: center;
  font-size: 10px;
  color: var(--inky-muted);
  padding: 4px 0 6px;
  background: var(--inky-navy-dark);
}

/* ------------------------------------------------------------------ */
/* Floating launcher button                                             */
/* ------------------------------------------------------------------ */

.inky-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--inky-butter);
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(1, 55, 76, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.inky-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(1, 55, 76, 0.45);
}

.inky-launcher:active {
  transform: scale(0.95);
}

.inky-launcher__icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Mobile responsive                                                    */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
  .inky-panel--floating {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 85vh;
    border-radius: var(--inky-radius) var(--inky-radius) 0 0;
    --inky-panel-w: 100vw;
    --inky-panel-h: 85vh;
  }

  .inky-launcher {
    bottom: 16px;
    right: 16px;
  }
}
