/* AI för Seniorer - Anpassad CSS med större typsnitt och mer luft */

/* CSS Variables - Anpassade för seniorer (30% större typsnitt, 25% mer spacing) */
:root {
  /* Colors - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #e2e8f0;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #e0e7ff;
  --success: #22c55e;
  --border: #e2e8f0;
  --warning: #f59e0b;
  --warning-light: #fef3c7;

  /* Spacing - 25% mer luft */
  --space-xs: 0.375rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 2.5rem;
  --space-2xl: 3.75rem;

  /* Typography - 30% större */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  --font-size-base: 1.25rem;
  --line-height: 1.9;

  /* Sizes */
  --header-height: 70px;
  --max-width: 800px;
  --border-radius: 12px;
  --border-radius-sm: 8px;

  /* Transitions */
  --transition: 0.2s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: #312e81;
  --border: #334155;
  --warning-light: #78350f;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: var(--line-height);
  min-height: 100vh;
  min-height: 100dvh;
  transition: background var(--transition), color var(--transition);
}

/* Typography - Större för seniorer */
h1, h2, h3, h4 {
  line-height: 1.4;
  font-weight: 700;
}

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

p {
  margin-bottom: var(--space-md);
  font-size: var(--font-size-base);
}

a {
  color: var(--accent);
  text-decoration: underline;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background var(--transition), border var(--transition);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
}

/* Theme Toggle - Större klickyta med text för seniorer */
.theme-toggle {
  height: 48px;
  padding: 0 var(--space-md);
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border-radius: var(--border-radius-sm);
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}

.theme-toggle .theme-icon {
  width: 24px;
  height: 24px;
  fill: var(--text-primary);
  flex-shrink: 0;
}

.theme-toggle .theme-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Main Content */
main {
  padding-top: calc(var(--header-height) + var(--space-xl));
  padding-bottom: var(--space-2xl);
  min-height: 100vh;
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 6px;
  background: var(--bg-secondary);
  z-index: 99;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  transition: width 0.3s ease;
  border-radius: 0 3px 3px 0;
}

/* Step Overview Cards */
.step-grid {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.step-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.step-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.step-card.completed {
  border-left: 6px solid var(--success);
}

.step-number {
  width: 56px;
  height: 56px;
  min-width: 56px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
}

.step-card.completed .step-number {
  background: var(--success);
  color: white;
}

.step-content h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0;
}

/* Step Page */
.step-header {
  margin-bottom: var(--space-xl);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--accent-light);
  color: var(--accent);
  padding: var(--space-sm) var(--space-lg);
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

/* Content Sections */
.content-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.content-section h2 {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 3px solid var(--accent-light);
}

/* Info Box - Tips */
.info-box {
  background: var(--accent-light);
  border-left: 5px solid var(--accent);
  padding: var(--space-lg);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  margin: var(--space-lg) 0;
}

.info-box p {
  margin: 0;
  color: var(--text-primary);
}

/* Tip Box - Special styling for tips */
.tip-box {
  background: var(--accent-light);
  border-left: 5px solid var(--accent);
  padding: var(--space-lg);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  margin: var(--space-lg) 0;
}

.tip-box h4 {
  margin-bottom: var(--space-sm);
  color: var(--accent);
}

/* Warning Box */
.warning-box {
  background: var(--warning-light);
  border-left: 5px solid var(--warning);
  padding: var(--space-lg);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  margin: var(--space-lg) 0;
}

.warning-box h4 {
  margin-bottom: var(--space-sm);
  color: var(--warning);
}

.warning-box p {
  margin: 0;
}

/* Service Cards - Större och tydligare */
.service-grid {
  display: grid;
  gap: var(--space-lg);
}

.service-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.service-card h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.35rem;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0;
  flex-grow: 1;
}

.service-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.tag {
  background: var(--bg-primary);
  color: var(--text-muted);
  padding: var(--space-xs) var(--space-md);
  border-radius: 4px;
  font-size: 0.95rem;
}

/* Buttons - Större klickyta för seniorer */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  min-height: 56px;
}

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

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

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-demo {
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  color: white;
  width: 100%;
  margin-top: var(--space-md);
}

.btn-demo:hover {
  opacity: 0.9;
  color: white;
}

/* Navigation */
.step-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--border);
}

.step-nav .btn {
  flex: 1;
  max-width: 200px;
}

.step-nav .btn:only-child {
  margin-left: auto;
}

/* Lists */
.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: var(--space-md) 0;
  padding-left: var(--space-xl);
  position: relative;
  font-size: 1.15rem;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
}

/* Checklist */
.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  padding: var(--space-md) 0;
  padding-left: var(--space-xl);
  position: relative;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.checklist li::before {
  content: '☐';
  position: absolute;
  left: 0;
  font-size: 1.3rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: var(--space-lg);
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.3rem;
  max-width: 550px;
  margin: 0 auto var(--space-xl);
}

/* Quiz - Större knappar */
.quiz-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}

.quiz-card h4 {
  margin-bottom: var(--space-lg);
  color: var(--accent);
  font-size: 1.35rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.quiz-option {
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.15rem;
}

.quiz-option:hover {
  border-color: var(--accent);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.quiz-option.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.footer-credit {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ================================
   SIDEBAR NAVIGATION
   ================================ */

/* Sidebar Variables */
:root {
  --sidebar-width: 300px;
  --sidebar-collapsed-width: 0px;
}

/* Layout with sidebar */
.layout-with-sidebar {
  display: flex;
  min-height: 100vh;
}

.layout-with-sidebar main {
  flex: 1;
  min-width: 0;
}

/* Sidebar Toggle Button (Mobile) */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: background var(--transition);
}

.sidebar-toggle:hover {
  background: var(--bg-secondary);
}

.sidebar-toggle svg {
  width: 28px;
  height: 28px;
  fill: var(--text-primary);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 90;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.sidebar.open {
  transform: translateX(0);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 89;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* Sidebar Content */
.sidebar-content {
  padding: var(--space-xl);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Progress Summary */
.progress-summary {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.progress-summary-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.progress-summary-text strong {
  color: var(--text-primary);
}

.progress-summary-bar {
  height: 10px;
  background: var(--bg-primary);
  border-radius: 5px;
  overflow: hidden;
}

.progress-summary-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-summary-time {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
}

/* Sidebar Navigation */
.sidebar-nav {
  list-style: none;
}

.sidebar-nav-item {
  margin-bottom: var(--space-sm);
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.sidebar-nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-nav-link.completed {
  color: var(--success);
}

.sidebar-nav-link.completed:hover {
  color: var(--success);
}

/* Step indicator in sidebar */
.sidebar-step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.sidebar-nav-link.active .sidebar-step-number {
  background: var(--accent);
  color: white;
}

.sidebar-nav-link.completed .sidebar-step-number {
  background: var(--success);
  color: white;
}

.sidebar-nav-link.completed .sidebar-step-number::after {
  content: '✓';
}

.sidebar-nav-link.completed .sidebar-step-number span {
  display: none;
}

/* Sidebar Footer Links */
.sidebar-footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

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

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.05rem;
  transition: all var(--transition);
}

.sidebar-footer-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-footer-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Desktop: Sidebar always visible */
@media (min-width: 1024px) {
  .sidebar-toggle {
    display: none;
  }

  .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none !important;
  }

  .layout-with-sidebar main {
    margin-left: var(--sidebar-width);
  }

  .layout-with-sidebar .header {
    left: var(--sidebar-width);
  }

  .layout-with-sidebar .progress-bar {
    left: var(--sidebar-width);
  }

  :root {
    --max-width: 800px;
  }
}

/* Tablet */
@media (min-width: 768px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2.25rem; }

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

  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-section {
    padding: var(--space-2xl);
  }
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-lg { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-xl); }

/* Focus styles for accessibility */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Print styles */
@media print {
  .header, .progress-bar, .step-nav, .theme-toggle {
    display: none;
  }

  main {
    padding-top: 0;
  }
}
