/* NomadPersia Custom Styles */

/* Custom Tailwind Configuration */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom CSS Variables */
:root {
  --primary-blue: #2563eb;
  --primary-purple: #7c3aed;
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-secondary: linear-gradient(135deg, #1e40af 0%, #6d28d9 100%);
  --shadow-primary: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
  --border-radius: 0.75rem;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
.dark {
  --primary-blue: #3b82f6;
  --primary-purple: #8b5cf6;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

/* Typography */
.font-display {
  font-family: 'Playfair Display', serif;
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom Components */
@layer components {
  /* Navigation Styles */
  .nav-link {
    @apply relative text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-300;
  }
  
  .nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
  }
  
  .nav-link:hover::after,
  .nav-link.active::after {
    width: 100%;
  }
  
  .mobile-nav-link {
    @apply text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors duration-300;
  }

  /* Button Styles */
  .cta-primary {
    @apply relative overflow-hidden;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary);
    transition: var(--transition-smooth);
  }
  
  .cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
  }
  
  .cta-primary:hover::before {
    left: 100%;
  }
  
  .cta-secondary {
    @apply transition-all duration-300;
    backdrop-filter: blur(10px);
  }
  
  .cta-secondary:hover {
    box-shadow: var(--shadow-hover);
  }

  /* Card Styles */
  .about-card,
  .service-card,
  .benefit-card,
  .investor-card {
    @apply transition-all duration-300;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .about-card:hover,
  .service-card:hover,
  .benefit-card:hover,
  .investor-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
  }

  /* Comparison Table */
  .comparison-table {
    @apply transition-all duration-300;
  }
  
  .comparison-table th {
    @apply text-white font-semibold;
    background: var(--gradient-primary);
  }
  
  .comparison-table tr:hover {
    @apply bg-gray-50 dark:bg-gray-800;
    transform: scale(1.01);
    transition: var(--transition-smooth);
  }

  /* Process Timeline */
  .process-step {
    @apply opacity-0 transform translate-y-8;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .process-step.animate {
    @apply opacity-100 transform translate-y-0;
  }

  /* Hero Section */
  .hero-content {
    @apply opacity-0 transform translate-y-12;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .hero-content.animate {
    @apply opacity-100 transform translate-y-0;
  }

  /* Section Animations */
  .section-animate {
    @apply opacity-0 transform translate-y-8;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .section-animate.animate {
    @apply opacity-100 transform translate-y-0;
  }

  /* Floating Elements */
  .floating-element {
    animation: float 6s ease-in-out infinite;
  }
  
  @keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
  }

  /* Pulse Animation */
  .pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  /* Gradient Backgrounds */
  .bg-gradient-primary {
    background: var(--gradient-primary);
  }
  
  .bg-gradient-secondary {
    background: var(--gradient-secondary);
  }

  /* Glass Effect */
  .glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .dark .glass-effect {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Form Styles */
  .form-input {
    @apply transition-all duration-300 focus:ring-2 focus:ring-blue-500 focus:border-transparent;
    backdrop-filter: blur(10px);
  }
  
  .form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }

  /* Loading States */
  .loading {
    position: relative;
    overflow: hidden;
  }
  
  .loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
  }
  
  @keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
  }
}

/* 3D Transform Utilities */
.transform-3d {
  transform-style: preserve-3d;
}

.perspective {
  perspective: 1000px;
}

.rotate-x {
  transform: rotateX(var(--rotate-x, 0deg));
}

.rotate-y {
  transform: rotateY(var(--rotate-y, 0deg));
}

.rotate-z {
  transform: rotateZ(var(--rotate-z, 0deg));
}

/* Custom Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -100%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation Classes */
.animate-slide-up {
  animation: slideInUp 0.8s ease-out;
}

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

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out;
}

.animate-fade-scale {
  animation: fadeInScale 0.6s ease-out;
}

.animate-bounce-in {
  animation: bounceIn 0.8s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
  
  .hero-content p {
    font-size: 1.125rem;
  }
  
  .process-step {
    flex-direction: column;
    text-align: center;
  }
  
  .process-step .flex-1 {
    margin: 0;
    padding: 0;
  }
  
  .process-step .w-16 {
    margin: 1rem auto;
  }
  
  /* Mobile WhatsApp buttons */
  .fixed.bottom-6.right-6 {
    bottom: 1rem;
    right: 1rem;
  }
  
  .fixed.bottom-6.right-6 .group:hover .absolute {
    display: none;
  }
  
  /* Mobile AI chat */
  .fixed.bottom-6.left-6 {
    bottom: 1rem;
    left: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  /* Mobile navigation */
  .nav-link, .mobile-nav-link {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  /* Mobile forms */
  .form-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Mobile buttons */
  .cta-primary, .cta-secondary {
    width: 100%;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .cta-primary,
  .cta-secondary {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .comparison-table {
    font-size: 0.875rem;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem;
  }
  
  /* Extra small screens */
  .hero-content h1 {
    font-size: 1.75rem;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  /* Mobile floating elements */
  .fixed.bottom-6.right-6 {
    bottom: 0.5rem;
    right: 0.5rem;
  }
  
  .fixed.bottom-6.left-6 {
    bottom: 0.5rem;
    left: 0.5rem;
  }
  
  /* Mobile sections */
  section {
    padding: 2rem 1rem;
  }
  
  /* Mobile cards */
  .about-card, .service-card, .benefit-card, .investor-card {
    margin-bottom: 1rem;
  }
}

/* Dark Mode Specific Styles */
.dark .comparison-table {
  @apply border-gray-700;
}

.dark .comparison-table th {
  @apply bg-gray-800;
}

.dark .comparison-table tr:hover {
  @apply bg-gray-800;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating-element {
    animation: none;
  }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .gradient-text {
    -webkit-text-fill-color: initial;
    color: var(--primary-blue);
  }
  
  .bg-gradient-primary,
  .bg-gradient-secondary {
    background: var(--primary-blue);
  }
}

/* Print Styles */
@media print {
  .fixed,
  .sticky {
    position: static !important;
  }
  
  .bg-gradient-primary,
  .bg-gradient-secondary {
    background: #f0f0f0 !important;
    color: #000 !important;
  }
  
  .gradient-text {
    -webkit-text-fill-color: initial;
    color: #000 !important;
  }
}

/* Custom Utilities */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.backdrop-blur-xs {
  backdrop-filter: blur(2px);
}

.backdrop-blur-sm {
  backdrop-filter: blur(4px);
}

.backdrop-blur-md {
  backdrop-filter: blur(8px);
}

.backdrop-blur-lg {
  backdrop-filter: blur(16px);
}

.backdrop-blur-xl {
  backdrop-filter: blur(24px);
}

/* Custom Grid Patterns */
.grid-pattern {
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.dark .grid-pattern {
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Success/Error States */
.success-message {
  @apply bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded-lg;
}

.error-message {
  @apply bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded-lg;
}

.dark .success-message {
  @apply bg-green-900 border-green-600 text-green-200;
}

.dark .error-message {
  @apply bg-red-900 border-red-600 text-red-200;
}

/* Custom Scroll Snap */
.scroll-snap-container {
  scroll-snap-type: y mandatory;
}

.scroll-snap-item {
  scroll-snap-align: start;
}

/* Intersection Observer Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease-out;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.6s ease-out;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}
