/*
 * Chat Interface Styles
 * Modern glassmorphic design with refined typography
 */

/* Smooth scroll for anchor navigation */
html {
  scroll-behavior: smooth;
}

/* Typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remove tap highlights on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Message content typography */
[data-message-content] {
  font-size: 0.875rem; /* 14px */
  line-height: 1.6;
}

/* Smooth scrolling for messages */
.chat-messages {
  scroll-behavior: smooth;
}

/* Message bubble transitions */
.message-group {
  animation: fadeIn 0.4s ease-out;
}

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

/* Online pulse animation */
@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.online-pulse::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Action hints */
.action-hint {
  transition: all 0.15s ease;
  cursor: pointer;
}

.action-hint:hover {
  color: #7c3aed;
  transform: translateY(-1px);
}

/* Trust badges */
.trust-badge {
  transition: all 0.15s ease;
  opacity: 0.6;
  cursor: help;
}

.trust-badge:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Links */
.link {
  transition: all 0.15s ease;
}

.link:hover {
  color: #059669;
}

/* Glassmorphic input */
.glass-input {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

/* Input focus states */
input:focus {
  outline: none;
}

/* Button hover states */
button {
  transition: all 0.15s ease;
}

button:hover {
  transform: scale(1.05);
}

button:active {
  transform: scale(0.98);
}

/* Pricing cards */
.pricing-card {
  transition: all 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Waitlist counter pulse animation (triggered on update) */
@keyframes waitlist-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

#waitlistCount {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Turbo applies this class automatically when frame updates */
turbo-frame[id="waitlist_counter"] {
  animation: waitlist-pulse 0.6s ease-out;
}

/* ===== Expandable Item Animations ===== */

/* Expand animation - slide down with fade in */
@keyframes expandIn {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-8px);
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
  }
}

.animate-expand {
  animation: expandIn 0.25s ease-out forwards;
  overflow: hidden;
}

/* Collapse animation - slide up with fade out */
@keyframes collapseOut {
  from {
    opacity: 1;
    max-height: 500px;
  }
  to {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
  }
}

.animate-collapse {
  animation: collapseOut 0.2s ease-out forwards;
  overflow: hidden;
}

/* Slide out animation - for delete */
@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
  }
  to {
    opacity: 0;
    transform: translateX(100%);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

.animate-slide-out {
  animation: slideOutRight 0.3s ease-out forwards;
  pointer-events: none;
}

/* Subtle shake animation - for delete confirmation */
@keyframes subtleShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.animate-shake {
  animation: subtleShake 0.4s ease-out;
}

/* Slide in animation - for new items */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
  }
}

.animate-slide-in {
  animation: slideInFromTop 0.3s ease-out forwards;
}

/* Expandable item base styles */
.expandable-item {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.expandable-item:hover {
  transform: translateY(-1px);
}

/* Mobile touch feedback */
@media (max-width: 640px) {
  .expandable-item:active {
    transform: scale(0.98);
    background: rgba(0, 0, 0, 0.02);
  }
}
