/* Travailler.net - Core Styles - Optimized for Performance */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #059669;
  --secondary-dark: #047857;
  --danger: #dc2626;
  --warning: #f59e0b;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg-white);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Container & Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.logo span {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
}

.nav a {
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.95;
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 1rem;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Copy Button */
.copy-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.copy-btn.copied {
  background: var(--secondary);
}

.copy-btn svg {
  width: 18px;
  height: 18px;
}

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s;
}

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

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card-description {
  color: var(--text-light);
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Example Box */
.example-box {
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
}

.example-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.example-box-content {
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  line-height: 1.8;
  color: var(--text);
}

/* Checklist */
.checklist {
  list-style: none;
  margin: 2rem 0;
}

.checklist li {
  padding: 0.75rem 0;
  padding-left: 2rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--secondary);
  font-weight: bold;
  font-size: 1.25rem;
}

.checklist li:last-child {
  border-bottom: none;
}

/* Error List */
.error-list {
  list-style: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.error-list li {
  padding: 0.5rem 0;
  padding-left: 1.75rem;
  position: relative;
  color: var(--danger);
}

.error-list li::before {
  content: '✕';
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* FAQ Section */
.faq {
  margin: 3rem 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.faq-question {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.faq-answer {
  color: var(--text-light);
  line-height: 1.7;
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.breadcrumb-list {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
}

.breadcrumb-item a {
  color: var(--text-light);
}

.breadcrumb-item a:hover {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-item::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--text-light);
}

.breadcrumb-item:last-child::after {
  display: none;
}

.breadcrumb-item:last-child {
  color: var(--text);
  font-weight: 600;
}

/* Footer */
.footer {
  background: var(--text);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h4 {
  margin-bottom: 1rem;
  color: white;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #d1d5db;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid #374151;
  text-align: center;
  color: #9ca3af;
}

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

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

.section {
  padding: 3rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

/* Tool Forms */
.tool-form {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Progress Bar */
.progress-bar {
  background: var(--border);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  background: var(--secondary);
  height: 100%;
  transition: width 0.3s;
}

/* Interactive Checklist */
.interactive-checklist {
  list-style: none;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
}

.checkbox-item:hover {
  background: var(--bg-light);
}

.checkbox-item input[type="checkbox"] {
  margin-right: 1rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.checkbox-item.checked {
  background: #f0fdf4;
  border-color: var(--secondary);
}

/* Phrase Bank */
.phrase-bank {
  margin: 2rem 0;
}

.phrase-category {
  margin-bottom: 3rem;
}

.phrase-category h3 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.phrase-item {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.phrase-text {
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.phrase-context {
  color: var(--text-light);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phrase-context::before {
  content: '→';
  color: var(--primary);
  font-weight: bold;
}

.phrase-copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* Hub Pages */
.hub-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.hub-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.hub-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}

.hub-card h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.hub-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Download Section */
.download-section {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 3rem 0;
}

.download-section h2 {
  color: white;
  margin-bottom: 1rem;
}

.download-section p {
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.download-btn {
  background: white;
  color: var(--secondary);
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.download-btn:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow);
  }

  .nav.active {
    display: flex;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero h1 { font-size: 2rem; }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .btn,
  .copy-btn,
  .mobile-menu-btn {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
  }

  a {
    color: black;
    text-decoration: none;
  }

  .example-box {
    border: 1px solid #000;
    page-break-inside: avoid;
  }
}

/* Loading State */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

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

/* Skip to Content */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 10px;
}

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

/* Performance Critical Styles */
.lazy-load {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy-load.loaded {
  opacity: 1;
}