/* MASSIVE FX STUDIOS — AI STUDIO AESTHETIC v3 */

:root {
  /* Colors */
  --surface: #000000;
  --surface-container-lowest: #08090A;
  --surface-container-low: #111318;
  --surface-container: #191C22;
  --surface-container-highest: rgba(255, 255, 255, 0.06);
  --surface-bright: #1E2128;

  /* Google AI Gradients */
  --ai-color-1: #4285F4;
  --ai-color-2: #9B72CB;
  --ai-color-3: #D96570;
  --ai-color-4: #F9AB00;

  --on-surface: #E8EAED;
  --on-surface-variant: #9AA0A6;
  --outline-variant: rgba(255, 255, 255, 0.08);

  --shadow-diffused: 0px 8px 32px -4px rgba(0, 0, 0, 0.8);

  /* Typography */
  --font-display: 'Funnel Sans', sans-serif;
  --font-body: 'Funnel Sans', sans-serif;

  /* Sizes */
  --display-lg: clamp(2.2rem, 3.6vw, 3.1rem);
  --display-md: clamp(1.8rem, 3vw, 2.5rem);
  --display-sm: clamp(1.2rem, 2vw, 1.5rem);
  --body-lg: 1.05rem;
  --body-md: 0.9rem;
  --label-sm: 0.7rem;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.theme-ai-studio {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === PARTICLE CANVAS === */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* === AMBIENT GLOW === */
.ambient-glow {
  position: fixed;
  top: -10%; left: 50%;
  transform: translateX(-50%);
  width: 120vw; height: 70vh;
  background: radial-gradient(ellipse at 50% 0%, rgba(155, 114, 203, 0.12) 0%, rgba(66, 133, 244, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* === TYPOGRAPHY === */
.display-lg, .display-md, .display-sm {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.display-lg { font-size: var(--display-lg); line-height: 1.1; }
.display-md { font-size: var(--display-md); line-height: 1.15; }
.display-sm { font-size: var(--display-sm); line-height: 1.25; }

.body-lg { font-size: var(--body-lg); font-weight: 400; line-height: 1.7; }
.body-md { font-size: var(--body-md); font-weight: 400; line-height: 1.6; }
.label-sm {
  font-family: var(--font-body);
  font-size: var(--label-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.text-gradient {
  background: linear-gradient(90deg, var(--ai-color-1), var(--ai-color-2), var(--ai-color-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.neutral-text { color: var(--on-surface-variant); }
.text-muted { color: rgba(255,255,255,0.35); }

/* === ANIMATED BORDER (CONIC GRADIENT) === */
@keyframes rotate-border {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.animated-border-media {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background-color: var(--outline-variant);
  padding: 1px;
  transition: transform 0.3s ease;
}

.animated-border-media::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 300%; height: 300%;
  background: conic-gradient(
    from 0deg,
    transparent 60%,
    var(--ai-color-1) 72%,
    var(--ai-color-2) 82%,
    var(--ai-color-3) 92%,
    transparent 100%
  );
  animation: rotate-border 4s linear infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  pointer-events: none;
}
.animated-border-media:hover::before { opacity: 1; }

.animated-border-media > .media-content {
  position: relative;
  background-color: var(--surface-container-low);
  border-radius: 19px;
  height: 100%; width: 100%;
  z-index: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* === MODAL TEXT BOX PADDING FIX === */
.modal-text-box {
  padding: 2rem;
}
@media (max-width: 768px) {
  .modal-text-box {
    padding: 1.25rem;
  }
}

/* === BUTTONS — GRADIENT FILLED === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.6rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: var(--body-md);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
}

.btn.primary-filled {
  background: linear-gradient(135deg, var(--ai-color-1) 0%, var(--ai-color-2) 50%, var(--ai-color-3) 100%);
  background-size: 200% 200%;
  animation: gradient-shift 5s ease infinite;
  color: #fff;
  box-shadow: 0 4px 20px rgba(66, 133, 244, 0.25);
  position: relative;
  overflow: hidden;
}

.modal-video-box {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 19px 19px 0 0;
  position: relative;
  overflow: hidden;
}

/* Master Player Blue Button Layout */
.master-play-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  z-index: 5;
  overflow: hidden;
}
.master-play-img {
  position: absolute;
  width: 100%; height: 100%; object-fit: cover; opacity: 0.6;
  transition: opacity 0.3s;
}
.master-play-overlay:hover .master-play-img {
  opacity: 0.8;
}
.master-blue-button {
  position: relative;
  z-index: 10;
  width: 80px; height: 80px;
  background: var(--ai-color-1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  font-size: 2rem;
  padding-left: 6px; /* center play icon visually */
  box-shadow: 0 0 30px rgba(0, 255, 234, 0.4);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.master-blue-button::before,
.master-blue-button::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px solid var(--ai-color-1);
  opacity: 0;
  pointer-events: none;
}

.master-play-overlay:hover .master-blue-button {
  transform: scale(1.15);
  box-shadow: 0 0 40px rgba(0, 255, 234, 0.6);
}

.master-play-overlay:hover .master-blue-button::before {
  animation: energy-ripple 1.5s linear infinite;
}

.master-play-overlay:hover .master-blue-button::after {
  animation: energy-ripple 1.5s linear infinite 0.75s;
}

@keyframes energy-ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* === MODAL CLIENT LOGO === */
.modal-client-logo {
  margin: 0.75rem 0 1.25rem;
}
.modal-client-logo-img {
  max-height: 48px;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn.primary-filled:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(155, 114, 203, 0.45);
}

.btn.primary-filled:active {
  transform: translateY(0);
}

/* === HEADER === */
.glass-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5%;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--outline-variant);
}

.header-nav {
  display: flex;
  gap: 2.5rem;
  margin-right: auto;
}

.nav-link {
  color: var(--on-surface-variant);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--ai-color-1), var(--ai-color-2));
  transition: width 0.3s;
  border-radius: 1px;
}
.nav-link:hover { color: var(--on-surface); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--on-surface); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

/* === LANGUAGE TOGGLE === */

/* === SOCIAL MEDIA LINKS === */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--outline-variant);
  border-radius: 10px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.social-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Platform-specific hover colors */
.social-icon[aria-label="YouTube"]:hover {
  color: #FF0000;
  background: rgba(255, 0, 0, 0.12);
}
.social-icon[aria-label="LinkedIn"]:hover {
  color: #0A66C2;
  background: rgba(10, 102, 194, 0.12);
}
.social-icon[aria-label="ArtStation"]:hover {
  color: #13AFF0;
  background: rgba(19, 175, 240, 0.12);
}
.social-icon[aria-label="Instagram"]:hover {
  color: #E4405F;
  background: rgba(228, 64, 95, 0.12);
}
.social-icon[aria-label="Harder Parkour Instagram"]:hover {
  color: #E4405F;
  background: rgba(228, 64, 95, 0.12);
}
.social-icon[aria-label="Harder Parkour on Steam"]:hover {
  color: #1B2838;
  background: rgba(102, 192, 244, 0.15);
  color: #66C0F4;
}

/* Harder Parkour icons - slightly different default color */
.social-icon-hp {
  color: rgba(255, 255, 255, 0.3);
}
.social-icon-hp:hover {
  color: #fff;
}

/* Divider between studio & HP links */
.social-divider {
  width: 1px;
  height: 18px;
  background: var(--outline-variant);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--outline-variant);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}
.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.lang-option {
  font-size: var(--label-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  transition: color 0.3s;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
}
.lang-option.active {
  color: var(--on-surface);
  background: rgba(66, 133, 244, 0.2);
}
.lang-divider {
  color: var(--outline-variant);
  font-size: 0.7rem;
  user-select: none;
}

/* === PULSE CHIP === */
.pulse-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  border: 1px solid var(--outline-variant);
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background-color: #34A853;
  box-shadow: 0 0 6px #34A853, 0 0 12px rgba(52,168,83,0.3);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}
.pulse-label {
  font-size: var(--label-sm);
  color: var(--on-surface-variant);
  text-transform: uppercase;
}

/* === MAIN === */
main { padding-top: 100px; position: relative; z-index: 1; }

/* === HERO === */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5rem 5% 8rem 5%;
  gap: 5rem;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-text { flex: 1; max-width: 640px; }
.hero-brand-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}
.main-hero-logo {
  width: 320px;
  height: auto;
}
.hero-brand-name {
  font-family: 'Funnel Sans', sans-serif;
  font-size: 2.75rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}
@media (max-width: 768px) {
  .hero-brand-header { gap: 0.8rem; }
  .main-hero-logo { width: 280px; }
  .hero-brand-name { font-size: 1.8rem; }
}
}

.hero-text .body-lg { margin-top: 1.8rem; margin-bottom: 2.5rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual {
  flex: 1;
  max-width: 560px;
  height: 380px;
  cursor: pointer;
}

.visual-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  color: var(--on-surface-variant);
  font-size: var(--body-md);
  border-radius: inherit;
  background: var(--surface-container-lowest);
}

/* === PLAY ICON === */
.play-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--ai-color-1), var(--ai-color-2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: white;
  transition: transform 0.3s, box-shadow 0.3s;
  padding-left: 4px;
}
.play-icon-lg { width: 72px; height: 72px; font-size: 1.6rem; }

.hero-visual:hover .play-icon,
.modal-video-placeholder:hover .play-icon {
  transform: scale(1.12);
  box-shadow: 0 0 24px rgba(66, 133, 244, 0.5);
}

/* === FEATURED FOCUS SECTION === */
.featured-section {
  padding: 4rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}
.featured-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.featured-badge {
  font-family: var(--font-display);
  font-size: var(--body-sm);
  font-weight: 800;
  color: var(--ai-color-1);
  letter-spacing: 0.15em;
  padding: 0.4rem 1rem;
  background: rgba(0, 255, 234, 0.1);
  border-radius: 4px;
  width: max-content;
}
.featured-main-card {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.featured-image-side {
  flex: 1.2;
  position: relative;
  min-height: 400px;
}
.nextfest-banner {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.featured-main-card:hover .nextfest-banner {
  transform: scale(1.05);
}
.nextfest-tag {
  position: absolute;
  top: 2rem; left: 2rem;
  background: linear-gradient(135deg, #00D2FF 0%, #3A7BD5 100%);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: var(--body-sm);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.featured-content-side {
  flex: 1;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  background: linear-gradient(90deg, rgba(14, 14, 14, 0.9) 0%, transparent 100%);
}
.featured-project-logo {
  width: 180px; height: auto;
  margin-bottom: 0.5rem;
}
.featured-content-side .display-md {
  font-size: 2.8rem;
  line-height: 1.1;
}
.featured-content-side .body-lg {
  max-width: 500px;
  line-height: 1.6;
}
.featured-cta {
  margin-top: 1rem;
}

@media (max-width: 1024px) {
  .featured-main-card { flex-direction: column; }
  .featured-image-side { flex: none; height: 350px; }
  .featured-content-side { padding: 3rem 2rem; background: rgba(14, 14, 14, 0.8); }
  .featured-project-logo { width: 150px; }
  .featured-content-side .display-md { font-size: 2.2rem; }
}

/* === FAB MARKETPLACE SECTION === */
.fab-section {
  padding: 6rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}
.fab-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}
.fab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.fab-card {
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fab-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #F5C518;
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(245, 197, 24, 0.15);
}

.fab-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.fab-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #F5C518;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(245, 197, 24, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.fab-price {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
}

.fab-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.fab-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: #1a1a1a;
}

.vfx-bg-alt { background: radial-gradient(circle at center, #2c1a4d 0%, #121212 100%); color: #9B72CB; }
.water-bg-alt { background: radial-gradient(circle at center, #1a3a4d 0%, #121212 100%); color: #00D2FF; }

.fab-card-content {
  padding: 1.5rem;
  flex: 1;
}

.fab-card-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  color: #fff;
}
.fab-card-content p {
  font-size: var(--body-sm);
  color: var(--on-surface-variant);
  line-height: 1.5;
}

.fab-card-footer {
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-view-on-fab {
  font-weight: 700;
  font-size: 0.85rem;
  color: #F5C518;
}

.fab-view-all {
  text-align: center;
  margin-top: 1rem;
}

@media (max-width: 1024px) {
  .fab-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .fab-grid { grid-template-columns: 1fr; }
}

/* === PORTFOLIO SECTION (ADJUSTED) === */
.portfolio-section {
  padding: 6rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header { margin-bottom: 3.5rem; }
.section-subtitle { margin-top: 0.8rem; max-width: 500px; }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  perspective: 2000px;
}

/* === PORTFOLIO CARD === */
.portfolio-card {
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease-out, box-shadow 0.3s ease;
  transform-style: preserve-3d;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.portfolio-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent, rgba(255,255,255,0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.portfolio-card:hover {
  z-index: 10;
}

/* Base Card Style Updates */
.card-inner-wrapper {
  display: flex;
  flex-direction: column;
  padding: 2rem 2.2rem;
  gap: 1.2rem;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
  border-radius: 21px; /* Slightly less than card to sit perfectly inside */
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5); /* Inner silme effect */
}

.card-inner-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: -1;
  transition: background 0.4s;
}

.portfolio-card:hover .card-inner-wrapper::before {
  background: rgba(17, 17, 17, 0.4);
}

/* Category Specific Backgrounds & Glows */
.portfolio-card[data-type="game"] .card-inner-wrapper { background-image: url('./gamedev_card_bg.png'); }
.portfolio-card[data-type="game"]:hover { box-shadow: 0 0 40px rgba(255, 59, 59, 0.35); }
.portfolio-card[data-type="game"] .card-tag { background: rgba(255, 59, 59, 0.2); color: #FF3B3B; }

.portfolio-card[data-type="3d"] .card-inner-wrapper { background-image: url('./vfx_card_bg.png'); }
.portfolio-card[data-type="3d"]:hover { box-shadow: 0 0 40px rgba(0, 210, 255, 0.35); }
.portfolio-card[data-type="3d"] .card-tag { background: rgba(0, 210, 255, 0.2); color: #00D2FF; }

.portfolio-card[data-type="cgi"] .card-inner-wrapper { background-image: url('./cgi_card_bg.png'); }
.portfolio-card[data-type="cgi"]:hover { box-shadow: 0 0 40px rgba(0, 255, 238, 0.35); }
.portfolio-card[data-type="cgi"] .card-tag { background: rgba(0, 255, 238, 0.2); color: #00FFEE; }

.portfolio-card[data-type="sim"] .card-inner-wrapper { background-image: url('./sim_card_bg.png'); }
.portfolio-card[data-type="sim"]:hover { box-shadow: 0 0 40px rgba(52, 168, 83, 0.35); }
.portfolio-card[data-type="sim"] .card-tag { background: rgba(52, 168, 83, 0.2); color: #34A853; }

.portfolio-card[data-type="fair"] .card-inner-wrapper { background-image: url('./fair_card_bg.png'); }
.portfolio-card[data-type="fair"]:hover { box-shadow: 0 0 40px rgba(255, 215, 0, 0.3); }
.portfolio-card[data-type="fair"] .card-tag { background: rgba(255, 215, 0, 0.2); color: #FFD700; }

.card-inner-wrapper {
  display: flex;
  flex-direction: column;
  padding: 2rem 2.2rem;
  gap: 1.2rem;
  height: 100%;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-tag {
  font-size: var(--label-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface-variant);
  background: rgba(255,255,255,0.06);
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.card-content .body-md {
  color: var(--on-surface-variant);
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--outline-variant);
  border-radius: 10px;
  transition: all 0.3s;
  margin-top: auto;
}

.portfolio-card:hover .card-action {
  background: rgba(66, 133, 244, 0.08);
  border-color: rgba(66, 133, 244, 0.3);
}

.action-text {
  color: var(--ai-color-1);
  font-weight: 600;
  font-size: var(--body-md);
  transition: color 0.3s;
}

.action-arrow {
  color: var(--ai-color-1);
  font-size: 1.2rem;
  transition: transform 0.3s;
}
.portfolio-card:hover .action-arrow {
  transform: translateX(4px);
}

/* Wide card spanning full width */
.portfolio-card-wide {
  grid-column: 1 / -1;
}
.card-inner-horizontal {
  flex-direction: row;
  align-items: center;
  gap: 2.5rem;
}
.card-inner-horizontal .card-header-row {
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  flex-shrink: 0;
  min-width: 80px;
}
.card-inner-horizontal .card-content {
  flex: 1;
  text-align: left;
}
.card-inner-horizontal .card-action {
  margin-top: 0;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 160px;
  justify-content: center;
  gap: 0.5rem;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.fab-view-all {
  margin-top: 4rem;
  display: flex;
  justify-content: center;
}

.fab-store-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 1.2rem 2.5rem;
  background: rgba(245, 197, 24, 0.05);
  border: 1px solid rgba(245, 197, 24, 0.3);
  border-radius: 100px;
  color: #F5C518;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(245, 197, 24, 0.05);
}

.fab-store-button::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 197, 24, 0.2), transparent);
  transition: 0.6s;
}

.fab-store-button:hover {
  background: rgba(245, 197, 24, 0.15);
  border-color: #F5C518;
  box-shadow: 0 0 40px rgba(245, 197, 24, 0.3), inset 0 0 15px rgba(245, 197, 24, 0.1);
  transform: translateY(-5px) scale(1.02);
  letter-spacing: 0.2em;
}

.fab-store-button:hover::before {
  left: 100%;
}

.fab-store-button:active {
  transform: translateY(-2px) scale(0.98);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 90%;
  max-width: 1100px;
  height: 90vh;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}
.modal-overlay.active .modal-container.scrolled {
  transform: scale(1.04);
}

.modal-content-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  position: relative;
  background-color: var(--surface-container-low);
  border-radius: 19px;
}

/* Custom Modal Scrollbar */
.modal-content-inner::-webkit-scrollbar {
  width: 8px;
}
.modal-content-inner::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
  border-left: 1px solid var(--outline-variant);
}
.modal-content-inner::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 4px;
}
.modal-content-inner::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.close-btn {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 1.8rem;
  color: var(--on-surface-variant);
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.3s;
}
.close-btn:hover {
  color: #fff;
  background: rgba(217, 101, 112, 0.7);
  border-color: rgba(217, 101, 112, 0.9);
  transform: rotate(90deg);
}

.modal-video-box {
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  max-height: 60vh;
  background: #000;
  border-bottom: 1px solid var(--outline-variant);
}

.modal-video-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  color: var(--on-surface-variant);
  font-size: var(--body-md);
  background: var(--surface-container-lowest);
  cursor: pointer;
}

/* Fix iframe swallowing mouse wheel events while scrolling */
.modal-content-inner.is-scrolling iframe {
  pointer-events: none;
}

.modal-text-box {
  padding: 3rem 4rem;
  background: var(--surface-container-low);
  flex-grow: 1;
}
.modal-text-box h3 { margin-bottom: 1.5rem; }

/* Article Body Formatting */
.modal-article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--on-surface-variant);
}
.modal-article-body p {
  margin-bottom: 1.2rem;
}
.modal-article-body strong {
  color: var(--on-surface);
  font-weight: 600;
}
.modal-article-body h4 {
  font-size: 1.2rem;
  color: var(--on-surface);
  margin: 2rem 0 1rem 0;
  font-family: var(--font-display);
}
.modal-article-body ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.modal-article-body li {
  margin-bottom: 0.5rem;
  position: relative;
}
.modal-article-body li::marker {
  color: var(--ai-color-1);
}

.modal-doc-links {
  list-style: none;
  padding-left: 0 !important;
}
.modal-doc-links li {
  margin-bottom: 0.8rem;
}
.modal-doc-links a {
  display: inline-block;
  color: var(--ai-color-1);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: rgba(66, 133, 244, 0.08);
  border: 1px solid rgba(66, 133, 244, 0.2);
  border-radius: 8px;
  transition: all 0.3s;
}
.modal-doc-links a:hover {
  background: rgba(66, 133, 244, 0.15);
  border-color: rgba(66, 133, 244, 0.4);
  transform: translateX(5px);
}

/* === MODAL GALLERY GRID === */
.modal-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--outline-variant);
}

.gallery-thumb-item {
  display: flex; flex-direction: column;
}

.gallery-thumb-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-thumb-wrapper:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.6);
}

.gallery-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.gallery-thumb-wrapper:hover .gallery-thumb-img {
  opacity: 0.5;
}

.gallery-play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  padding-left: 4px; /* visually center play icon */
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-surface);
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-thumb-wrapper:hover .gallery-play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* === GALLERY SECTION HEADER === */
.gallery-section-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem 0.6rem 1rem;
  margin: 0.75rem 0 0.5rem;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(66, 133, 244, 0.12) 0%,
    rgba(155, 114, 203, 0.10) 50%,
    rgba(217, 101, 112, 0.08) 100%
  );
  border: 1px solid rgba(155, 114, 203, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(66, 133, 244, 0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.gallery-section-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--ai-color-1), var(--ai-color-2), var(--ai-color-3));
  border-radius: 0 2px 2px 0;
}
.gallery-section-header:first-child {
  margin-top: 0;
}
.gallery-section-logo {
  height: 24px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.gallery-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--ai-color-1), var(--ai-color-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === GALLERY INFO BLOCK === */
.gallery-info-block {
  grid-column: 1 / -1;
  padding: 0.9rem 1rem 0.9rem 1.25rem;
  margin-bottom: 0.25rem;
  border-left: 2px solid rgba(155, 114, 203, 0.35);
  background: rgba(255,255,255,0.02);
  border-radius: 0 8px 8px 0;
}
.gallery-info-block p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--on-surface-variant);
  opacity: 0.75;
  font-style: italic;
}

.gallery-thumb-title {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--on-surface-variant);
  font-weight: 500;
  line-height: 1.3;
  /* limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === FOOTER === */
.footer-area {
  padding: 5rem 5% 2.5rem 5%;
  background-color: var(--surface-container-lowest);
  border-top: 1px solid var(--outline-variant);
  position: relative;
  z-index: 1;
}
.footer-container {
  max-width: 1400px;
  margin: 0 auto 3rem auto;
}
.contact-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--outline-variant);
  padding-top: 1.5rem;
}

/* === RESPONSIVE === */
@media screen and (max-width: 900px) {
  .hero-section { flex-direction: column; text-align: center; padding: 3rem 5% 5rem 5%; gap: 3rem; }
  .hero-text { margin: 0 auto; max-width: 100%; }
  .hero-cta { justify-content: center; }
  .hero-visual { width: 100%; max-width: 100%; height: 280px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .card-inner-horizontal { flex-direction: column; }
  .card-inner-horizontal .card-header-row { flex-direction: row; margin-right: 0; }
  .card-inner-horizontal .card-action { margin-left: 0; min-width: auto; width: 100%; }
  .header-nav { display: none; }
  .glass-header { justify-content: flex-end; }
  .social-links { padding: 0.2rem 0.35rem; }
  .social-icon { width: 26px; height: 26px; }
  .social-icon svg { width: 13px; height: 13px; }
  .nav-actions { gap: 0.8rem; }
  .pulse-chip { display: none; }
  .contact-links { flex-direction: column; }
  .modal-video-box { aspect-ratio: 16/10; }
  .modal-text-box { padding: 1.5rem 1.5rem; }
  .gallery-section-logo { height: 18px; max-width: 90px; }
  .gallery-section-header { gap: 0.5rem; padding: 0.5rem 0.75rem 0.5rem 0.75rem; }
  .gallery-section-label { font-size: 0.65rem; }
  .modal-client-logo-img { max-height: 32px; max-width: 140px; }
  .ai-chat-panel { width: calc(100vw - 1.5rem); right: 0.75rem; bottom: 5.5rem; }
  .ai-chat-fab { width: 52px; height: 52px; bottom: 1.2rem; right: 1.2rem; }
}

/* ====================================
   AI CHATBOT WIDGET
   ==================================== */
.ai-chat-widget {
  position: fixed;
  z-index: 999;
  bottom: 0;
  right: 0;
  font-family: var(--font-body);
}

/* === FLOATING ACTION BUTTON === */
.ai-chat-fab {
  position: fixed;
  bottom: 1.8rem;
  right: 1.8rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #111318 0%, #191C22 100%);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
  overflow: visible;
}

.ai-chat-fab:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 32px rgba(66, 133, 244, 0.3),
    0 0 0 1px rgba(66, 133, 244, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ai-chat-fab .fab-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s, transform 0.3s;
}

.ai-chat-fab .close-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.ai-chat-widget.open .ai-chat-fab .chat-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.ai-chat-widget.open .ai-chat-fab .close-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Pulse ring on FAB */
.fab-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(66, 133, 244, 0.4);
  animation: fab-pulse 2.5s ease-out infinite;
  pointer-events: none;
}

.ai-chat-widget.open .fab-pulse-ring {
  display: none;
}

@keyframes fab-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* === CHAT PANEL === */
.ai-chat-panel {
  position: fixed;
  bottom: 6rem;
  right: 1.8rem;
  width: 400px;
  max-height: 560px;
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;

  /* Glassmorphism */
  background: rgba(17, 19, 24, 0.82);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-chat-widget.open .ai-chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ai-chat-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 560px;
}

/* === CHAT HEADER === */
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(155, 114, 203, 0.15));
  border: 1px solid rgba(66, 133, 244, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-avatar-sm {
  width: 28px;
  height: 28px;
}

.ai-chat-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--on-surface);
  letter-spacing: -0.01em;
}

.ai-chat-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--on-surface-variant);
}

.ai-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34A853;
  box-shadow: 0 0 6px rgba(52, 168, 83, 0.5);
}

.ai-settings-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-settings-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-surface);
}

/* === SETUP SCREEN === */
.ai-setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 2rem 2rem 2rem;
  text-align: center;
  gap: 0.8rem;
}

.ai-setup-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(155, 114, 203, 0.12));
  border: 1px solid rgba(66, 133, 244, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.3rem;
}

.ai-setup-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.02em;
}

.ai-setup-desc {
  font-size: 0.82rem;
  color: var(--on-surface-variant);
  line-height: 1.5;
  max-width: 280px;
  margin-bottom: 0.3rem;
}

.ai-key-input-group {
  width: 100%;
  position: relative;
}

.ai-key-input {
  width: 100%;
  padding: 0.75rem 2.8rem 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.ai-key-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.ai-key-input:focus {
  border-color: rgba(66, 133, 244, 0.5);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.ai-key-vis-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.ai-key-vis-btn:hover {
  color: var(--on-surface);
}

.ai-key-save-btn {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.7rem;
  font-size: 0.85rem;
}

.ai-get-key-link {
  font-size: 0.75rem;
  color: var(--ai-color-1);
  text-decoration: none;
  transition: color 0.2s;
}

.ai-get-key-link:hover {
  color: var(--ai-color-2);
  text-decoration: underline;
}

/* === CHAT MESSAGES === */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 280px;
  max-height: 380px;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.ai-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.ai-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Message row */
.ai-msg-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  animation: msg-appear 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-msg-row.user {
  flex-direction: row-reverse;
}

.ai-welcome-msg {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

@keyframes msg-appear {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Message bubbles */
.ai-msg-bubble {
  max-width: 82%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.ai-msg-bot {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 4px;
  color: var(--on-surface);
}

.ai-msg-user {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(155, 114, 203, 0.18));
  border: 1px solid rgba(66, 133, 244, 0.2);
  border-bottom-right-radius: 4px;
  color: var(--on-surface);
  margin-left: auto;
}

/* Typing indicator */
.ai-typing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ai-typing-dots {
  display: flex;
  gap: 4px;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.ai-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ai-color-1);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

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

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

/* Error message */
.ai-msg-error {
  background: rgba(217, 101, 112, 0.1);
  border: 1px solid rgba(217, 101, 112, 0.2);
  color: #D96570;
}

/* === CHAT INPUT === */
.ai-chat-input-area {
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.ai-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.ai-input-wrapper:focus-within {
  border-color: rgba(66, 133, 244, 0.4);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.08);
}

.ai-chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.4;
  resize: none;
  outline: none;
  max-height: 100px;
  padding: 0.3rem 0;
}

.ai-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.ai-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--ai-color-1), var(--ai-color-2));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  opacity: 0.6;
}

.ai-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 2px 12px rgba(66, 133, 244, 0.35);
  opacity: 1;
}

.ai-send-btn.active {
  opacity: 1;
}

.ai-powered-by {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.2);
  margin-top: 0.5rem;
  letter-spacing: 0.03em;
}
