/* SafeKids Parent Portal - Stylesheet */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0d9488;
  --accent: #f59e0b;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header & Nav */
.header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-text h1 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

/* Hero Section */
.hero {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  padding: 3.5rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-content {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: #dbeafe;
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero h2 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 1.75rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-width: 160px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Main Container & Sections */
.main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-block {
  margin-bottom: 3.5rem;
  scroll-margin-top: 5rem;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h3 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

/* Cards & Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Callout Alerts */
.alert-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border-left: 4px solid;
  font-size: 0.92rem;
}

.alert-info {
  background-color: #eff6ff;
  border-color: var(--primary);
  color: #1e40af;
}

.alert-warning {
  background-color: var(--warning-light);
  border-color: var(--warning);
  color: #92400e;
}

.alert-danger {
  background-color: var(--danger-light);
  border-color: var(--danger);
  color: #991b1b;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Filters & Search for Channel Directory */
.filter-bar {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-input-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
}

.search-input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border-color);
  background: var(--bg-alt);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Channel Item Cards */
.channel-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.channel-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.stimulus-tag {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.stimulus-low {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.stimulus-med {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid #fef08a;
}

.stimulus-high {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.channel-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.channel-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tag-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-alt);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

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

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

.btn-outline {
  background: white;
  border-color: var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: var(--bg-alt);
  color: var(--text-main);
}

/* Solution Matrix Table */
.table-wrapper {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th, td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

/* Accordion & Step Guides */
.step-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1.25rem;
}

.step-number {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.step-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.step-body p, .step-body ul {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.step-body ul {
  margin-left: 1.2rem;
  margin-top: 0.35rem;
}

/* Code Snippet Blocks */
.code-block {
  background: #1e293b;
  color: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  position: relative;
  margin: 0.75rem 0;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  border-top: 1px solid #1e293b;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-col {
  flex: 1 1 250px;
}

.footer-col h5 {
  color: white;
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.footer-col p, .footer-col ul {
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul a {
  color: #94a3b8;
  text-decoration: none;
}

.footer-col ul a:hover {
  color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* Can add hamburger menu if needed */
  }
  .hero h2 {
    font-size: 1.75rem;
  }
  .step-card {
    flex-direction: column;
    gap: 0.75rem;
  }
}
