/* ============================================
   MJC Job Manager - Marketing Site Styles
   Mobile-first, accessible, maintainable
   ============================================ */

/* ============================================
   CSS Reset & Base
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: rgb(31, 143, 255);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: rgb(249, 116, 21);
}

a:focus {
  outline: 2px solid rgb(31, 143, 255);
  outline-offset: 2px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus {
  outline: 2px solid rgb(31, 143, 255);
  outline-offset: 2px;
}

/* ============================================
   Color Variables (RGB) - Light Mode
   ============================================ */
:root {
  --bg-primary: rgb(255, 255, 255);
  --fg-primary: rgb(29, 32, 37);
  --color-primary: rgb(31, 143, 255);
  --color-secondary: rgb(249, 116, 21);
  --bg-muted: rgb(241, 242, 244);
  --fg-muted: rgb(107, 114, 128);
  --border: rgb(229, 231, 235);
  --destructive: rgb(239, 67, 67);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(29, 32, 37, 0.04);
  --shadow-md: 0 4px 6px rgba(29, 32, 37, 0.06);
  --shadow-lg: 0 10px 15px rgba(29, 32, 37, 0.08);
  --shadow-xl: 0 20px 25px rgba(29, 32, 37, 0.10);
  
  /* Theme transition */
  --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================
   Dark Mode Colors
   ============================================ */
[data-theme="dark"] {
  --bg-primary: rgb(17, 24, 39);
  --fg-primary: rgb(243, 244, 246);
  --color-primary: rgb(59, 130, 246);
  --color-secondary: rgb(251, 146, 60);
  --bg-muted: rgb(31, 41, 55);
  --fg-muted: rgb(156, 163, 175);
  --border: rgb(55, 65, 81);
  --destructive: rgb(248, 113, 113);
  
  /* Dark mode shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.35);
}

/* Apply transitions to themed elements */
body,
.nav,
.feature-card,
.callout,
.footer,
.btn,
.workflow-step,
input,
textarea,
select {
  transition: var(--theme-transition);
}

/* Dark mode specific overrides */
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, rgb(17, 24, 39) 0%, rgb(31, 41, 55) 100%);
}

[data-theme="dark"] .feature-card {
  background: rgb(31, 41, 55);
  border-color: rgb(55, 65, 81);
}

[data-theme="dark"] .callout {
  background: rgb(31, 41, 55);
  border-left-color: var(--color-primary);
}

[data-theme="dark"] .workflow-step {
  background: rgb(31, 41, 55);
}

[data-theme="dark"] .pricing-card {
  background: rgb(31, 41, 55);
}

[data-theme="dark"] img {
  opacity: 0.95;
}

[data-theme="dark"] .btn-secondary {
  background: rgb(55, 65, 81);
  color: var(--fg-primary);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgb(75, 85, 99);
}

[data-theme="dark"] .footer {
  background: rgb(10, 15, 25);
}

[data-theme="dark"] .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .faq-question {
  color: var(--fg);
}

[data-theme="dark"] .faq-answer {
  color: var(--fg-muted);
}

[data-theme="dark"] .pricing-table tfoot {
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] input[type="range"] {
  accent-color: var(--color-primary);
}

.cta-gradient {
  background: linear-gradient(to bottom, rgb(235, 245, 250), rgb(250, 241, 235));
}

[data-theme="dark"] .cta-gradient {
  background: linear-gradient(to bottom, rgba(30, 40, 50, 1), rgba(40, 35, 30, 1));
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 600;
  color: var(--fg-primary);
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 0.875rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.25rem;
  margin-bottom: 0.625rem;
}

p {
  margin-bottom: 1rem;
}

/* Tablet breakpoint */
@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.75rem;
  }
}

/* Desktop breakpoint */
@media (min-width: 1024px) {
  h1 {
    font-size: 3rem;
  }
  h2 {
    font-size: 2.25rem;
  }
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Gradient backgrounds that respond to theme */
.section-gradient {
  background: linear-gradient(to bottom, var(--bg-primary), var(--bg-muted));
}

.section-muted {
  background: var(--bg-muted);
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

.section {
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .section {
    padding: 4rem 0;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 5rem 0;
  }
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg-primary);
}

.nav-logo img {
  width: 32px;
  height: 32px;
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--fg-primary);
  cursor: pointer;
  transition: var(--theme-transition), transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--border);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
}

.theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

/* Theme toggle tooltip */
.theme-toggle::after {
  content: attr(aria-label);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg-primary);
  color: var(--bg-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.theme-toggle:hover::after {
  opacity: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  list-style: none;
}

.nav-links a {
  color: var(--fg-primary);
  font-weight: 500;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-github {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.nav-github svg {
  width: 20px;
  height: 20px;
}

.nav-github-stats {
  display: flex;
  gap: 0.75rem;
}

.nav-github-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .nav-container {
    flex-wrap: nowrap;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: rgb(20, 120, 220);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: white;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  background: linear-gradient(to bottom, rgb(235, 245, 250), rgb(250, 241, 235));
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .hero {
    padding: 5rem 0;
  }
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.hero-content h1 {
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.125rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image img {
  max-width: 100%;
  height: auto;
  transform: scale(1.2);
}

.placeholder-image {
  background: var(--bg-muted);
  border: 2px dashed var(--border);
  border-radius: 0.5rem;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--fg-muted);
  font-style: italic;
}

/* ============================================
   Feature Grid
   ============================================ */
.feature-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  margin-bottom: 0;
}

/* ============================================
   Workflow Section
   ============================================ */
.workflow-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .workflow-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.workflow-step {
  text-align: center;
}

.workflow-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

.workflow-step h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.workflow-step p {
  color: var(--fg-muted);
  margin-bottom: 0;
}

/* ============================================
   Callout Box
   ============================================ */
.callout {
  background: var(--bg-muted);
  border-left: 4px solid var(--color-primary);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin: 2rem 0;
}

.callout h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.callout ul {
  list-style: none;
  padding-left: 0;
}

.callout li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.75rem;
}

.callout li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: bold;
}

/* ============================================
   Pricing Tables
   ============================================ */
.pricing-grid {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pricing-card {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.pricing-card h2 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.pricing-table th,
.pricing-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.pricing-table th {
  font-weight: 600;
  background: var(--bg-muted);
}

.pricing-table td:nth-child(2) {
  text-align: right;
  font-weight: 600;
  color: var(--color-primary);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq {
  margin: 2rem 0;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 1.5rem;
  background: var(--bg-muted);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: var(--border);
}

.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--color-primary);
  transition: transform 0.2s ease;
}

.faq-question.active::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.active {
  padding: 1.5rem;
  max-height: 500px;
}

.faq-answer p {
  margin-bottom: 0.5rem;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fg-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(31, 143, 255, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-status {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  display: none;
}

.form-status[data-state="error"] {
  background: rgba(239, 67, 67, 0.1);
  border: 1px solid var(--destructive);
  color: var(--destructive);
}

.form-status[data-state="success"] {
  background: rgba(31, 143, 255, 0.1);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.form-status[data-state="pending"] {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--fg-muted);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--fg-primary);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 0;
}

.demo-page + .footer {
  margin-top: 0;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 50;
  transition: all 0.2s ease;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  background: rgb(20, 120, 220);
  transform: translateY(-2px);
}

/* ============================================
   Demo Page Styles
   ============================================ */
.demo-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 2rem 0 0 0;
  position: relative;
  overflow: hidden;
}

.demo-page::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: url('../images/get-started-needs-to-be-blurred.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(1.5rem);
  z-index: 0;
}

.demo-page::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 1;
}

.demo-card {
  background: var(--bg-primary);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

.demo-card h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.demo-card > p {
  text-align: center;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--fg-muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   Accessibility
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 200;
}

.skip-to-content:focus {
  top: 0;
}

/* Focus visible for better keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
