/* ============================================================
   shared.css — Portfolio global styles
   All pages import this file.
   ============================================================ */

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 10;
  padding: 20px 20px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-icons {
  display: flex;
  gap: 22px;
  align-items: center;
}

.footer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7878a0;
  opacity: 0.5;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}
.footer-icon:hover {
  color: #a99dff;
  opacity: 1;
  transform: translateY(-2px);
}
.footer-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}

.footer-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #7878a0;
  opacity: 0.4;
  letter-spacing: 0.04em;
}

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

body {
  background-color: #0d0f1e;
  font-family: 'DM Sans', sans-serif;
  animation: page-fade-in 0.35s ease both;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 10% 15%, rgba(124,109,250,0.11) 0%, transparent 70%),
    radial-gradient(ellipse 45% 40% at 90% 80%, rgba(250,109,143,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Navbar ── */
.nav-glass {
  background: rgba(19, 21, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 109, 250, 0.15);
}

.nav-link {
  color: #7878a0;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: all 0.2s ease;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: #e0e0f5;
  background: rgba(124, 109, 250, 0.16);
}

/* ── Cards ── */
.card {
  background: #13152a;
  border: 1px solid rgba(124, 109, 250, 0.13);
  box-shadow: 0 4px 32px rgba(0,0,0,0.35);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.card:hover { border-color: rgba(124, 109, 250, 0.32); }

.project-card {
  background: #13152a;
  border: 1px solid rgba(124, 109, 250, 0.13);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(124, 109, 250, 0.42);
  box-shadow: 0 16px 48px rgba(124, 109, 250, 0.14);
}

/* ── Scroll fade-in ── */
.fade-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.show { opacity: 1; transform: translateY(0); }

.stagger > *:nth-child(1) { transition-delay: 0.05s; }
.stagger > *:nth-child(2) { transition-delay: 0.15s; }
.stagger > *:nth-child(3) { transition-delay: 0.25s; }
.stagger > *:nth-child(4) { transition-delay: 0.35s; }
.stagger > *:nth-child(5) { transition-delay: 0.45s; }

/* ── Common UI atoms ── */
.tag {
  display: inline-block;
  background: rgba(124, 109, 250, 0.1);
  border: 1px solid rgba(124, 109, 250, 0.22);
  color: #a99dff;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 11px;
  border-radius: 999px;
}

.grad-line {
  height: 2px;
  width: 36px;
  background: linear-gradient(90deg, #7c6dfa, #fa6d8f);
  border-radius: 2px;
}

.section-label {
  font-family: 'Syne', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7c6dfa;
}

.btn-primary {
  background: #7c6dfa;
  color: white;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.03em;
  text-decoration: none;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-outline {
  color: #a99dff;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid rgba(124, 109, 250, 0.35);
  background: rgba(124, 109, 250, 0.07);
}
.btn-outline:hover {
  background: rgba(124, 109, 250, 0.16);
  border-color: rgba(124, 109, 250, 0.55);
  color: #e0e0f5;
  transform: translateY(-1px);
}

.proj-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(124, 109, 250, 0.13);
}

.social-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}
.social-icon:hover { opacity: 1; transform: translateY(-2px); }

/* ── Skills ── */
.skills-cat-label {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7878a0;
  margin-bottom: 14px;
}
.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.skill-icon {
  width: 48px;
  height: 48px;
  transition: transform 0.2s ease;
}
.skill-icon:hover { transform: translateY(-3px); }
.skill-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #7878a0;
  text-align: center;
}

/* ── Globe / Travel ── */
#globe-container {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, #080816 0%, #030309 100%);
  cursor: grab;
  overflow: hidden;
}
@media (min-width: 640px) { #globe-container { height: 420px; } }
#globe-container:active { cursor: grabbing; }
#globe-canvas { display: block; width: 100%; height: 100%; }

.globe-pin {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c6dfa;
  box-shadow: 0 0 0 2px rgba(124,109,250,0.22), 0 0 7px rgba(124,109,250,0.55);
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 3;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.globe-pin:hover {
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 0 0 0 3px rgba(124,109,250,0.35), 0 0 12px rgba(124,109,250,0.8);
}
.globe-pin-cluster {
  width: 22px;
  height: 22px;
  background: #7c6dfa;
  box-shadow: 0 0 0 2px rgba(124,109,250,0.3), 0 0 10px rgba(124,109,250,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.globe-pin-cluster:hover { transform: translate(-50%, -50%) scale(1.2); }

#travel-popup {
  position: fixed;
  width: 210px;
  background: #13152a;
  border: 1px solid rgba(124,109,250,0.28);
  border-radius: 14px;
  box-shadow: 0 8px 36px rgba(0,0,0,0.55);
  z-index: 200;
  overflow: hidden;
}
#travel-popup.hidden { display: none; }

.popup-photo-wrap {
  width: 100%;
  height: 108px;
  background: #1a1d35;
  position: relative;
  overflow: hidden;
}
#popup-img { width: 100%; height: 100%; object-fit: cover; display: none; }
#popup-placeholder {
  width: 100%; height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #7878a0;
  letter-spacing: 0.05em;
}
.popup-body { padding: 10px 12px 13px; }
#popup-city {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #e0e0f5;
  line-height: 1.2;
  margin-bottom: 2px;
}
#popup-country {
  font-size: 11px;
  color: #7c6dfa;
  font-weight: 600;
  margin-bottom: 4px;
  font-family: 'Syne', sans-serif;
}
#popup-note { font-size: 11.5px; color: #7878a0; line-height: 1.4; }

#popup-close-btn {
  position: absolute;
  top: 7px; right: 8px;
  background: rgba(13,15,30,0.75);
  border: none;
  color: #c8c4f0;
  font-size: 11px;
  cursor: pointer;
  z-index: 21;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}
#popup-close-btn:hover { background: rgba(124,109,250,0.45); }

@media (max-width: 600px) {
  #travel-popup {
    bottom: 0 !important; left: 0 !important; right: 0 !important; top: auto !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0;
    border-bottom: none; border-left: none; border-right: none;
  }
  .popup-photo-wrap { height: 160px; }
  .popup-body { padding: 14px 18px 28px; }
  #popup-city { font-size: 16px; }
}

/* ── Chat Widget ── */
#chat-widget {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#chat-bubble {
  background: #13152a;
  border: 1px solid rgba(124,109,250,0.35);
  border-radius: 16px 16px 4px 16px;
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #c8c4f0;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(124,109,250,0.18);
  cursor: pointer;
  animation: bubble-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  position: relative;
}
#chat-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px; right: 18px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 0px solid transparent;
  border-top: 8px solid rgba(124,109,250,0.35);
}
#chat-bubble::before {
  content: '';
  position: absolute;
  bottom: -6px; right: 19px;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 0px solid transparent;
  border-top: 7px solid #13152a;
  z-index: 1;
}
@keyframes bubble-in {
  from { opacity: 0; transform: scale(0.7) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

#raccoon-bob { animation: run-bob 0.35s ease-in-out infinite; line-height: 1; }
#raccoon-bob:hover { animation: none; }

#chat-robot-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
  padding: 0;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
  transition: filter 0.2s, font-size 0.15s;
}
#chat-robot-btn:hover {
  font-size: 48px;
  filter: drop-shadow(0 3px 14px rgba(124,109,250,0.8));
}
@keyframes run-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

#chat-bubble-text { transition: opacity 0.4s ease; }
#chat-bubble-text.fade-out { opacity: 0; }
#chat-bubble-text.fade-in  { opacity: 1; }

#chat-panel {
  position: fixed;
  bottom: 90px; right: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 460px;
  max-height: calc(100vh - 120px);
  background: #13152a;
  border: 1px solid rgba(124,109,250,0.25);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,109,250,0.1);
  z-index: 9998;
  overflow: hidden;
  animation: panel-in 0.25s cubic-bezier(0.34,1.4,0.64,1) both;
}
#chat-panel.hidden { display: none; }
@keyframes panel-in {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

#chat-header {
  padding: 14px 16px;
  background: #1a1d35;
  border-bottom: 1px solid rgba(124,109,250,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#chat-header span.robot-sm { font-size: 20px; }
#chat-header .title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #e0e0f5;
  flex: 1;
}
#chat-header .subtitle { font-size: 11px; color: #7878a0; }

#chat-close {
  background: none;
  border: none;
  color: #7878a0;
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}
#chat-close:hover { color: #e0e0f5; background: rgba(124,109,250,0.15); }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,109,250,0.2) transparent;
}

.chat-msg {
  max-width: 82%;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 13px;
  border-radius: 14px;
  word-break: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: #7c6dfa;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: #1a1d35;
  color: #c8c4f0;
  border: 1px solid rgba(124,109,250,0.15);
  border-bottom-left-radius: 4px;
}
.chat-msg.typing { color: #7878a0; font-style: italic; }

#chat-input-row {
  padding: 12px;
  border-top: 1px solid rgba(124,109,250,0.12);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: #13152a;
}
#chat-input {
  flex: 1;
  background: #1a1d35;
  border: 1px solid rgba(124,109,250,0.2);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px;
  color: #e0e0f5;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}
#chat-input:focus { border-color: rgba(124,109,250,0.5); }

#chat-send {
  background: #7c6dfa;
  border: none;
  border-radius: 12px;
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
  align-self: flex-end;
}
#chat-send:hover { opacity: 0.85; transform: scale(1.05); }
#chat-send:disabled { opacity: 0.4; cursor: default; transform: none; }
#chat-send svg { width: 16px; height: 16px; fill: white; }

#chat-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9997;
  animation: backdrop-in 0.2s ease both;
}
#chat-backdrop.hidden { display: none !important; }
@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 600px) {
  #chat-widget { bottom: 16px; right: 16px; }

  #chat-panel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    height: 72dvh; max-height: 72dvh;
    border-radius: 20px 20px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    transform-origin: bottom center;
    will-change: transform;
    animation: panel-in-mobile 0.28s cubic-bezier(0.34,1.3,0.64,1) both;
  }
  #chat-input-row {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  #chat-backdrop { display: block; }

  @keyframes panel-in-mobile {
    from { opacity: 0; transform: translateY(60px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
