/* ===================================
   TradingMixer Landing Page Styles
   =================================== */

/* CSS Variables (matches Portal color scheme) */
:root {
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --success: #10B981;
  --danger: #EF4444;
  --background: #F9FAFB;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --border-color: #E5E7EB;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

@media (min-width: 768px) {
  h1 {
    font-size: 3.5rem;
  }
  
  h2 {
    font-size: 2.5rem;
  }
  
  h3 {
    font-size: 1.75rem;
  }
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Buttons */
button,
.btn {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border: none;
  outline: none;
}

button:focus,
.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Form Inputs */
input[type="text"],
input[type="email"] {
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus {
  outline: none;
}

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

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

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

/* Loading Indicator */
.loading {
  position: relative;
}

.loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

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

/* Print Styles */
@media print {
  body {
    background: white;
  }
  
  footer,
  #signup {
    display: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
  }
  
  button,
  input {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
}

/* Utility Classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Custom Scrollbar (Webkit browsers) */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-primary);
}

/* Selection Color */
::selection {
  background-color: var(--primary);
  color: white;
}

::-moz-selection {
  background-color: var(--primary);
  color: white;
}

/* Table Responsive */
@media (max-width: 767px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Pricing Table Enhancements */
.pricing-table {
  border-collapse: separate;
  border-spacing: 0;
}

.pricing-table th,
.pricing-table td {
  text-align: left;
  padding: 1rem 1.5rem;
}

.pricing-table thead th {
  background-color: var(--background);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

.pricing-table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

.pricing-table tbody tr:last-child {
  border-bottom: none;
}

.pricing-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

/* Form Validation States */
input.error {
  border-color: var(--danger);
}

input.success {
  border-color: var(--success);
}

/* Gradient Text Effect */
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card Hover Effects */
.card-hover {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* CTA Button Enhancement */
.cta-button {
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease-in-out;
}

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

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-primary {
  background-color: var(--primary);
  color: white;
}

.badge-success {
  background-color: var(--success);
  color: white;
}

/* Responsive Breakpoints Reference
   Mobile: 320px - 767px
   Tablet: 768px - 1023px
   Desktop: 1024px+
   Large Desktop: 1280px+
   4K: 1920px+
*/

/* Mobile Optimization */
@media (max-width: 767px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Ensure minimum touch target size (44px) */
  button,
  a.inline-block,
  input[type="submit"] {
    min-height: 44px;
  }
  
  /* Prevent text from being too small on mobile */
  body {
    font-size: 16px; /* Prevents iOS zoom on input focus */
  }
  
  /* Better spacing for stacked elements */
  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  /* Make form inputs larger for easier tapping */
  input[type="text"],
  input[type="email"] {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 0.875rem 1rem;
  }
}

/* Small mobile devices (320px-374px) */
@media (max-width: 374px) {
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Tablet Optimization */
@media (min-width: 768px) and (max-width: 1023px) {
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
}

/* Large Desktop Optimization */
@media (min-width: 1920px) {
  .container {
    max-width: 1536px;
  }
  
  h1 {
    font-size: 4rem;
  }
  
  h2 {
    font-size: 3rem;
  }
}
