/* =========================================================
   ROMANTIC 3D INTERACTIVE PARTICLE & GLB EXPERIENCE - STYLES
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Armenian:wght@300;400;500;600;700&family=Noto+Serif+Armenian:wght@400;600;700&family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

:root {
  --font-heading: 'Noto Serif Armenian', 'Playfair Display', Georgia, serif;
  --font-body: 'Noto Sans Armenian', 'Outfit', system-ui, -apple-system, sans-serif;

  /* Color System */
  --bg-dark: #050713;
  --primary-pink: #ff4d88;
  --primary-pink-glow: rgba(255, 77, 136, 0.45);
  --primary-cyan: #38bdf8;
  --primary-cyan-glow: rgba(56, 189, 248, 0.4);
  --primary-purple: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-main);
  user-select: none;
}

/* Three.js 3D WebGL Canvas Layer */
#webglCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  outline: none;
  cursor: grab;
  touch-action: none;
}

#webglCanvas:active {
  cursor: grabbing;
}

/* Background Ambient Lighting & Natural Edge Vignette */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: 
    linear-gradient(to right, rgba(5, 7, 19, 0.9) 0%, transparent 12%, transparent 88%, rgba(5, 7, 19, 0.9) 100%),
    linear-gradient(to bottom, rgba(5, 7, 19, 0.9) 0%, transparent 12%, transparent 88%, rgba(5, 7, 19, 0.9) 100%),
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.05) 0%, transparent 65%);
}

/* Top Floating Actions & Controls */
.top-controls {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  background: rgba(13, 18, 38, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(56, 189, 248, 0.15);
  transition: var(--transition-fast);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
  box-shadow: 
    0 10px 28px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(255, 77, 136, 0.5);
}

.control-btn:active {
  transform: scale(0.95);
}

/* Palette Picker Dropdown */
.palette-picker {
  position: relative;
}

.palette-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: rgba(13, 18, 38, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 185px;
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(56, 189, 248, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}

.palette-dropdown.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  width: 100%;
}

.palette-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.palette-item.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-weight: 600;
}

.palette-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  flex-shrink: 0;
}

/* Active 3D Model Floating Toolbar */
.model-toolbar {
  position: fixed;
  top: 22px;
  left: 22px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(13, 18, 38, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(56, 189, 248, 0.2);
  animation: fadeIn 0.4s ease;
}

.model-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-pink);
  margin-right: 4px;
  letter-spacing: 0.3px;
}

.model-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.model-action-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}

.model-action-btn.active {
  background: rgba(56, 189, 248, 0.3);
  border-color: var(--primary-cyan);
  color: #ffffff;
}

.model-action-btn.remove-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: #ef4444;
}

/* Drag & Drop Indicator Overlay */
.drag-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 19, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.drag-drop-box {
  width: 100%;
  max-width: 500px;
  padding: 48px 32px;
  border: 2px dashed rgba(56, 189, 248, 0.7);
  border-radius: var(--radius-lg);
  background: rgba(13, 18, 38, 0.6);
  text-align: center;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(56, 189, 248, 0.3);
  animation: pulseBox 2s infinite alternate ease-in-out;
}

@keyframes pulseBox {
  0% { border-color: rgba(56, 189, 248, 0.5); transform: scale(0.98); }
  100% { border-color: rgba(255, 77, 136, 0.9); transform: scale(1.02); }
}

.drag-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.drag-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.drag-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Toast Feedback Message */
.toast-msg {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 90;
  padding: 10px 22px;
  background: rgba(13, 18, 38, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(56, 189, 248, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-msg.success {
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 25px rgba(52, 211, 153, 0.4);
}

.toast-msg.error {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
}

/* Bottom Subtle Interactive Hint */
.bottom-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  animation: hintFloat 3.5s ease-in-out infinite alternate;
}

.hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(13, 18, 38, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  font-size: 0.84rem;
  font-weight: 400;
  color: rgba(248, 250, 252, 0.85);
  letter-spacing: 0.3px;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(56, 189, 248, 0.15);
}

.sparkle-icon {
  font-size: 0.95rem;
  color: var(--primary-pink);
  animation: sparkleTwinkle 2s infinite ease-in-out;
}

@keyframes hintFloat {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-6px); }
}

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

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

@media (max-width: 600px) {
  .top-controls {
    top: 16px;
    right: 16px;
    gap: 8px;
  }
  .control-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .model-toolbar {
    top: 16px;
    left: 16px;
  }
  .hint-pill {
    padding: 7px 14px;
    font-size: 0.75rem;
    max-width: 90vw;
    text-align: center;
  }
}
