/* Custom CSS Variables */
:root {
  --primary-color: #154E9B;
  --primary-light: #4784F1;
  --primary-dark: #0d3b7a;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #06b6d4;
  --light-color: #f8fafc;
  --dark-color: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --border-radius: 1rem;
  --border-radius-sm: 0.5rem;
  --border-radius-lg: 1.5rem;
  --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --box-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--gray-50) 0%, #e0f2fe 50%, var(--gray-100) 100%);
  min-height: 100vh;
  line-height: 1.6;
  color: var(--gray-800);
  overflow-x: hidden;
}

/* Floating Elements */
.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: linear-gradient(135deg, rgba(71, 132, 241, 0.1), rgba(21, 78, 155, 0.1));
  border-radius: 50px;
  animation: float 20s infinite linear;
}

.cloud-1 {
  width: 120px;
  height: 60px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.cloud-2 {
  width: 80px;
  height: 40px;
  top: 60%;
  right: 15%;
  animation-delay: -7s;
}

.cloud-3 {
  width: 100px;
  height: 50px;
  bottom: 20%;
  left: 60%;
  animation-delay: -14s;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-light);
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

.star-1 { top: 15%; left: 20%; animation-delay: 0s; }
.star-2 { top: 30%; right: 25%; animation-delay: 1s; }
.star-3 { bottom: 40%; left: 15%; animation-delay: 2s; }
.star-4 { top: 70%; right: 40%; animation-delay: 1.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  25% { transform: translateY(-20px) translateX(10px); }
  50% { transform: translateY(-10px) translateX(-10px); }
  75% { transform: translateY(-15px) translateX(5px); }
}

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

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color) !important;
}

.navbar .nav-link {
  color: var(--gray-700) !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--primary-color) !important;
  background: rgba(71, 132, 241, 0.1);
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.bg-primary-light {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  color: white;
}

/* Hero Section */
.hero-section {
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.min-vh-75 {
  min-height: 75vh;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge .badge {
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(71, 132, 241, 0.2);
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  line-height: 1.7;
  max-width: 90%;
}

.hero-buttons .btn {
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: var(--border-radius);
}

.hero-stats {
  margin-top: 3rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Visual */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-mockup {
  width: 400px;
  height: 300px;
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-xl);
  padding: 1.5rem;
  position: relative;
  border: 8px solid var(--gray-200);
}

.device-screen {
  width: 100%;
  height: 100%;
  background: var(--gray-50);
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
}

.preview-demo {
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.demo-upload-area {
  background: rgba(71, 132, 241, 0.05);
  border: 2px dashed var(--primary-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-icon {
  font-size: 2rem;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
  animation: bounce 2s infinite;
}

.demo-text {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0;
}

.demo-controls {
  margin-top: 1rem;
}

.demo-slider {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
}

.demo-slider::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 60%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 4px;
}

/* Sections */
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

.features-section {
  background: white;
  position: relative;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-md);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  height: 100%;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--box-shadow-xl);
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.feature-icon i {
  font-size: 1.5rem;
  color: white;
}

.feature-card h5 {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0;
}

/* Tool Section */
.tool-section {
  background: var(--gray-50);
}

.tool-card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-xl);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.card-icon i {
  font-size: 1.25rem;
  color: white;
}

.card-title {
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

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

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

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.8s ease-out;
}

.fade-in-delay {
  animation: fadeIn 0.8s ease-out 0.3s both;
}

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

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

/* Modern Drop Zone */
.modern-drop-zone {
  border: 2px dashed var(--primary-light);
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, rgba(71, 132, 241, 0.02), rgba(21, 78, 155, 0.02));
  transition: var(--transition);
  cursor: pointer;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modern-drop-zone:hover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(71, 132, 241, 0.05), rgba(21, 78, 155, 0.05));
  transform: scale(1.02);
}

.modern-drop-zone.dragover {
  border-color: var(--success-color);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05));
  transform: scale(1.05);
}

.drop-zone-content {
  width: 100%;
}

/* Modern Inputs */
.modern-input {
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  background: white;
}

.modern-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(71, 132, 241, 0.1);
  outline: none;
}

/* Button Styles */
.btn {
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.btn-outline-primary {
  border: 2px solid var(--primary-light);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.btn-hover {
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.btn-hover:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

.btn-hover::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.btn-hover:hover::before {
  width: 300px;
  height: 300px;
}

/* Resize Controls */
.resize-controls {
  animation: fadeIn 0.5s ease-out;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--gray-50);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
}

.upload-icon {
  transition: var(--transition);
}

.modern-drop-zone:hover .upload-icon {
  animation: bounce 1s infinite;
}

/* Preview Styles */
.preview-section {
  animation: fadeIn 0.5s ease-out;
}

.preview-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
}

.preview-container img,
.preview-container canvas {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  transition: var(--transition);
}

.preview-container:hover img,
.preview-container:hover canvas {
  transform: scale(1.05);
}

.image-info {
  background: var(--light-color);
  padding: 0.5rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
  animation: pulse 2s infinite;
}

.loading-overlay.show {
  display: flex;
}

/* Toast Styles */
.toast {
  background: white;
  border: none;
  box-shadow: var(--box-shadow-lg);
  border-radius: var(--border-radius);
}

.toast.toast-success {
  border-left: 4px solid var(--success-color);
}

.toast.toast-error {
  border-left: 4px solid var(--danger-color);
}

.toast.toast-warning {
  border-left: 4px solid var(--warning-color);
}

.toast.toast-info {
  border-left: 4px solid var(--info-color);
}

/* Preview Styles */
.preview-section {
  animation: fadeIn 0.5s ease-out;
}

.preview-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}

.preview-container img,
.preview-container canvas {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  transition: var(--transition);
  border-radius: var(--border-radius);
}

.preview-container:hover img,
.preview-container:hover canvas {
  transform: scale(1.02);
}

.image-info {
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  border: 1px solid var(--gray-200);
  margin-top: 1rem;
}

.placeholder-content {
  padding: 3rem 1rem;
  color: var(--gray-400);
}

/* Trust Section */
.trust-section {
  background: white;
  border-top: 1px solid var(--gray-200);
}

.trust-content h3 {
  color: var(--gray-900);
  font-weight: 700;
}

.trust-badges .badge {
  background: rgba(71, 132, 241, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(71, 132, 241, 0.2);
  font-weight: 500;
}

/* Footer */
.footer-section {
  background: var(--gray-900);
  color: var(--gray-400);
}

.footer-brand {
  color: white;
  font-size: 1.125rem;
}

.footer-brand i {
  color: var(--primary-light);
}

.footer-section .text-muted {
  color: white !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .drop-zone {
    padding: 2rem 1rem;
  }
  
  .preview-container img,
  .preview-container canvas {
    max-height: 250px;
  }
}

@media (max-width: 576px) {
  .col-md-6 {
    margin-bottom: 1rem;
  }
  
  .btn-hover {
    font-size: 0.875rem;
  }
  
  .loading-content {
    margin: 1rem;
    padding: 1.5rem;
  }
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .drop-zone {
    border-width: 4px;
  }
  
  .btn {
    border-width: 2px;
  }
}

/* Print Styles */
@media print {
  .navbar,
  footer,
  .loading-overlay,
  .toast-container {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
}
