/* ==================== BASE ==================== */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ==================== SCROLLBAR ==================== */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ==================== AI ROBOT ANIMATIONS ==================== */
@keyframes robot-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3), inset 0 0 20px rgba(6, 182, 212, 0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.5), inset 0 0 30px rgba(6, 182, 212, 0.2);
    transform: scale(1.02);
  }
}

@keyframes robot-eye-blink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

@keyframes robot-eye-scan {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

@keyframes robot-mouth-speak {
  0%, 100% { width: 32px; height: 4px; }
  50% { width: 24px; height: 8px; border-radius: 4px; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes reverse-spin {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

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

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

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

@keyframes thinking-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-2deg); }
  75% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes data-stream {
  0% { transform: translateY(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

@keyframes circuit-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes slide-in {
  0% { opacity: 0; transform: scale(0.95) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes card-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(0.5deg); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes slide-down {
  0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-slide-down {
  animation: slide-down 0.3s ease-out;
}

/* Robot avatar styles */
.ai-robot-pulse {
  animation: robot-pulse 3s ease-in-out infinite;
}

.robot-eye-left,
.robot-eye-right {
  animation: robot-eye-blink 4s ease-in-out infinite;
}

.robot-eye-left {
  animation-delay: 0s;
}

.robot-eye-right {
  animation-delay: 0.1s;
}

.ai-thinking .robot-eye-left,
.ai-thinking .robot-eye-right {
  animation: robot-eye-scan 0.5s ease-in-out infinite;
}

.ai-thinking .robot-mouth {
  animation: robot-mouth-speak 0.3s ease-in-out infinite;
}

.ai-thinking #ai-avatar {
  animation: thinking-bounce 0.6s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

.animate-reverse-spin {
  animation: reverse-spin 12s linear infinite;
}

/* ==================== STORY SLIDES ==================== */
#story-slide {
  animation: slide-in 0.4s ease-out;
}

#story-slide > div {
  animation: card-float 6s ease-in-out infinite;
}

/* Story content blocks */
.story-block {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.story-block:hover {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.15);
}

/* Gradient text for story titles */
.story-gradient-text {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: border-flow 4s ease infinite;
}

/* Story KPI cards */
.story-kpi-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.3);
  position: relative;
  overflow: hidden;
}

.story-kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer 3s infinite;
}

/* Number badges in stories */
.story-number-badge {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

/* ==================== TINDER CARDS ==================== */
.tinder-card {
  transition: transform 0.1s linear, box-shadow 0.3s ease;
  touch-action: none;
  user-select: none;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(6, 182, 212, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  height: calc(100% - 80px);
  max-height: 700px;
}

.tinder-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  padding: 1px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), transparent, rgba(249, 115, 22, 0.3));
  -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;
}

.tinder-card.swiped-left {
  transform: translateX(-150%) rotate(-20deg);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.tinder-card.swiped-right {
  transform: translateX(150%) rotate(20deg);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

/* Full-page card content */
.tinder-card > div {
  height: 100%;
}

/* AI Stories container */
#tab-stories {
  height: 100%;
}

#tinder-container {
  height: calc(100% - 60px);
}

/* ==================== STORY PROGRESS ==================== */
.story-segment {
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  flex: 1;
}

.story-segment-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #f97316);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* ==================== MESSAGE BUBBLES ==================== */
.message-bubble-user {
  background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
  color: white;
  border-radius: 1.25rem;
  border-bottom-right-radius: 0.25rem;
  box-shadow: 0 4px 15px rgba(8, 145, 178, 0.3);
}

.message-bubble-ai {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.8));
  color: #e2e8f0;
  border-radius: 1.25rem;
  border-top-left-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== TAB TRANSITIONS ==================== */
.tab-page {
  transition: opacity 0.3s ease;
}

/* ==================== NAV BUTTONS ==================== */
.nav-btn {
  transition: all 0.3s ease;
}

.nav-btn:hover {
  transform: translateY(-1px);
}

/* ==================== STORY RING ==================== */
.story-ring {
  background: linear-gradient(45deg, #06b6d4, #3b82f6, #f97316, #ef4444);
  background-size: 300% 300%;
  animation: border-flow 3s ease infinite;
}

/* ==================== ASSIGN USER ITEM ==================== */
.assign-user-item {
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.assign-user-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(6, 182, 212, 0.3);
}

.assign-user-item.selected {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border-color: #06b6d4;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* ==================== INSIGHT CARDS ==================== */
#insights-grid > div {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

#insights-grid > div:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -10px rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.3);
}

/* ==================== VOICE WAVES ==================== */
@keyframes voice-wave {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.voice-bar {
  animation: voice-wave 0.8s ease-in-out infinite;
  transform-origin: bottom;
}

.recording #voice-waves {
  opacity: 1 !important;
}

.recording .voice-bar {
  animation-play-state: running;
}

/* ==================== MODAL ANIMATIONS ==================== */
#insight-modal {
  transition: opacity 0.3s ease;
}

#insight-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

#insight-modal:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

#insight-modal-content {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#insight-modal:not(.hidden) #insight-modal-content {
  transform: translateY(0) !important;
}

/* ==================== KEYWORDS TAGS ==================== */
#modal-keywords span {
  transition: all 0.2s ease;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.3);
}

#modal-keywords span:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* ==================== ATTACHMENTS ==================== */
#modal-attachments-list img,
#modal-attachments-list div {
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#modal-attachments-list img:hover,
#modal-attachments-list div:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-color: rgba(6, 182, 212, 0.5);
}

/* ==================== INPUT FOCUS ==================== */
input:focus, textarea:focus {
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3);
}

/* ==================== BUTTON PRESS ==================== */
button:active {
  transform: scale(0.98);
}

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
  background: linear-gradient(135deg, #06b6d4, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== GLASS EFFECT ==================== */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== LOADING SHIMMER ==================== */
.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ==================== PULSE DOT ==================== */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.animate-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ==================== SMOOTH SCROLL ==================== */
html {
  scroll-behavior: smooth;
}

/* ==================== SELECTION ==================== */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: white;
}

/* ==================== PLACEHOLDER ==================== */
::placeholder {
  color: rgba(156, 163, 175, 0.6);
}

/* ==================== DISABLED STATE ==================== */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== FOCUS VISIBLE ==================== */
:focus-visible {
  outline: 2px solid rgba(6, 182, 212, 0.5);
  outline-offset: 2px;
}

/* ==================== TRUNCATE ==================== */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== MIN WIDTH ==================== */
.min-w-0 {
  min-width: 0;
}

/* ==================== LINE CLAMP ==================== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== AVATAR ANIMATION ==================== */
#story-slide img {
  transition: all 0.3s ease;
}

#story-slide img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
}

/* ==================== CHART ANIMATIONS ==================== */
.tinder-card svg {
  animation: slide-in 0.5s ease-out;
}

/* ==================== NOTIFICATION ==================== */
.animate-slide-down {
  animation: slide-down 0.3s ease-out;
}
