/* Modern CSS Foundation for Free Forge Labs */

/* CSS Custom Properties */
:root {
  /* Colors */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-headers: 'Nunito', 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headers);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--gray-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.875rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  color: var(--gray-600);
  margin-bottom: var(--space-md);
}

/* Basic link styles - BUT NOT FOR BUTTONS */
a:not(.btn) {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:not(.btn):hover {
  color: var(--primary-700);
}

/* Container and Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-family: var(--font-headers);
}

.logo:hover {
  color: var(--primary-600);
  transform: translateY(-1px);
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
  align-items: center;
}

.nav-links a {
  color: var(--gray-700);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-links a:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.nav-links a.active {
  color: var(--primary-600);
  background: var(--primary-100);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.menu-toggle:hover {
  background: var(--gray-100);
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  margin: 2px 0;
  transition: var(--transition-fast);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.mobile-menu.active {
  display: block;
  animation: slideDown 0.3s ease;
}

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

.mobile-menu a {
  display: block;
  padding: var(--space-lg);
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  transition: all var(--transition-fast);
}

.mobile-menu a:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

/* BUTTONS - ULTIMATE FIX WITH MAXIMUM SPECIFICITY */
.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--space-sm) !important;
  padding: var(--space-sm) var(--space-lg) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
  text-decoration: none !important;
  position: relative !important;
  overflow: hidden !important;
}

.btn::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;
}

.btn:hover::before {
  left: 100%;
}

/* PRIMARY BUTTONS */
.btn-primary,
a.btn-primary,
button.btn-primary {
  background: var(--primary-600) !important;
  color: white !important;
  border: 1px solid var(--primary-600) !important;
}

.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover,
.btn-primary:focus,
a.btn-primary:focus,
button.btn-primary:focus {
  background: var(--primary-700) !important;
  color: white !important;
  border: 1px solid var(--primary-700) !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-md) !important;
}

/* SECONDARY BUTTONS */
.btn-secondary,
a.btn-secondary,
button.btn-secondary {
  background: white !important;
  color: var(--gray-700) !important;
  border: 1px solid var(--gray-300) !important;
}

.btn-secondary:hover,
a.btn-secondary:hover,
button.btn-secondary:hover,
.btn-secondary:focus,
a.btn-secondary:focus,
button.btn-secondary:focus {
  background: var(--gray-50) !important;
  color: var(--gray-700) !important;
  border: 1px solid var(--gray-400) !important;
  transform: translateY(-1px) !important;
}

/* OUTLINE BUTTONS - NUCLEAR OPTION */
.btn-outline,
a.btn-outline,
button.btn-outline,
.btn.btn-outline,
a.btn.btn-outline,
button.btn.btn-outline {
  background: white !important;
  color: var(--primary-600) !important;
  border: 1px solid var(--primary-600) !important;
}

.btn-outline:hover,
a.btn-outline:hover,
button.btn-outline:hover,
.btn.btn-outline:hover,
a.btn.btn-outline:hover,
button.btn.btn-outline:hover,
.btn-outline:focus,
a.btn-outline:focus,
button.btn-outline:focus,
.btn.btn-outline:focus,
a.btn.btn-outline:focus,
button.btn.btn-outline:focus {
  background: var(--primary-600) !important;
  color: white !important;
  border: 1px solid var(--primary-600) !important;
  transform: translateY(-1px) !important;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl) !important;
  font-size: 1rem !important;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-cyan));
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-200);
}

.card h3 {
  color: var(--gray-900);
  margin-bottom: var(--space-md);
}

.card p {
  color: var(--gray-600);
  margin-bottom: 0;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Hero Section */
.hero {
  text-align: center;
  padding: clamp(4rem, 10vw, 8rem) 0;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent-cyan) 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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.1;
}

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

.hero h1 {
  color: white;
  margin-bottom: var(--space-lg);
  font-weight: 700;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-logo {
  width: min(300px, 50vw);
  height: auto;
  margin-bottom: var(--space-xl);
  filter: brightness(0) invert(1);
}

/* Sections */
.section {
  padding: clamp(2rem, 6vw, 4rem) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

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

/* Features */
.feature {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
}

.feature:nth-child(even) {
  flex-direction: row-reverse;
}

.feature-content {
  flex: 1;
}

.feature-image {
  flex: 1;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  border: 2px dashed var(--gray-300);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  color: var(--gray-700);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all var(--transition-fast);
  background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;
  }

  .container,
  .container-narrow {
    padding: 0 var(--space-md);
  }

  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .feature,
  .feature:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}