/* ==========================================================================
   PFE Invitation – Premium Glassmorphism Design System
   Palette: Warm navy + Indigo + Amber accents
   ========================================================================== */

:root {
  /* Colors – Warm Luminous Light Theme (Default) */
  --bg-1: #f0eefc;
  --bg-2: #e8e5fa;
  --accent-1: #4f46e5;          /* Indigo primary */
  --accent-2: #6366f1;          /* Lighter indigo */
  --accent-3: #f59e0b;          /* Warm amber CTA */
  --accent-glow: rgba(79, 70, 229, 0.12);
  --accent-glow-strong: rgba(79, 70, 229, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.84);
  --glass-bg-hover: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(79, 70, 229, 0.08);
  --glass-border-hover: rgba(79, 70, 229, 0.18);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-on-accent: #ffffff;
  --card-inner-bg: rgba(79, 70, 229, 0.03);
  --section-divider: rgba(79, 70, 229, 0.06);

  /* Envelope (light mode – soft indigo) */
  --envelope-bg-1: #ddd6fe;
  --envelope-bg-2: #c4b5fd;
  --envelope-shadow: rgba(79, 70, 229, 0.15);
  --seal-bg: #4f46e5;
  --seal-border: rgba(255, 255, 255, 0.5);
  --seal-logo-color: #ffffff;

  /* Particle colors */
  --particle-1: rgba(79, 70, 229, 0.06);
  --particle-2: rgba(99, 102, 241, 0.04);

  /* Typography */
  --font-display: 'Crimson Pro', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Spacing & Radius */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --accent-1: #818cf8;
  --accent-2: #6366f1;
  --accent-3: #fbbf24;
  --accent-glow: rgba(129, 140, 248, 0.15);
  --accent-glow-strong: rgba(129, 140, 248, 0.3);
  --glass-bg: rgba(30, 41, 59, 0.75);
  --glass-bg-hover: rgba(30, 41, 59, 0.9);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(129, 140, 248, 0.2);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-on-accent: #0f172a;
  --card-inner-bg: rgba(255, 255, 255, 0.03);
  --section-divider: rgba(255, 255, 255, 0.04);

  --envelope-bg-1: #312e81;
  --envelope-bg-2: #1e1b4b;
  --envelope-shadow: rgba(0, 0, 0, 0.4);
  --seal-bg: #818cf8;
  --seal-border: rgba(0, 0, 0, 0.15);
  --seal-logo-color: #0f172a;

  --particle-1: rgba(129, 140, 248, 0.05);
  --particle-2: rgba(99, 102, 241, 0.04);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 10%, rgba(167, 139, 250, 0.05) 0%, transparent 40%),
    var(--bg-1);
  font-family: var(--font-body);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  transition: background 0.5s ease, color 0.5s ease;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 10%, rgba(99, 102, 241, 0.04) 0%, transparent 40%),
    var(--bg-1);
}

/* Particle Canvas Background */
#particleCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes floatEnvelope {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(0.5deg); }
}

@keyframes pulseAccent {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  70% { box-shadow: 0 0 0 16px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

:root[data-theme="dark"] .seal { animation-name: pulseAccentDark; }
@keyframes pulseAccentDark {
  0% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(129, 140, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(4deg); }
}

@keyframes bounceIn {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  50% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes pulseRSVP {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 30px rgba(245, 158, 11, 0.25); }
  50% { transform: scale(1.03); box-shadow: 0 12px 40px rgba(245, 158, 11, 0.35); }
}

@keyframes fadeInText {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes photoGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes floatUp {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-120vh) translateX(var(--sway-x, 40px)) rotate(var(--rotate-angle, 15deg)); opacity: 0; }
}

@keyframes stringSway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

@keyframes emojiRotate {
  0% { transform: rotate(-8deg) scale(0.95); }
  100% { transform: rotate(8deg) scale(1.05); }
}

@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-7px); }
  60% { transform: translateY(-3px); }
}

@keyframes clickBadgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

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

@keyframes ringPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ==========================================================================
   Language System
   ========================================================================== */
.lang-en, .lang-fr {
  display: inline-block;
  animation: fadeInText 0.4s var(--ease-out) forwards;
}
div.lang-en, div.lang-fr, p.lang-en, p.lang-fr { display: block; }
html[lang="en"] .lang-fr { display: none !important; }
html[lang="fr"] .lang-en { display: none !important; }

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5%;
  z-index: 100;
  pointer-events: none;
  transition: var(--transition);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  pointer-events: auto;
}

.logo-text {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: initial;
}
.logo-text span {
  background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.theme-toggle-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: flex; justify-content: center; align-items: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.theme-toggle-btn:hover {
  color: var(--accent-1);
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: scale(1.08);
}

.sound-toggle-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: flex; justify-content: center; align-items: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.sound-toggle-btn:hover {
  color: var(--accent-1);
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: scale(1.08);
}

.sun-icon { display: none; }
.moon-icon { display: block; }
:root[data-theme="dark"] .sun-icon { display: block; }
:root[data-theme="dark"] .moon-icon { display: none; }

.lang-toggle-container {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 3px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
  background: var(--accent-1);
  color: var(--text-on-accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ==========================================================================
   Main Layout
   ========================================================================== */
.main-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 20px 50px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Envelope
   ========================================================================== */
.envelope-wrapper {
  position: relative;
  width: 480px; height: 320px;
  perspective: 1000px;
  animation: floatEnvelope 6s ease-in-out infinite;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), max-width 0.35s var(--ease-out);
  will-change: width, height;
}

.envelope {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(145deg, var(--envelope-bg-1) 0%, var(--envelope-bg-2) 100%);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px var(--envelope-shadow),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  z-index: 10;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.envelope:hover {
  transform: translateY(-6px);
}

/* Flaps */
.flap { position: absolute; width: 0; height: 0; border-style: solid; transition: transform 0.6s var(--ease-out); will-change: transform; }
.top-flap { top: 0; left: 0; border-width: 160px 240px 0; border-color: var(--envelope-bg-1) transparent transparent; transform-origin: top; z-index: 4; }
.left-flap { top: 0; left: 0; border-width: 160px 0 160px 240px; border-color: transparent transparent transparent var(--envelope-bg-1); z-index: 3; opacity: 0.92; }
.right-flap { top: 0; right: 0; border-width: 160px 240px 160px 0; border-color: transparent var(--envelope-bg-1) transparent transparent; z-index: 3; opacity: 0.92; }
.bottom-flap { bottom: 0; left: 0; border-width: 0 240px 160px; border-color: transparent transparent var(--envelope-bg-2) transparent; z-index: 2; }

/* Seal */
.seal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) translateZ(5px);
  width: 72px; height: 72px;
  background: var(--seal-bg);
  border: 2px solid var(--seal-border);
  border-radius: 50%;
  box-shadow: 0 6px 20px var(--envelope-shadow);
  z-index: 5;
  transition: var(--transition);
  animation: pulseAccent 2.5s infinite;
  display: flex; justify-content: center; align-items: center;
  transform-style: preserve-3d;
}

.seal-inner {
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border: 2px dashed var(--seal-border);
  border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  color: var(--seal-logo-color);
  transform: translateZ(1px);
}

.seal:hover {
  transform: translate(-50%, -50%) scale(1.12) translateZ(8px);
  box-shadow: 0 8px 30px var(--accent-glow-strong);
}

.envelope-hint {
  position: absolute;
  bottom: -50px;
  left: 0; right: 0;
  text-align: center;
  color: var(--accent-1);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.hint-pulse {
  font-size: 1.4rem;
  display: inline-block;
  animation: hintBounce 1.4s ease-in-out infinite;
}

/* Opened State */
.envelope-wrapper.opened {
  animation: none;
  width: 900px; height: auto;
  max-width: 95%;
  perspective: none;
  will-change: auto;
}
.envelope-wrapper.opened .envelope {
  pointer-events: none; opacity: 0;
  transform: translate3d(0, 200px, 0) scale(0.8);
  height: 0; overflow: hidden;
}
.envelope-wrapper.opened .top-flap { transform: rotateX(180deg); }
.envelope-wrapper.opened .seal { transform: translate(-50%, -50%) scale(0) rotate(180deg) translateZ(5px); opacity: 0; }

/* ==========================================================================
   Invitation Card
   ========================================================================== */
.invitation-card {
  display: none;
  position: absolute;
  top: 10px; left: 10px; right: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  transform: scale(0.95);
  opacity: 0; visibility: hidden;
  transition: all 0.8s var(--ease-out);
  z-index: 1;
  scroll-margin-top: 100px;
  overflow: hidden;
}

.envelope-wrapper.opened .invitation-card {
  display: block;
  position: relative;
  top: 0; left: 0; right: 0;
  opacity: 1; visibility: visible;
  transform: translate3d(0, 0, 0);
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
  animation: fadeInUp 0.6s var(--ease-out) forwards;
  will-change: transform, opacity;
}

:root[data-theme="dark"] .envelope-wrapper.opened .invitation-card {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Close Button */
.close-card-btn {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 30;
  backdrop-filter: blur(10px);
}
.close-card-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* ==========================================================================
   Hero Section (Photo + Title) – Centered
   ========================================================================== */
.hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding: 50px 40px 36px;
  background: linear-gradient(160deg, var(--card-inner-bg) 0%, transparent 70%);
  border-bottom: 1px solid var(--section-divider);
}

.hero-photo-wrapper {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  padding: 4px;
}

.hero-photo-wrapper::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 0; height: 4px;
  background: linear-gradient(90deg, transparent, #2563eb 30%, #38bdf8 50%, #2563eb 70%, transparent);
  box-shadow: 0 0 10px #2563eb, 0 0 20px #38bdf8;
  z-index: 3;
  opacity: 0.8;
  pointer-events: none;
  animation: laserSweep 4s ease-in-out infinite;
}

@keyframes laserSweep {
  0%, 100% { top: 0%; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.hero-photo-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid var(--accent-1);
  opacity: 0.6;
  animation: ringPulse 2.5s ease-out infinite;
}

.hero-photo-ring::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  animation: ringPulse 2.5s ease-out infinite 0.8s;
}

.hero-photo {
  width: 150px; height: 150px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 15px 40px var(--accent-glow),
              0 5px 15px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  position: relative;
  z-index: 2;
}

.hero-photo:hover {
  transform: scale(1.06);
  box-shadow: 0 20px 50px var(--accent-glow-strong),
              0 8px 20px rgba(0, 0, 0, 0.12);
}

.hero-photo-glow {
  position: absolute;
  inset: -15px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: var(--radius-lg);
  z-index: -1;
  animation: photoGlow 4s ease-in-out infinite;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.univ-logo {
  height: 46px; width: auto;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.04));
  transition: var(--transition);
}
:root[data-theme="dark"] .univ-logo {
  filter: brightness(1.15) drop-shadow(0 2px 10px rgba(129, 140, 248, 0.1));
}

.internship-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: -6px;
  margin-bottom: 18px;
}
.internship-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}
.company-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.04));
  transition: var(--transition);
}
:root[data-theme="dark"] .company-logo {
  filter: brightness(1.2) drop-shadow(0 2px 10px rgba(255, 255, 255, 0.15));
}
.company-logo:hover {
  transform: scale(1.05);
}

.academic-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-on-accent);
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  padding: 5px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.academic-title {
  font-size: 2.2rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.5;
}

.divider {
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 3px;
  margin: 0 auto;
}

/* ==========================================================================
   Card Body
   ========================================================================== */
.card-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
}

.intro-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.student-name {
  text-align: center;
  font-size: 3.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1) 30%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 30px;
  line-height: 1.1;
}

/* Theme Banner */
.theme-banner {
  background: var(--card-inner-bg);
  border-left: 3px solid var(--accent-1);
  padding: 22px 28px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 32px;
}

.banner-label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.banner-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.presentation-details {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

/* Details Grid */
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.grid-card {
  background: var(--card-inner-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  transition: var(--transition);
  cursor: default;
}

.grid-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px var(--accent-glow);
}

.icon-wrapper {
  color: var(--accent-1);
  margin-bottom: 14px;
  display: inline-flex;
  padding: 10px;
  background: var(--accent-glow);
  border-radius: 50%;
}

.grid-card-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.grid-card-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Calendar Actions */
.calendar-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 44px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  color: var(--text-on-accent);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow-strong);
}

.btn-secondary {
  background: var(--card-inner-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 10px 20px;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}
.btn-ghost:hover {
  background: var(--card-inner-bg);
  color: var(--text-primary);
}

.w-full { width: 100%; }

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--section-divider), transparent);
  margin: 44px 0;
}

/* ==========================================================================
   Map & Address
   ========================================================================== */
.location-section, .rsvp-section { margin-bottom: 20px; }

.section-title {
  font-size: 2rem;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 28px;
}

.map-container-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: stretch;
}

.map-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 28px;
  background: var(--card-inner-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.map-detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.map-detail-item strong {
  font-size: 0.82rem;
  color: var(--accent-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.map-detail-item span {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.map-iframe-container {
  height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.map-iframe-container iframe {
  width: 100%; height: 100%;
  border: 0;
  transition: opacity 0.3s ease;
  opacity: 0.92;
}
.map-iframe-container:hover iframe { opacity: 1; }

:root[data-theme="dark"] .map-iframe-container iframe {
  filter: invert(90%) hue-rotate(180deg) opacity(0.8);
}
:root[data-theme="dark"] .map-iframe-container:hover iframe {
  filter: invert(90%) hue-rotate(180deg) opacity(1);
}

/* ==========================================================================
   RSVP Section – Fun & Casual
   ========================================================================== */
.rsvp-section {
  position: relative;
  text-align: center;
}

.rsvp-title {
  font-size: 2.2rem;
}

.rsvp-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: -14px;
  margin-bottom: 30px;
}

#rsvpForm {
  display: flex;
  justify-content: center;
}

/* Click badge that floats above the RSVP button */
.rsvp-btn-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.click-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  animation: clickBadgeFloat 2s ease-in-out infinite;
  cursor: pointer;
  position: relative;
  pointer-events: none; /* Allows clicks to pass through to the button */
}

.click-badge::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #f97316;
}


/* RSVP Button – Exciting, animated */
.btn-rsvp {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 33%, #ef4444 66%, #f59e0b 100%);
  background-size: 300% 100%;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 18px 44px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pulseRSVP 2.5s infinite ease-in-out, rsvpGradientSweep 6s linear infinite;
  font-family: var(--font-body);
}

.btn-rsvp:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 16px 50px rgba(245, 158, 11, 0.55);
  background-position: 100% 0;
}

.rsvp-btn-content {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
  position: relative;
}

.rsvp-emoji {
  font-size: 1.6rem;
  animation: wiggle 2s ease-in-out infinite;
}

.rsvp-arrow {
  font-size: 1.3rem;
  transition: transform 0.3s var(--ease-out);
}

.btn-rsvp:hover .rsvp-arrow {
  transform: translateX(6px);
}

/* Shine Effect */
.rsvp-btn-shine {
  position: absolute;
  top: 0; left: 0;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 3s infinite;
  z-index: 1;
}

/* Success State */
.rsvp-success {
  display: none;
  text-align: center;
  padding: 36px 30px;
  animation: fadeInUp 0.6s var(--ease-out) forwards;
}

.rsvp-success.active {
  display: block;
}

.success-celebration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.success-emoji-big {
  font-size: 4.5rem;
  animation: bounceIn 0.6s var(--ease-out) forwards;
}

.success-title {
  font-size: 1.8rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.success-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.card-footer {
  text-align: center;
  padding: 30px 40px;
  border-top: 1px solid var(--section-divider);
  margin-top: 40px;
}

.footer-contacts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 18px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}
.contact-link:hover {
  color: var(--accent-1);
  transform: translateY(-1px);
}

.copyright {
  font-size: 0.78rem;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-top: 14px;
}

/* ==========================================================================
   Balloon Celebration
   ========================================================================== */
.balloon-container-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 10000;
  overflow: hidden;
}

.balloon-particle {
  position: absolute;
  bottom: -150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform, opacity;
  animation: floatUp 5s linear forwards;
}

.balloon-shape {
  width: 48px; height: 60px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  position: relative;
  box-shadow: inset -4px -6px 12px rgba(0, 0, 0, 0.12),
              0 4px 10px rgba(0, 0, 0, 0.06);
}
.balloon-shape::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--balloon-knot-color);
}

.balloon-string {
  width: 1.5px; height: 70px;
  background: rgba(0, 0, 0, 0.12);
  transform-origin: top;
  animation: stringSway 1.5s ease-in-out infinite alternate;
}

.balloon-emoji {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.1));
  animation: emojiRotate 3s ease-in-out infinite alternate;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
  .map-container-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .envelope-wrapper { width: 380px; height: 250px; }
  .top-flap { border-width: 125px 190px 0; }
  .left-flap { border-width: 125px 0 125px 190px; }
  .right-flap { border-width: 125px 190px 125px 0; }
  .bottom-flap { border-width: 0 190px 125px; }
  .seal { width: 60px; height: 60px; }

  .hero-section {
    flex-direction: column;
    text-align: center;
    padding: 40px 24px 30px;
  }
  .hero-content { text-align: center; }
  .hero-photo { width: 130px; height: 130px; }
  .academic-title { font-size: 2rem; }
  .student-name { font-size: 2.6rem; }
  .details-grid { grid-template-columns: 1fr; gap: 12px; }
  .calendar-actions { flex-direction: column; align-items: stretch; }

  .envelope-wrapper.opened { width: 100%; margin: 0; }
  .card-body { padding: 30px 20px; }
  .app-header { padding: 14px 16px; }
  .logo { font-size: 1.2rem; }

  .btn-rsvp { font-size: 1.05rem; padding: 16px 32px; }

  .section-divider {
    margin: 20px 0;
  }
  .analyzer-section {
    margin: 24px 0 10px;
  }
  
  /* Mobile GPU perf: replace backdrop-filter with solid bg */
  .envelope-wrapper.opened .invitation-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--glass-bg);
  }
  
  /* Simplify hero ring animations on mobile */
  .hero-photo-ring,
  .hero-photo-ring::before {
    animation-duration: 4s;
  }
  
  /* Reduce box-shadow complexity during transitions */
  .envelope-wrapper.opened .invitation-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  }
}

@media (max-width: 480px) {
  .envelope-wrapper { width: 320px; height: 210px; }
  .top-flap { border-width: 105px 160px 0; }
  .left-flap { border-width: 105px 0 105px 160px; }
  .right-flap { border-width: 105px 160px 105px 0; }
  .bottom-flap { border-width: 0 160px 105px; }
  .hero-photo { width: 110px; height: 110px; }
  
  .generation-controls {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 6px;
  }
  .prompt-input {
    min-width: 0;
    font-size: 0.75rem;
    padding: 8px 10px;
  }
  .btn-generate {
    padding: 0 10px;
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .app-header { padding: 10px 12px; }
  .logo { font-size: 1.05rem; }
  .header-controls { gap: 6px; }
  .theme-toggle-btn, .sound-toggle-btn { width: 34px; height: 34px; }
  .lang-btn { padding: 5px 10px; font-size: 0.75rem; }
}

@media (max-width: 360px) {
  .envelope-wrapper { width: 280px; height: 185px; }
  .top-flap { border-width: 93px 140px 0; }
  .left-flap { border-width: 93px 0 93px 140px; }
  .right-flap { border-width: 93px 140px 93px 0; }
  .bottom-flap { border-width: 0 140px 93px; }
  .seal { width: 48px; height: 48px; }
  .seal-inner { top: 2px; left: 2px; right: 2px; bottom: 2px; }
  .hero-photo { width: 90px; height: 90px; }
  .academic-title { font-size: 1.5rem; }
  .student-name { font-size: 2.1rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   AI 3D Analyzer
   ========================================================================== */
.analyzer-section {
  margin: 44px 0 20px;
  text-align: center;
}
.analyzer-section-title {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
  width: 100%;
}
.analyzer-title-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.analyzer-title-text .lang-fr,
.analyzer-title-text .lang-en {
  background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.analyzer-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.analyzer-container {
  display: flex;
  gap: 0px;
  align-items: stretch;
  text-align: left;
  margin: 0 auto;
  max-width: 860px;
  transition: gap 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.analyzer-container.show-console {
  gap: 24px;
}
.analyzer-viewer {
  width: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  height: 320px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.analyzer-container.show-console .analyzer-viewer {
  width: 53%;
}
:root[data-theme="light"] .analyzer-viewer {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(79, 70, 229, 0.15);
  box-shadow: inset 0 0 20px rgba(79, 70, 229, 0.05);
}

:root[data-theme="light"] .viewer-badge {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(79, 70, 229, 0.15);
  color: #059669;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .viewer-badge.scanning {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.3);
}

:root[data-theme="light"] .hologram-placeholder {
  color: rgba(79, 70, 229, 0.6);
}

:root[data-theme="light"] .prompt-input {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(79, 70, 229, 0.15);
  color: #0284c7;
}

:root[data-theme="light"] .prompt-input:focus {
  background: #ffffff;
  border-color: rgba(79, 70, 229, 0.3);
}

:root[data-theme="light"] .analysis-report {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.08), 0 0 15px rgba(16, 185, 129, 0.1);
}

:root[data-theme="light"] .report-title {
  color: #475569;
}

:root[data-theme="light"] .report-status-badge {
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
}

:root[data-theme="light"] .report-item-label {
  color: #475569;
}

:root[data-theme="light"] .status-pass {
  color: #059669;
}

:root[data-theme="light"] .status-warn {
  color: #b45309;
}
#canvas3d {
  width: 100%;
  height: 100%;
  display: block;
}
.viewer-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.scanner-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, #818cf8 30%, #4f46e5 50%, #818cf8 70%, transparent);
  box-shadow: 0 0 15px var(--accent-1), 0 0 25px var(--accent-2);
  opacity: 0;
  pointer-events: none;
}
.scanner-bar.scanning {
  animation: scanLaserVertical 2.2s linear infinite;
  opacity: 1;
}
@keyframes scanLaserVertical {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}
.viewer-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #10b981;
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  z-index: 6;
  backdrop-filter: blur(4px);
}
.viewer-badge.scanning {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  animation: pulseText 1.5s infinite;
}
.analyzer-console {
  width: 0%;
  opacity: 0;
  pointer-events: none;
  background: #090d16;
  border: 0px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 320px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transform: translateX(40px);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              border-width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.analyzer-container.show-console .analyzer-console {
  width: 47%;
  opacity: 1;
  pointer-events: auto;
  border-width: 1px;
  transform: translateX(0);
}
:root[data-theme="light"] .analyzer-console {
  background: #f8fafc;
  border-color: rgba(79, 70, 229, 0.15);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.05);
}

:root[data-theme="light"] .console-header {
  background: #f1f5f9;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .console-title {
  color: #475569;
}

:root[data-theme="light"] .console-body {
  color: #0284c7;
}

:root[data-theme="light"] .console-body::-webkit-scrollbar-thumb {
  background: rgba(79, 70, 229, 0.12);
}

:root[data-theme="light"] .console-line.line-dim { color: #64748b; }
:root[data-theme="light"] .console-line.line-warn { color: #b45309; }
:root[data-theme="light"] .console-line.line-success { color: #059669; }
:root[data-theme="light"] .console-line.line-info { color: #0284c7; }
:root[data-theme="light"] .console-line.line-accent { color: #6d28d9; }

:root[data-theme="light"] .console-footer {
  background: #f1f5f9;
  border-top-color: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .score-card {
  background: rgba(79, 70, 229, 0.03);
  border-color: rgba(79, 70, 229, 0.12);
}

:root[data-theme="light"] .score-label {
  color: #475569;
}

:root[data-theme="light"] .score-value {
  color: #b45309;
}

:root[data-theme="light"] .score-value.high-score {
  color: #059669;
  text-shadow: 0 0 10px rgba(5, 150, 105, 0.2);
}
.console-header {
  background: #111827;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.console-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }
.console-title {
  font-family: monospace;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 10px;
  font-weight: 600;
}
.console-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #38bdf8;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.console-body::-webkit-scrollbar {
  width: 6px;
}
.console-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.console-line {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.console-line.line-dim { color: #64748b; }
.console-line.line-warn { color: #fbbf24; }
.console-line.line-success { color: #10b981; }
.console-line.line-info { color: #38bdf8; }
.console-line.line-accent { color: #a78bfa; }
.console-footer {
  background: #111827;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.btn-scan {
  flex: 1;
  padding: 8px 14px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  height: 36px;
  line-height: 1;
}
.score-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  height: 36px;
  justify-content: center;
}
.score-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
  line-height: 1.1;
}
.score-value {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #fbbf24;
  line-height: 1.1;
}
.score-value.high-score {
  color: #10b981;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}


@media (max-width: 768px) {
  .analyzer-container {
    flex-direction: column;
    gap: 0px;
  }
  .analyzer-container.show-console {
    gap: 16px;
  }
  .analyzer-viewer {
    width: 100% !important;
  }
  .analyzer-console {
    width: 100% !important;
    height: 0px;
    transform: translateY(40px) !important;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .analyzer-container.show-console .analyzer-console {
    height: 280px;
    transform: translateY(0) !important;
  }
}

/* Button attention animations */
@keyframes pulseGenerateBtn {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5); }
}
.btn-generate.attention-pulse {
  animation: pulseGenerateBtn 2s infinite ease-in-out;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}
.btn-generate.attention-pulse .gen-arrow {
  display: inline-block;
  animation: arrowBounce 1s infinite ease-in-out;
}
.gen-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
  margin-left: 6px;
}
.btn-generate:hover .gen-arrow {
  transform: translateX(4px);
}

@keyframes pulseScanBtn {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px var(--accent-2); }
  50% { transform: scale(1.04); box-shadow: 0 0 25px var(--accent-1); }
}
.btn-scan.click-me-pulse {
  animation: pulseScanBtn 1.8s infinite ease-in-out;
}

/* Hologram grid placeholder styles */
.hologram-placeholder {
  position: absolute;
  top: 42%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(129, 140, 248, 0.42);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  text-align: center;
}
.hologram-grid-icon {
  animation: hologramFloat 3.2s ease-in-out infinite;
}
.hologram-text {
  font-family: monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@keyframes hologramFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.45; }
  50% { transform: translateY(-8px) rotate(3deg); opacity: 0.8; }
}

/* Generation Controls panel at bottom of viewer */
.generation-controls {
  position: absolute;
  bottom: 14px; left: 14px; right: 14px;
  display: flex;
  gap: 8px;
  z-index: 15;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: auto;
}
.prompt-input {
  flex: 1;
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 8px 12px;
  outline: none;
  transition: var(--transition);
}
.prompt-input:focus {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(9, 13, 22, 0.9);
}
.btn-generate {
  background: linear-gradient(135deg, var(--accent-3) 0%, #ea580c 100%);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.btn-generate:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.38);
}
.btn-generate:active {
  transform: translateY(0);
}
.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Analysis Report Panel Styles (Horizontal bottom status bar) */
.analysis-report {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.15);
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.analysis-report.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.report-header-horizontal {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-title {
  font-family: monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
}
.report-status-badge {
  font-family: monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}
.report-row-horizontal {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.report-item-horizontal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-size: 0.7rem;
}
.report-item-label {
  color: #64748b;
}
.report-item-status {
  font-weight: 600;
}
.status-pass {
  color: #10b981;
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}
.status-warn {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
}

@media (max-width: 480px) {
  .analysis-report {
    padding: 6px 12px;
    gap: 6px;
    bottom: 8px; left: 8px; right: 8px;
  }
  .report-row-horizontal {
    gap: 8px;
  }
  .report-item-horizontal {
    font-size: 0.62rem;
  }
}

@keyframes pulseText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Animated Success Checkmark */
.success-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkmark-svg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  animation: scaleSuccess 0.3s ease-in-out 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: #10b981;
  fill: none;
  animation: strokeKey 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards, fillSuccessDark 0.4s ease-in-out 0.4s forwards;
}
:root[data-theme="light"] .checkmark-circle {
  stroke: #059669;
  animation: strokeKey 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards, fillSuccessLight 0.4s ease-in-out 0.4s forwards;
}
.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: #ffffff;
  fill: none;
  animation: strokeKey 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes strokeKey {
  100% { stroke-dashoffset: 0; }
}
@keyframes scaleSuccess {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fillSuccessDark {
  100% { fill: #10b981; }
}
@keyframes fillSuccessLight {
  100% { fill: #059669; }
}

/* Animated Spinner for loading states */
.btn-spinner {
  animation: spinLoader 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.btn-spinner circle {
  stroke: currentColor;
  stroke-linecap: round;
}
@keyframes spinLoader {
  100% { transform: rotate(360deg); }
}
