/* Messaging Design System Styles - Mobile First */

/* Custom Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-fadeInUp {
  animation: fadeInUp 0.5s ease-out;
}

.animate-pulse-glow {
  animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .animate-fadeInUp,
  .animate-pulse-glow,
  .animate-pulse {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .bg-gradient-to-br {
    background: var(--bg-color, #ffffff) !important;
  }

  .text-transparent {
    color: var(--text-color, #000000) !important;
  }

  .border-gray-200 {
    border-color: #000000 !important;
  }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  /* Ensure touch targets are at least 44px (iOS) / 48px (Android) */
  button,
  a,
  input[type="submit"],
  input[type="button"],
  select {
    min-height: 44px;
    min-width: 44px;
  }

  /* Increase spacing between touch targets */
  .flex.gap-2 > * + * {
    margin-left: 0.75rem;
  }

  /* Optimize form inputs for mobile */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Glassmorphism Effects */
.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(to right, #2563eb, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Status Badge Animations */
.status-badge {
  position: relative;
}

.status-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, currentColor, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.3;
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

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

/* Message Status Indicators */
.message-status-sent {
  color: #3b82f6;
}

.message-status-delivered {
  color: #10b981;
}

.message-status-read {
  color: #059669;
}

.message-status-failed {
  color: #ef4444;
}

.message-status-pending {
  color: #6b7280;
}

/* Health Status Pulse */
.health-status-healthy {
  animation: pulse-glow 2s ease-in-out infinite;
}

.health-status-degraded {
  animation: pulse-glow 1s ease-in-out infinite;
}

.health-status-unhealthy {
  animation: pulse-glow 0.5s ease-in-out infinite;
}

/* Safe Area Padding for Notched Devices */
@supports (padding: max(0px)) {
  .pb-safe {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .pt-safe {
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .px-safe {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* Bottom Sheet Modal (Mobile) */
@media (max-width: 640px) {
  .bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    border-radius: 1.5rem 1.5rem 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
  }

  .bottom-sheet.open {
    transform: translateY(0);
  }
}

/* Focus States for Accessibility */
.focus-ring:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.focus-ring:focus:not(:focus-visible) {
  outline: none;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  .print-break {
    page-break-after: always;
  }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here */
  /* Currently using light mode only as per design system */
}

