/* ═══════════════════════════════════════════════════════════════
   krisheath.com — Main Stylesheet
   Companion to Tailwind CDN. Custom classes & overrides only.
   ═══════════════════════════════════════════════════════════════ */

/* ── Smooth scroll ──────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ── Navbar — transparent → frosted on scroll ──────────────────── */
#navbar {
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
#navbar.scrolled {
  background: rgba(253, 252, 240, 0.85);
  border-bottom-color: rgba(10, 25, 47, 0.08);
  box-shadow: 0 2px 20px rgba(10, 25, 47, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Tab buttons ────────────────────────────────────────────────── */
.tab-btn {
  padding: 0.55rem 1.4rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #8892b0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: #0a192f;
  background: rgba(10, 25, 47, 0.06);
}
.tab-btn.active {
  background: #0a192f;
  color: #fdfcf0;
  font-weight: 600;
}

/* ── Tab panels — fade transition ───────────────────────────────── */
.tab-panel {
  animation: fadeUp 0.4s ease forwards;
}
.tab-panel.hidden {
  display: none;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Form inputs ─────────────────────────────────────────────────── */
.cv-input {
  background: #fff;
  border: 1.5px solid rgba(10, 25, 47, 0.15);
  border-radius: 0.6rem;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  color: #0a192f;
  font-family: "Inter", system-ui, sans-serif;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.cv-input::placeholder {
  color: #8892b0;
}
.cv-input:focus {
  border-color: #c9a96e;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}
.cv-input:focus-visible {
  outline: none;
}

/* ── Contenteditable blocks (admin edit mode) ──────────────────── */
[contenteditable="true"] {
  outline: none;
  cursor: text;
  border-radius: 0.4rem;
  transition:
    background 0.2s,
    box-shadow 0.2s;
  padding: 0.15rem 0.3rem;
  margin: -0.15rem -0.3rem;
}
[contenteditable="true"]:hover {
  background: rgba(201, 169, 110, 0.08);
}
[contenteditable="true"]:focus {
  background: rgba(201, 169, 110, 0.12);
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.4);
}

/* ── Admin save bar ─────────────────────────────────────────────── */
#saveBar {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  transform: translateX(-50%) translateY(0);
}
#saveBar.visible {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ── Section divider rule ────────────────────────────────────────── */
.section-rule {
  width: 3rem;
  height: 2px;
  background: #c9a96e;
  margin: 0 auto 1.5rem;
  border-radius: 2px;
}

/* ── Mobile nav ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* ── Rich-text editable blocks ───────────────────────────────────── */
.cv-rich-text {
  min-height: 2em;
}
.cv-rich-text p {
  margin-bottom: 0.6em;
}
.cv-rich-text br {
  display: block;
  margin-bottom: 0.4em;
}
.cv-rich-text ul,
.cv-rich-text ol {
  padding-left: 0;
  margin-bottom: 0.6em;
  list-style: none;
}
.cv-rich-text li {
  position: relative;
  padding-left: 1.4em;
  margin-bottom: 0.4em;
}
.cv-rich-text ul li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0.05em;
  font-size: 0.5em;
  line-height: 2.2;
  color: #c9a96e;
}
.cv-rich-text ol {
  counter-reset: cv-ol;
}
.cv-rich-text ol li {
  counter-increment: cv-ol;
}
.cv-rich-text ol li::before {
  content: counter(cv-ol) ".";
  position: absolute;
  left: 0;
  font-size: 0.78em;
  font-weight: 600;
  color: #c9a96e;
  line-height: 1.8;
}
.cv-rich-text strong {
  font-weight: 600;
  color: #0a192f;
}
.cv-rich-text em {
  font-style: italic;
}

/* Bullet lists rendered from plain-text seed (textToHtml) */
.cv-bullets {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0.6em;
}
.cv-bullets li {
  position: relative;
  padding-left: 1.4em;
  margin-bottom: 0.4em;
}
.cv-bullets li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0.05em;
  font-size: 0.5em;
  line-height: 2.2;
  color: #c9a96e;
}

/* ── Rich-text floating toolbar ──────────────────────────────────── */
.rich-toolbar {
  position: absolute;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #0a192f;
  border-radius: 8px;
  padding: 5px 6px;
  box-shadow: 0 4px 20px rgba(10, 25, 47, 0.35);
  pointer-events: auto;
}
.rich-toolbar.hidden {
  display: none;
}

.rich-toolbar button {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #ccd6f6;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.rich-toolbar button svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}
.rich-toolbar button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fdfcf0;
}
.rich-toolbar button.active {
  background: rgba(201, 169, 110, 0.25);
  color: #c9a96e;
}

.rich-toolbar-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 3px;
}

/* ── Edit mode hint ──────────────────────────────────────────────── */
.cv-toolbar-hint {
  letter-spacing: 0.01em;
}

/* ── cv-editable inline focus ring ──────────────────────────────── */
.cv-editable {
  outline: none;
  border-radius: 3px;
  transition:
    background 0.15s,
    box-shadow 0.15s;
  cursor: text;
}
.cv-editable:hover {
  background: rgba(201, 169, 110, 0.08);
}
.cv-editable:focus {
  background: rgba(201, 169, 110, 0.12);
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.45);
}

/* ── Inner card tabs (Overview / Key Achievements) ──────────────── */
.card-tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.card-tab-btn {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(201, 169, 110, 0.35);
  background: transparent;
  color: rgba(201, 169, 110, 0.7);
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s;
}

.card-tab-btn:hover {
  background: rgba(201, 169, 110, 0.1);
  color: #c9a96e;
  border-color: rgba(201, 169, 110, 0.6);
}

.card-tab-btn.active {
  background: rgba(201, 169, 110, 0.18);
  color: #c9a96e;
  border-color: #c9a96e;
}

.card-panel {
  /* visible state — Tailwind 'hidden' utility handles display:none */
  min-height: 0;
}

/* ── Interest cards ──────────────────────────────────────────────── */
.interest-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(10, 25, 47, 0.07);
  border: 1px solid rgba(10, 25, 47, 0.08);
  transition:
    box-shadow 0.25s,
    transform 0.25s;
  display: flex;
  flex-direction: column;
}

.interest-card:hover {
  box-shadow: 0 6px 24px rgba(10, 25, 47, 0.13);
  transform: translateY(-2px);
}

.interest-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f5f3e8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.interest-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Image upload overlay button (admin only) */
.interest-upload-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(10, 25, 47, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.interest-upload-btn svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

.interest-card:hover .interest-upload-btn,
.interest-card-image--empty .interest-upload-btn {
  opacity: 1;
}

/* ── Skill pills (lozenges) ───────────────────────────────────────── */
.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  justify-content: center;
  margin-top: 0.4rem;
}
.skill-pill {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  background: rgba(10, 25, 47, 0.06);
  color: #0a192f;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.skill-pills-edit {
  display: inline-block;
  min-width: 40%;
  max-width: 70%;
  text-align: center;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px dashed rgba(10, 25, 47, 0.08);
  background: rgba(253, 252, 240, 0.6);
  font-weight: 600;
}

/* Delete button (admin only) */
.interest-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  font-size: 0.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  opacity: 0;
  transition:
    opacity 0.2s,
    color 0.2s;
}

.interest-card:hover .interest-delete-btn {
  opacity: 1;
}

.interest-card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.interest-card-title {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0a192f;
  margin: 0;
}

.interest-card-desc {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* ── Skill cards (full width) ─────────────────────────────────── */
.skill-card {
  position: relative;
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #e6eef6;
}

.skill-card h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.35rem 0;
}

.skill-card .cv-rich-text {
  color: var(--mid);
  margin-top: 0.25rem;
}

/* ── Add entry button ────────────────────────────────────────────── */
.add-entry-btn {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 20px;
  border-radius: 20px;
  border: 1.5px dashed rgba(201, 169, 110, 0.5);
  background: transparent;
  color: rgba(201, 169, 110, 0.75);
  cursor: pointer;
  transition:
    border-color 0.18s,
    color 0.18s,
    background 0.18s;
}

.add-entry-btn:hover {
  border-color: #c9a96e;
  color: #c9a96e;
  background: rgba(201, 169, 110, 0.07);
}

.add-entry-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ── CV Chat Widget ─────────────────────────────────────────────── */

#chatWidget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

/* Bubble trigger button */
#chatBubble {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #0a192f;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(10, 25, 47, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  flex-shrink: 0;
}

#chatBubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(10, 25, 47, 0.45);
}

#chatBubble svg {
  width: 22px;
  height: 22px;
  color: #fdfcf0;
}

/* Panel */
#chatPanel {
  width: 340px;
  max-height: 520px;
  background: #fff;
  border-radius: 18px;
  box-shadow:
    0 12px 48px rgba(10, 25, 47, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(10, 25, 47, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideIn 0.22s ease;
}

#chatPanel.chat-panel--closed {
  display: none;
}

@keyframes chatSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Panel header */
#chatHeader {
  background: #0a192f;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#chatHeaderLeft {
  display: flex;
  align-items: center;
  gap: 10px;
}

#chatDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9a96e;
  flex-shrink: 0;
}

#chatTitle {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fdfcf0;
  line-height: 1.2;
}

#chatSubtitle {
  font-size: 0.68rem;
  color: #8892b0;
  margin-top: 1px;
}

#chatClose {
  background: none;
  border: none;
  color: #8892b0;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s;
}

#chatClose:hover {
  color: #fdfcf0;
}

/* Messages area */
#chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#chatMessages::-webkit-scrollbar {
  width: 4px;
}
#chatMessages::-webkit-scrollbar-track {
  background: transparent;
}
#chatMessages::-webkit-scrollbar-thumb {
  background: rgba(10, 25, 47, 0.15);
  border-radius: 4px;
}

.chat-msg {
  display: flex;
  max-width: 90%;
}

.chat-msg--user {
  align-self: flex-end;
}
.chat-msg--assistant {
  align-self: flex-start;
}

.chat-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
  word-break: break-word;
}

.chat-msg--user .chat-bubble {
  background: #0a192f;
  color: #fdfcf0;
  border-bottom-right-radius: 4px;
}

.chat-msg--assistant .chat-bubble {
  background: #f1f5f9;
  color: #0a192f;
  border-bottom-left-radius: 4px;
}

.chat-msg--assistant .chat-bubble.chat-bubble--error {
  background: #fef2f2;
  color: #991b1b;
}

/* Typing indicator */
.chat-typing .chat-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: chatTypeBounce 1.2s infinite;
}

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

@keyframes chatTypeBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

/* Suggestions */
#chatSuggestions {
  padding: 4px 12px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chat-suggestion {
  font-size: 0.7rem;
  padding: 4px 10px;
  border: 1px solid rgba(10, 25, 47, 0.18);
  border-radius: 20px;
  background: none;
  color: #334155;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.chat-suggestion:hover {
  background: rgba(10, 25, 47, 0.06);
  border-color: rgba(10, 25, 47, 0.35);
}

/* Input row */
#chatInputRow {
  padding: 10px 12px 12px;
  display: flex;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

#chatInput {
  flex: 1;
  border: 1px solid rgba(10, 25, 47, 0.15);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  color: #0a192f;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

#chatInput:focus {
  border-color: #c9a96e;
}

#chatSend {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #0a192f;
  color: #fdfcf0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

#chatSend:disabled {
  opacity: 0.35;
  cursor: default;
}
#chatSend svg {
  width: 15px;
  height: 15px;
}

/* Mobile tweak */
@media (max-width: 400px) {
  #chatPanel {
    width: calc(100vw - 2rem);
  }
  #chatWidget {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ── Chat nudge callout ─────────────────────────────────────────── */
#chatNudge {
  position: absolute;
  bottom: 62px;
  right: 0;
  background: #0a192f;
  color: #fdfcf0;
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(10, 25, 47, 0.3);
  pointer-events: none;

  /* start hidden, slide up on appear */
  opacity: 0;
  transform: translateY(6px);
  animation:
    nudgeIn 0.4s ease 1.2s forwards,
    nudgeOut 0.4s ease 6s forwards;
}

/* little arrow pointing down toward the bubble */
#chatNudgeArrow {
  position: absolute;
  bottom: -6px;
  right: 18px;
  width: 12px;
  height: 6px;
  overflow: hidden;
}

#chatNudgeArrow::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  width: 12px;
  height: 12px;
  background: #0a192f;
  transform: rotate(45deg);
}

/* hide completely once animation done */
#chatNudge.nudge--gone {
  display: none;
}

@keyframes nudgeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nudgeOut {
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}
