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

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.app {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav {
  background: var(--primary);
  color: white;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.tab {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.tab:hover {
  background: rgba(255,255,255,0.3);
}

.tab.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
}

/* Person Selector */
.person-selector {
  background: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.person-selector label {
  font-weight: 600;
  color: var(--text-light);
}

#person-select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

/* Main Content */
.content {
  flex: 1;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

/* Loading State */
.loading {
  color: var(--text-light);
  font-style: italic;
}

/* Buttons */
button {
  cursor: pointer;
  font-family: inherit;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.button-grid button {
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.button-grid button:hover {
  background: var(--primary-dark);
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.75rem;
  background: white;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

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

/* Resource Grid */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.resource-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: left;
  transition: all 0.2s;
}

.resource-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

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

/* Back Button */
.back-btn {
  background: var(--text-light);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Profile Content */
.profile-section {
  margin-bottom: 1.5rem;
}

.profile-section h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.profile-list {
  list-style: none;
}

.profile-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

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

/* Stats Display */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-item {
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  display: block;
}

.stat-label {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Case Study */
.case-study {
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.case-study h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.case-study .severity {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.severity.critical {
  background: var(--danger);
  color: white;
}

.severity.high {
  background: var(--warning);
  color: white;
}

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

/* Skills List */
.skill-category {
  margin-bottom: 1.5rem;
}

.skill-category h4 {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.skill-item {
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.skill-item h5 {
  margin-bottom: 0.5rem;
}

.skill-steps {
  list-style: decimal;
  margin-left: 1.5rem;
}

.skill-steps li {
  margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .content {
    padding: 0.5rem;
  }

  .card {
    padding: 1rem;
  }

  .nav-header h1 {
    font-size: 1.25rem;
  }

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

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

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.text-muted {
  color: var(--text-light);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--secondary);
}

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