/*
 * Mobile-First Custom Styles for AI Automation Landing Page
 * Base styles are for mobile (320px+), then use min-width media queries
 */

/* ========================================
   CSS Variables - Brand Colors
   ======================================== */
:root {
  --primary-color: #0d6efd;      /* Bootstrap primary */
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --light-bg: #f8f9fa;
  --dark-text: #212529;
  --gradient-start: #667eea;
  --gradient-end: #764ba2;
  --spacing-unit: 1rem;
}

/* ========================================
   Base Mobile Styles (320px+)
   ======================================== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;           /* Minimum for iOS to prevent auto-zoom */
  line-height: 1.6;
  color: var(--dark-text);
  scroll-behavior: smooth;
  padding-top: 0;            /* No padding when header is transparent */
}

/* ========================================
   Header Styles
   ======================================== */

/* Header - Initially transparent */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  background: transparent;
  backdrop-filter: blur(10px);
}

/* Header when scrolled - solid background */
#main-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Brand name styling */
.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  transition: color 0.3s ease;
}

#main-header.scrolled .brand-name {
  color: var(--gradient-start);
}

/* Social media links */
.social-link {
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.social-link:hover {
  transform: translateY(-2px);
  color: rgba(255, 255, 255, 0.8);
}

#main-header.scrolled .social-link {
  color: var(--gradient-start);
}

#main-header.scrolled .social-link:hover {
  color: var(--gradient-end);
}

/* Hero Section - Mobile */
#hero {
  padding: 2rem 0;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
  background-size: cover;
  opacity: 0.3;
}

#hero .container {
  position: relative;
  z-index: 1;
}

#hero h1 {
  font-size: 2rem;            /* Readable on small screens */
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}

#hero .lead {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

#hero .btn {
  padding: 0.875rem 2rem;
  font-size: 1.125rem;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  font-weight: 600;
  border: none;
}

#hero .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Hero Form - Inline Styles */
#hero .form-control {
  font-size: 16px;  /* Prevent iOS zoom */
  padding: 0.875rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  transition: all 0.3s ease;
}

#hero .form-control:focus {
  background: white;
  border-color: white;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.3);
}

#hero .form-control::placeholder {
  color: #6c757d;
}

#hero .btn-light {
  background: white;
  color: var(--gradient-start);
  border: none;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#hero .btn-light:hover:not(:disabled) {
  background: #f8f9fa;
  color: var(--gradient-start);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#hero .btn-light:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#hero .alert {
  border-radius: 8px;
  max-width: 500px;
  margin: 0 auto;
}

#hero .alert-light {
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--success-color);
  border: none;
}

#hero .text-white-50 {
  opacity: 0.75;
}

/* Benefits Section - Mobile */
#benefits {
  padding: 3rem 0;
}

#benefits h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.card-body {
  padding: 2rem 1.5rem;
}

.card .bi {
  transition: transform 0.3s ease;
}

.card:hover .bi {
  transform: scale(1.1);
}

/* Alert Messages */
.alert {
  border-radius: 8px;
  animation: slideDown 0.3s ease;
  border: none;
  font-weight: 500;
}

.alert i {
  font-size: 1.25rem;
  vertical-align: middle;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
}

.alert-danger {
  background-color: #f8d7da;
  color: #842029;
}

/* Form Validation */
.was-validated .form-control:invalid {
  border-color: var(--danger-color);
}

.was-validated .form-control:valid {
  border-color: var(--success-color);
}

.invalid-feedback {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Privacy Text */
.text-muted.small {
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Loading Spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* ========================================
   Mobile Header Adjustments (< 576px)
   ======================================== */
@media (max-width: 576px) {
  .brand-name {
    font-size: 1.25rem;
  }

  .social-link {
    font-size: 1.25rem;
  }
}

/* ========================================
   Tablet Styles (768px+)
   ======================================== */
@media (min-width: 768px) {
  #hero {
    padding: 3rem 0;
  }

  #hero h1 {
    font-size: 3rem;
  }

  #hero .lead {
    font-size: 1.375rem;
  }

  #benefits {
    padding: 5rem 0;
  }

  #benefits h2 {
    font-size: 2.25rem;
  }

  #form {
    padding: 5rem 0;
  }

  #form h2 {
    font-size: 2.25rem;
  }

  .card-body {
    padding: 2rem !important;
  }
}

/* ========================================
   Desktop Styles (992px+)
   ======================================== */
@media (min-width: 992px) {
  #hero h1 {
    font-size: 3.5rem;
  }

  #hero .lead {
    font-size: 1.5rem;
  }

  #benefits h2 {
    font-size: 2.5rem;
  }

  #form h2 {
    font-size: 2.5rem;
  }
}

/* ========================================
   Large Desktop Styles (1200px+)
   ======================================== */
@media (min-width: 1200px) {
  #hero h1 {
    font-size: 4rem;
  }

  .container {
    max-width: 1140px;
  }
}

/* ========================================
   Footer Styles
   ======================================== */

#main-footer {
  background-color: var(--light-bg);
  border-top: 1px solid #dee2e6;
  margin-top: 3rem;
}

#main-footer p {
  margin-bottom: 0;
  color: var(--secondary-color);
}

.footer-link {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--gradient-start);
  text-decoration: underline;
}

/* Modal customizations */
.modal-body h6 {
  font-weight: 600;
  color: var(--dark-text);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.modal-body p {
  margin-bottom: 0.5rem;
}

.modal-body .small {
  line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  #main-footer {
    font-size: 0.875rem;
  }

  .modal-lg {
    margin: 0.5rem;
  }
}

/* ========================================
   Utilities
   ======================================== */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
