/* Lunar Theme CSS for MoonChange */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

* {
  scroll-behavior: smooth;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Lunar Background */
.lunar-theme {
  background: linear-gradient(135deg, #0a0e27 0%, #1a0b2e 25%, #16003b 50%, #0f0524 75%, #0a0e27 100%);
  background-size: 400% 400%;
  animation: lunarGradient 15s ease infinite;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

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

/* Animated Stars Background */
.stars, .twinkling {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.stars {
  background: #000 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXA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HJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEMwMzI0NkU5QjA2MTFFMjlBQUM4QTBCNkQ1MDhBQTgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEMwMzI0NkY5QjA2MTFFMjlBQUM4QTBCNkQ1MDhBQTgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4QzAzMjQ2QzlCMDYxMUUyOUFBQzhBMEI2RDUwOEFBOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4QzAzMjQ2RDlCMDYxMUUyOUFBQzhBMEI2RDUwOEFBOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvKRW+8AAAAPSURBVHjaYvj//z8DQIABAAj8Av7bok0WAAAAAElFTkSuQmCC) repeat;
  animation: twinkling 100s linear infinite;
}

@keyframes stars {
  from { transform: translateY(0); }
  to { transform: translateY(-2000px); }
}

@keyframes twinkling {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Glass Morphism */
.glass-morphism {
  background: rgba(26, 11, 46, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.glass-card {
  background: linear-gradient(135deg, rgba(26, 11, 46, 0.8) 0%, rgba(22, 0, 59, 0.7) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 20px 60px rgba(138, 43, 226, 0.3);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #fbbf24 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
  background-size: 200% 200%;
  /* Fix for letter rendering issues */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* Moon Button */
.moon-button {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.5);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.moon-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(168, 85, 247, 0.7);
}

.moon-button:active {
  transform: translateY(-1px);
}

.moon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.moon-button:hover::before {
  left: 100%;
}

/* Glass Button */
.glass-button {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.glass-button:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
}

/* Lunar Inputs */
.lunar-input, .lunar-select, .moon-input {
  background: rgba(15, 5, 36, 0.8);
  border: 2px solid rgba(168, 85, 247, 0.3);
  color: white;
  transition: all 0.3s ease;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
}

.lunar-input:focus, .lunar-select:focus, .moon-input:focus {
  border-color: rgba(168, 85, 247, 0.8);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
  outline: none;
}

.lunar-select option, .moon-input option {
  background: #16003b;
  color: white;
}

/* Input Placeholder */
.lunar-input::placeholder, .moon-input::placeholder {
  color: rgba(168, 85, 247, 0.5);
  opacity: 1;
}

/* Error Message */
.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.error-message.hidden {
  display: none;
}

/* Rate Display */
.rate-display {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.3);
  backdrop-filter: blur(10px);
}

/* Live Indicator */
.live-indicator {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px #10b981;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Moon Icon Animation */
.moon-icon {
  animation: float 3s ease-in-out infinite;
}

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

/* Hover Glow Effect */
.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.6), 0 0 80px rgba(236, 72, 153, 0.4);
  transform: translateY(-5px) scale(1.02);
}

/* Table Styles */
table tbody tr {
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  transition: all 0.3s ease;
}

table tbody tr:hover {
  background: rgba(168, 85, 247, 0.1);
  transform: translateX(5px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 5, 36, 0.5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-radius: 10px;
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #9333ea, #db2777);
}

/* Hero Section Animation */
.hero-section {
  animation: fadeInUp 1s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
  .gradient-text {
    font-size: 2rem;
  }
  
  table {
    font-size: 0.875rem;
  }
  
  th, td {
    padding: 0.75rem 0.5rem;
  }
  
  .glass-card {
    padding: 1.5rem;
  }
  
  /* Hero section */
  h1.text-6xl {
    font-size: 2.5rem !important;
  }
  
  h2.text-4xl {
    font-size: 2rem !important;
  }
  
  h3.text-3xl {
    font-size: 1.75rem !important;
  }
  
  /* Form inputs */
  .lunar-input, .lunar-select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Buttons */
  .moon-button, .glass-button {
    padding: 1rem;
    font-size: 1rem;
  }
  
  /* QR Code container */
  #qrcode canvas {
    max-width: 200px;
    height: auto !important;
  }
  
  /* Modal */
  .glass-card.rounded-3xl {
    margin: 1rem;
    padding: 2rem;
  }
  
  /* Order confirmation page */
  .text-5xl {
    font-size: 2rem !important;
  }
  
  .text-2xl {
    font-size: 1.25rem !important;
  }
}

@media (max-width: 480px) {
  /* Extra small devices */
  .glass-card {
    padding: 1rem;
  }
  
  h1.text-6xl {
    font-size: 2rem !important;
  }
  
  .review-card {
    min-width: 90vw;
  }
  
  /* Table scrollable on small screens */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Mobile navigation */
  nav .flex.items-center.space-x-4 {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
  }
  
  nav a.glass-button,
  nav button.glass-button {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
  }
  
  nav a.glass-button span,
  nav button.glass-button span {
    display: none;
  }
  
  nav a.glass-button i,
  nav button.glass-button i {
    margin-right: 0 !important;
    font-size: 1rem;
  }
  
  /* Logo text smaller */
  .gradient-text {
    font-size: 1.5rem !important;
  }
  
  nav .text-xs {
    font-size: 0.6rem !important;
  }
}

/* Animation delays for staggered effect */
.glass-card:nth-child(1) {
  animation: fadeInUp 0.6s ease-out;
}

.glass-card:nth-child(2) {
  animation: fadeInUp 0.8s ease-out;
}

.glass-card:nth-child(3) {
  animation: fadeInUp 1s ease-out;
}

/* Spin animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* Change indicator colors */
.change-positive {
  color: #10b981;
}

.change-negative {
  color: #ef4444;
}

/* Loading state */
.loading-shimmer {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0.3) 50%, rgba(168, 85, 247, 0.1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* Hourglass Animation - DEPRECATED, use hourglass-flip instead */
.hourglass-animate {
  display: inline-block;
  animation: hourglassSpin 3s ease-in-out infinite;
}

@keyframes hourglassSpin {
  0%, 100% { 
    transform: rotate(0deg) scale(1);
  }
  25% { 
    transform: rotate(0deg) scale(1.1);
  }
  50% { 
    transform: rotate(180deg) scale(1);
  }
  75% { 
    transform: rotate(180deg) scale(1.1);
  }
}

/* Clock Swing Animation */
.clock-swing {
  display: inline-block;
  animation: clockSwing 2s ease-in-out infinite;
  transform-origin: center top;
}

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

/* Gentle Float Animation for Icons */
.icon-float {
  display: inline-block;
  animation: iconFloat 3s ease-in-out infinite;
}

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

/* Pulse Glow Animation */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
  }
  50% { 
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.6), 0 0 40px rgba(236, 72, 153, 0.4);
  }
}

/* Modal Animation */
.modal-slide-in {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Check mark click animation */
.check-click {
  display: inline-block;
  animation: checkClick 0.6s ease-in-out infinite;
}

@keyframes checkClick {
  0%, 100% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.2);
  }
}

/* Clock hand rotation */
.clock-rotate {
  display: inline-block;
  animation: clockRotate 4s linear infinite;
}

@keyframes clockRotate {
  from { 
    transform: rotate(0deg);
  }
  to { 
    transform: rotate(360deg);
  }
}

/* Light bulb blink */
.bulb-blink {
  display: inline-block;
  animation: bulbBlink 1.5s ease-in-out infinite;
}

@keyframes bulbBlink {
  0%, 100% { 
    opacity: 1;
    filter: brightness(1);
  }
  50% { 
    opacity: 0.3;
    filter: brightness(0.5);
  }
}

/* Hourglass flip only (not text) */
.hourglass-flip {
  display: inline-block;
  animation: hourglassFlip 3s ease-in-out infinite;
}

@keyframes hourglassFlip {
  0%, 45%, 100% { 
    transform: rotate(0deg);
  }
  50%, 95% { 
    transform: rotate(180deg);
  }
}

/* Reviews Carousel Animation */
.reviews-carousel {
  display: flex;
  overflow: hidden;
  position: relative;
  gap: 1.5rem;
}

.reviews-track {
  display: flex;
  gap: 1.5rem;
  animation: scrollReviews 60s linear infinite;
  will-change: transform;
}

.reviews-track:hover {
  animation-play-state: paused;
}

@keyframes scrollReviews {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.review-card {
  min-width: 350px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .review-card {
    min-width: 280px;
  }
  
  /* Navigation improvements for mobile */
  nav .flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  nav a, nav button {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem !important;
  }
  
  /* Container padding for mobile */
  .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Currency selector cards on mobile */
  .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  
  .grid.grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* Amount input larger on mobile */
  input[type="number"],
  input[type="text"] {
    font-size: 16px !important; /* Prevents iOS zoom */
    padding: 0.875rem !important;
  }
  
  /* Select dropdowns */
  select {
    font-size: 16px !important;
    padding: 0.875rem !important;
  }
  
  /* Crypto address display */
  .break-all {
    font-size: 0.75rem;
    word-break: break-all;
  }
  
  /* Stats cards responsive */
  .grid.gap-6 {
    gap: 1rem;
  }
  
  /* Logo and title */
  .text-3xl {
    font-size: 1.5rem !important;
  }
  
  /* Mobile menu spacing */
  .h-20 {
    height: auto !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* Ultra small devices (< 360px) */
@media (max-width: 360px) {
  .glass-card {
    padding: 0.75rem !important;
  }
  
  h1 {
    font-size: 1.5rem !important;
  }
  
  .moon-button {
    font-size: 0.875rem;
    padding: 0.75rem !important;
  }
  
  /* Stack currency selector vertically */
  .grid {
    grid-template-columns: 1fr !important;
  }
}

/* Landscape mode for mobile */
@media (max-width: 896px) and (orientation: landscape) {
  .hero-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  h1 {
    font-size: 2rem !important;
  }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  button,
  a,
  input,
  select {
    min-height: 44px; /* iOS recommended tap target */
    min-width: 44px;
  }
  
  /* Larger click area for links */
  nav a {
    padding: 1rem !important;
  }
}
