/* ==========================================================
   NSI Solutions Sdn Bhd — Main Stylesheet
   Inspired by Petronas corporate website design language
   ========================================================== */

/* ── 1. CSS Custom Properties ────────────────────────────── */
/*:root {
  --clr-primary:     #5bc8e8;
  --clr-secondary:   #eef000;
  --clr-accent:      #7de87b;
  --clr-dark:        #111418;
  --clr-dark-2:      #1a1f26;
  --clr-dark-3:      #222930;
  --clr-text:        #e8ecf0;
  --clr-muted:       #8a9bac;
  --clr-border:      rgba(91,200,232,0.15);
  --nav-height:      72px;
  --section-pad:     100px;
  --max-w:           1280px;
  --radius-sm:       8px;
  --radius-md:       16px;
  --radius-lg:       24px;
  --shadow-card:     0 8px 40px rgba(0,0,0,0.45);
  --shadow-glow:     0 0 40px rgba(91,200,232,0.25);
  --trans-fast:      0.2s ease;
  --trans-med:       0.4s ease;
  --trans-slow:      0.7s cubic-bezier(0.16,1,0.3,1);
}*/


/* ═══════════════════════════════════════════════════════════
   AI JUNIE CHATBOT WIDGET
   ═══════════════════════════════════════════════════════════ */
.junie-widget {
  position: fixed; bottom: 28px; right: 28px;
  z-index: 9000;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  /* tooltip sits below button; panel floats above via absolute position */
  /* needs position relative so child .junie-panel can anchor to it */
  /* Note: position:fixed already establishes containing block */
}

/* Toggle button */
.junie-toggle {
  position: relative; width: 70px; height: 70px;
  border-radius: 50%; border: none; cursor: pointer;
  background: transparent;
  box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
  transition: transform 0.3s ease;
}
.junie-toggle:hover { transform: scale(1.1); }

/* Pulse rings (heartbeat) */
.junie-pulse-ring {
  position: absolute; inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(91,200,232,0.45);
  animation: juniePulse 2.4s ease-out infinite;
  pointer-events: none;
}
.junie-pulse-ring-2 {
  inset: -4px;
  border-color: rgba(125,232,123,0.2);
  animation-delay: 0.9s;
}
@keyframes juniePulse {
  0%   { transform: scale(0.9); opacity: 0.8; }
  60%  { transform: scale(1.15); opacity: 0.2; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Avatar wrapper — floats and holds blink SVG */
.junie-avatar-wrap {
  position: relative;
  width: 70px; height: 70px;
  animation: junieFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 6px 18px rgba(91,200,232,0.5));
  z-index: 1;
}
.junie-avatar {
  width: 70px; height: 70px; object-fit: contain;
  border-radius: 0; display: block;
}
@keyframes junieFloat {
  0%   { transform: translateY(0px);  }
  50%  { transform: translateY(-7px); }
  100% { transform: translateY(0px);  }
}

/* Blink SVG overlay — sits exactly over the eye area */
.junie-blink {
  position: absolute;
  /* tune these to sit right over the pupils in the image */
  top: 40%; left: 14%;
  width: 72%; height: 24%;
  pointer-events: none;
  overflow: visible;
}
/* Lids start fully hidden (ry=0), blink closes then reopens */
.junie-lid {
  transform-origin: center;
  transform-box: fill-box;
  animation: junieBlink 4s ease-in-out infinite;
}
.junie-lid-r { animation-delay: 0.04s; } /* tiny offset = natural feel */
@keyframes junieBlink {
  0%,  42%          { ry: 0; opacity: 0; }   /* eyes open — lid hidden     */
  45%               { ry: 9; opacity: 1; }   /* lid snaps shut             */
  50%               { ry: 9; opacity: 1; }   /* hold closed                */
  55%               { ry: 0; opacity: 0; }   /* lid opens back             */
  57%, 100%         { ry: 0; opacity: 0; }   /* stay open until next blink */
}
.junie-badge {
  position: absolute; top: -2px; right: -2px;
  background: linear-gradient(135deg, #f5a623, #e8841a);
  color: #000; font-size: 0.5rem; font-weight: 900;
  padding: 2px 5px; border-radius: 8px;
  letter-spacing: 0.06em; z-index: 2;
}
.junie-tooltip {
  margin-top: 8px;
  background: rgba(10,20,38,0.95);
  border: 1px solid rgba(91,200,232,0.25);
  color: #fff; font-size: 0.74rem; font-weight: 600;
  padding: 5px 13px; border-radius: 20px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(4px);
  transform: translateY(-4px);
  text-align: center;
}
.junie-widget:hover .junie-tooltip {
  opacity: 1;
  transform: translateY(0);
}
/* Hide tooltip when chat panel is open */
.junie-widget.junie-open .junie-tooltip {
  opacity: 0 !important;
  pointer-events: none;
}

/* Chat panel — floats above the toggle button */
.junie-panel {
  position: absolute;
  bottom: calc(100% + 14px); /* sits above the entire widget stack */
  right: 0;
  width: 340px;
  background: linear-gradient(160deg, #0d1e38, #091525);
  border: 1px solid rgba(91,200,232,0.2);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 500px;
  transform: scale(0.9) translateY(20px);
  transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.junie-panel.open {
  opacity: 1; pointer-events: all;
  transform: scale(1) translateY(0);
}

/* Panel header */
.junie-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: rgba(91,200,232,0.08);
  border-bottom: 1px solid rgba(91,200,232,0.15);
}
.junie-head-left { display: flex; align-items: center; gap: 10px; }
.junie-head-avatar { position: relative; }
.junie-head-avatar img { width: 42px; height: 42px; border-radius: 0; object-fit: contain; background: transparent; }
.junie-online-dot {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; border: 2px solid #0d1e38;
  animation: junieBlink 2s ease infinite;
}
@keyframes junieBlink {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}
.junie-panel-head strong { color: #fff; font-size: 0.92rem; display: block; line-height: 1; }
.junie-panel-head p { color: rgba(91,200,232,0.7); font-size: 0.7rem; margin: 3px 0 0; }
.junie-close-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: none;
  color: rgba(255,255,255,0.5); font-size: 0.8rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.junie-close-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Messages area */
.junie-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin; scrollbar-color: rgba(91,200,232,0.2) transparent;
}
.junie-msg { display: flex; gap: 8px; align-items: flex-end; }
.junie-msg-bot { flex-direction: row; }
.junie-msg-user { flex-direction: row-reverse; }
.junie-msg-avatar img {
  width: 34px; height: 34px; border-radius: 0; object-fit: contain; flex-shrink: 0; background: transparent;
}
.junie-msg-bubble {
  max-width: 80%; padding: 10px 14px;
  border-radius: 16px; font-size: 0.82rem; line-height: 1.55;
}
.junie-msg-bot .junie-msg-bubble {
  background: rgba(91,200,232,0.1);
  border: 1px solid rgba(91,200,232,0.15);
  color: rgba(255,255,255,0.85);
  border-bottom-left-radius: 4px;
}
.junie-msg-user .junie-msg-bubble {
  background: linear-gradient(135deg, #5bc8e8, #3aacc8);
  color: #000; font-weight: 600;
  border-bottom-right-radius: 4px;
}

/* Quick replies */
.junie-quick-replies {
  padding: 8px 12px;
  display: flex; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.junie-quick-replies button {
  padding: 5px 12px; border-radius: 16px;
  background: rgba(91,200,232,0.08);
  border: 1px solid rgba(91,200,232,0.2);
  color: rgba(91,200,232,0.9); font-size: 0.73rem; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.junie-quick-replies button:hover {
  background: rgba(91,200,232,0.18);
}

/* Input row */
.junie-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.junie-input-row input {
  flex: 1; padding: 9px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff; font-size: 0.83rem; font-family: inherit;
}
.junie-input-row input:focus { outline: none; border-color: rgba(91,200,232,0.4); }
.junie-input-row input::placeholder { color: rgba(255,255,255,0.3); }
.junie-send-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #5bc8e8, #3aacc8);
  border: none; color: #000; font-size: 0.85rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.junie-send-btn:hover { opacity: 0.85; transform: scale(1.05); }

/* Typing indicator */
.junie-typing .junie-msg-bubble {
  display: flex; align-items: center; gap: 4px; padding: 12px 16px;
}
.junie-typing .junie-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(91,200,232,0.7);
  animation: junieTyping 1.2s ease infinite;
}
.junie-typing .junie-dot:nth-child(2) { animation-delay: 0.2s; }
.junie-typing .junie-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes junieTyping {
  0%,80%,100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* Header logo text size adjustment */
.logo-text { font-size: 0.82rem !important; }

/* Wheel responsive — hide wheel, show cards on mobile */
@media (max-width: 900px) {
  .ezy-explorer { flex-direction: column; gap: 32px; }
  .ezy-panel { max-width: 100%; min-width: unset; width: 100%; }
}
@media (max-width: 680px) {
  .ezy-explorer { display: none; }
  .ezy-mobile-cards { display: grid; }
  .ezy-legend { display: none; }
  .junie-panel { width: 300px; }
  .junie-widget { bottom: 18px; right: 18px; }
  .back-to-top { bottom: 145px; right: 22px; }
}
