
/* Base Font and Smooth Scrolling */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #4F46E5;
  --primary-dark: #4338CA;
  --secondary-color: #10B981;
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --bg-primary: #F9FAFB;
  --bg-secondary: #F3F4F6;
  --bg-gradient-start: #0f2027;
  --bg-gradient-mid: #203a43;
  --bg-gradient-end: #2c5364;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive Typography */
h1, .h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
}

h2, .h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.3;
}

h3, .h3 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.4;
}

p, .body-text {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

.small-text {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
}

/* Mobile-First Approach */
.container {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

/* Responsive Grid and Flexbox */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

/* Touch-Friendly Buttons and Links */
.btn, a.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px; /* Minimum touch target size */
  min-width: 44px;
}

/* Adjusted hover effects for touch devices */
@media (hover: hover) {
  .btn:hover, a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  .security-feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  }
  
  .price-card:hover {
    transform: scale(1.03);
  }
}

/* No hover effects on touch devices */
@media (hover: none) {
  .btn:active, a.btn:active {
    transform: translateY(1px);
  }
  
  .security-feature:active {
    transform: translateY(2px);
  }
}

/* Fixed positioning adjustments for mobile */
.fixed-element {
  position: fixed;
  z-index: 50;
}

/* Improved Gradient Background */
.gradient-bg {
  background: linear-gradient(90deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
}

.animated-bg {
  background: linear-gradient(-45deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end), #172b4d);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

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

/* Optimized Animations */
.typewriter h1 {
  overflow: hidden;
  border-right: .15em solid var(--primary-color);
  white-space: nowrap;
  margin: 0 auto;
  animation: 
      typing 3.5s steps(40, end),
      blink-caret .75s step-end infinite;
}

/* Adjust typewriter for mobile */
@media (max-width: 768px) {
  .typewriter h1 {
    white-space: normal;
    border-right: none;
    animation: none;
  }
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--primary-color) }
}

/* More efficient floating animation */
.floating {
  animation: floating 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes floating {
  0% { transform: translateY(0px); }
  50% { transform: translateY(15px); }
  100% { transform: translateY(0px); }
}

/* Optimized glow effect */
.glow {
  text-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* Component Transitions */
.security-feature, .price-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform, box-shadow;
}

/* Images and Media */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Navigation */
.mobile-nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-nav-toggle {
    display: block;
    position: relative;
    z-index: 100;
    border: none;
    background: transparent;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    cursor: pointer;
  }
  
  .mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-gradient-start);
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 99;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .mobile-nav.active {
    transform: translateX(0);
  }
  
  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
  }
  
  .mobile-nav-links a {
    color: white;
    font-size: 1.25rem;
    text-decoration: none;
    padding: 0.5rem 0;
  }
}

/* Media Queries for Responsive Design */
@media screen and (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media screen and (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media screen and (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media screen and (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Touch-friendly Form Elements */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #D1D5DB;
  min-height: 44px; /* Minimum touch target size */
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #F9FAFB;
    --text-secondary: #E5E7EB;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
  }
  
  .dark-mode-toggle {
    display: block;
  }
  
  /* Add specific dark mode styles here */
}

/* Reduced Motion Accessibility */
@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;
  }
  
  .animated-bg {
    background: var(--bg-gradient-mid);
    animation: none;
  }
  
  .floating {
    animation: none;
  }
}

/* Utilities */
.hidden-mobile {
  display: none;
}

@media screen and (min-width: 768px) {
  .hidden-mobile {
    display: block;
  }
  
  .hidden-desktop {
    display: none;
  }
}

/* Fix for iOS input zoom */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px;
  }
}

/* Better touch scrolling on iOS */
.scroll-container {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
}

.scroll-item {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 85%;
}

@media screen and (min-width: 768px) {
  .scroll-item {
    width: 45%;
  }
}

@media screen and (min-width: 1200px) {
  .scroll-item {
    width: 30%;
  }
}

/* Remove tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}
