/**
 * AG102 Resources Hub - Page Styles
 * Styling for the resources and references page
 */

/* =========================================================================
   PAGE LAYOUT
   ========================================================================= */

.resources-page {
  min-height: 100vh;
  padding-bottom: 4rem;
}

/* =========================================================================
   HERO SECTION
   ========================================================================= */

.resources-hero {
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(180deg, var(--bg-secondary, #1a1f26) 0%, var(--bg-primary, #0f1419) 100%);
  border-bottom: 1px solid var(--border-color, #2a3441);
}

.resources-hero h1 {
  font-size: 2.25rem;
  color: var(--text-primary, #e8eaed);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.resources-hero .subtitle {
  color: var(--text-muted, #8b949e);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

.resources-hero .description {
  color: var(--text-muted, #8b949e);
  font-size: 0.95rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* =========================================================================
   SEARCH BAR
   ========================================================================= */

.resources-search {
  max-width: 500px;
  margin: 1.5rem auto 0;
  position: relative;
}

.resources-search input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border-color, #2a3441);
  border-radius: 8px;
  color: var(--text-primary, #e8eaed);
  font-size: 1rem;
  transition: all 0.2s;
}

.resources-search input:focus {
  outline: none;
  border-color: var(--accent-green, #2D5A3D);
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.2);
}

.resources-search input::placeholder {
  color: var(--text-muted, #8b949e);
}

.resources-search .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #8b949e);
  pointer-events: none;
}

/* =========================================================================
   FILTER BAR
   ========================================================================= */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary, #1a1f26);
  border-bottom: 1px solid var(--border-color, #2a3441);
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary, #21262d);
  border: 1px solid var(--border-color, #2a3441);
  border-radius: 20px;
  color: var(--text-muted, #8b949e);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
}

.filter-btn:hover {
  background: var(--bg-hover, #30363d);
  color: var(--text-primary, #e8eaed);
  border-color: var(--border-color-hover, #3a4451);
}

.filter-btn.active {
  background: var(--accent-green, #2D5A3D);
  border-color: var(--accent-green, #2D5A3D);
  color: white;
}

/* =========================================================================
   JUMP NAVIGATION
   ========================================================================= */

.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-primary, #0f1419);
  border-bottom: 1px solid var(--border-color, #2a3441);
  font-size: 0.875rem;
  justify-content: center;
  align-items: center;
}

.jump-nav-label {
  color: var(--text-muted, #8b949e);
  margin-right: 0.5rem;
}

.jump-nav a {
  color: var(--accent-gold, #D4A84B);
  text-decoration: none;
  transition: color 0.2s;
}

.jump-nav a:hover {
  color: var(--accent-gold-light, #E5C97A);
  text-decoration: underline;
}

/* =========================================================================
   RESOURCE SECTIONS
   ========================================================================= */

.resources-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.resource-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color, #2a3441);
}

.resource-section:last-child {
  border-bottom: none;
}

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

.section-header h2 {
  font-size: 1.5rem;
  color: var(--text-primary, #e8eaed);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header p {
  color: var(--text-muted, #8b949e);
  font-size: 0.95rem;
}

/* =========================================================================
   RESOURCE GRID
   ========================================================================= */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* =========================================================================
   RESOURCE CARD
   ========================================================================= */

.resource-card {
  background: var(--bg-secondary, #1a1f26);
  border: 1px solid var(--border-color, #2a3441);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.resource-card:hover {
  border-color: var(--border-color-hover, #3a4451);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.resource-card:target,
.resource-card.highlighted {
  border-color: var(--accent-green, #2D5A3D);
  box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.3);
  animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 6px rgba(45, 90, 61, 0.5); }
  100% { box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.3); }
}

.resource-card.featured {
  border-color: var(--accent-gold, #D4A84B);
}

.resource-card.featured::before {
  content: "Featured";
  position: absolute;
  top: -10px;
  right: 1rem;
  background: var(--accent-gold, #D4A84B);
  color: #000;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Card Header */
.resource-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.resource-type-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.resource-type-badge.youtubeExercises {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.resource-type-badge.youtubeAssessments {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.resource-type-badge.research {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.resource-type-badge.organization {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.resource-type-badge.book {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.resource-type-badge.tool {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.resource-type-badge.video {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.resource-type-badge.app {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.resource-type-badge.health {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
}

.resource-type-badge.partner {
  background: rgba(212, 168, 75, 0.15);
  color: var(--accent-gold, #D4A84B);
}

.resource-year {
  color: var(--text-muted, #8b949e);
  font-size: 0.85rem;
}

/* Card Content */
.resource-title {
  font-size: 1.1rem;
  color: var(--text-primary, #e8eaed);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  font-weight: 600;
}

.resource-authors {
  color: var(--text-secondary, #b0b8c1);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.resource-publication {
  color: var(--text-muted, #8b949e);
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.resource-description {
  color: var(--text-secondary, #b0b8c1);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

/* Tags */
.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-tertiary, #21262d);
  border-radius: 4px;
  color: var(--text-muted, #8b949e);
}

/* Used In Links */
.resource-used-in {
  font-size: 0.8rem;
  color: var(--text-muted, #8b949e);
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary, #0f1419);
  border-radius: 6px;
}

.used-in-label {
  margin-right: 0.5rem;
}

.resource-used-in a {
  color: var(--accent-gold, #D4A84B);
  text-decoration: none;
}

.resource-used-in a:hover {
  text-decoration: underline;
}

/* Action Buttons */
.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.action-btn {
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
}

.action-btn.primary {
  background: var(--accent-green, #2D5A3D);
  color: white;
  border: none;
}

.action-btn.primary:hover {
  background: var(--accent-green-hover, #3a7a50);
}

.action-btn.secondary {
  background: transparent;
  color: var(--text-muted, #8b949e);
  border: 1px solid var(--border-color, #2a3441);
}

.action-btn.secondary:hover {
  background: var(--bg-tertiary, #21262d);
  color: var(--text-primary, #e8eaed);
  border-color: var(--border-color-hover, #3a4451);
}

/* Access Badge */
.resource-access {
  margin-top: 0.75rem;
}

.access-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.access-badge.free {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.access-badge.paywall {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.access-badge.freemium {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.access-badge.service {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* =========================================================================
   TOAST NOTIFICATION
   ========================================================================= */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary, #1a1f26);
  color: var(--text-primary, #e8eaed);
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color, #2a3441);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted, #8b949e);
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results h3 {
  color: var(--text-primary, #e8eaed);
  margin-bottom: 0.5rem;
}

/* =========================================================================
   FOOTER
   ========================================================================= */

.resources-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-secondary, #1a1f26);
  border-top: 1px solid var(--border-color, #2a3441);
  margin-top: 2rem;
}

.resources-footer p {
  color: var(--text-muted, #8b949e);
  margin-bottom: 1rem;
}

.resources-footer a {
  color: var(--accent-gold, #D4A84B);
  text-decoration: none;
}

.resources-footer a:hover {
  text-decoration: underline;
}

/* =========================================================================
   MOBILE RESPONSIVE
   ========================================================================= */

@media (max-width: 768px) {
  .resources-hero {
    padding: 2rem 1rem;
  }

  .resources-hero h1 {
    font-size: 1.75rem;
  }

  .filter-bar {
    padding: 0.75rem 1rem;
  }

  .filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .jump-nav {
    display: none;
  }

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

  .resource-card {
    padding: 1.25rem;
  }

  .resource-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .resources-content {
    padding: 0 1rem;
  }

  .resource-section {
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  .resources-hero h1 {
    font-size: 1.5rem;
  }

  .section-header h2 {
    font-size: 1.25rem;
  }

  .filter-bar {
    gap: 0.375rem;
  }

  .filter-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }
}
