/* Academy Section Styles */

.academy-listing,
.academy-article,
.academy-glossary {
  padding: 2rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.academy-header,
.article-header,
.glossary-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  justify-content: center;
  position: relative;
  z-index: 1; /* Lower z-index than language dropdown */
}

.academy-header h1,
.article-header h1,
.glossary-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-head);
  text-align: left;
}

.academy-header {
  position: relative;
}

.academy-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
}

.academy-header-content {
  flex: 1;
}

.glossary-link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--action-blue, #0066cc);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}

.glossary-link:hover {
  background: var(--action-blue-hover, #0052a3);
  color: white;
}

.academy-subtitle,
.glossary-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 800px;
  font-weight: 400;
  text-align: left;
}

.academy-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
}

.search-box button {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.filters select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
  font-size: 0.9rem;
  margin-top: 1.75rem;
}

.skill-level-filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-soft, #f5f5f5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  min-width: 200px;
}

.skill-level-filters-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-head);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.skill-level-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-level-filter {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.skill-level-filter:hover {
  background: var(--action-blue, #0066cc);
  color: white;
  border-color: var(--action-blue, #0066cc);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.skill-level-filter input {
  margin-right: 0.5rem;
}

.tag-filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-soft, #f5f5f5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  flex: 1;
  min-width: 300px;
  max-width: 100%;
  overflow: visible;
  transition: all 0.3s ease;
}

.tag-filters-wrapper.collapsed {
  max-height: fit-content;
}

.tag-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.tag-filters-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-head);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-filters-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.3s ease, color 0.2s ease;
  border-radius: 0.25rem;
  width: 24px;
  height: 24px;
}

.tag-filters-toggle:hover {
  color: var(--action-blue, #0066cc);
  background: rgba(0, 102, 204, 0.1);
}

.tag-filters-toggle[aria-expanded="false"] .toggle-icon {
  transform: rotate(180deg);
}

.toggle-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  width: 100%;
  max-height: none;
  overflow: visible;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.tag-filters-wrapper.collapsed .tag-filters {
  max-height: 60px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
}

.tag-filter-hidden {
  display: none !important;
}

.tag-filters-wrapper.collapsed .tag-filter-hidden {
  display: none !important;
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
  height: fit-content;
  box-sizing: border-box;
}

.tag-filter:hover {
  background: var(--action-blue, #0066cc);
  color: white;
  border-color: var(--action-blue, #0066cc);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tag-filter input[type="checkbox"] {
  margin: 0;
  margin-right: 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--action-blue, #0066cc);
}

.tag-filter span {
  display: inline-block;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

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

.article-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  position: relative;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(var(--action-blue-rgb, 0, 102, 204), 0.05) 0%, rgba(var(--action-blue-rgb, 0, 102, 204), 0) 100%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.article-card-link:hover .article-card {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--action-blue, #0066cc);
}

.article-card-link:hover .article-card::before {
  opacity: 1;
}

.article-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.article-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-head);
  font-weight: 600;
  line-height: 1.3;
}

.article-card-link:hover .article-card-title {
  color: var(--action-blue, #0066cc);
}

.article-card-summary {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.9rem;
  position: relative;
  min-height: 6em;
  max-height: 6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.article-card-summary::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3em;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 40%, var(--card-bg, var(--bg, white)) 100%);
  pointer-events: none;
}

.article-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: auto;
}

.article-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.read-more-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--action-blue, #0066cc);
  font-size: 0.9rem;
  font-weight: 600;
  transition: gap 0.3s, color 0.2s;
}

.article-card-link:hover .read-more-indicator {
  gap: 0.75rem;
  color: var(--action-blue-hover, var(--action-blue, #0052a3));
}

.read-more-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.article-card-link:hover .read-more-arrow {
  transform: translateX(4px);
}

.read-more-text {
  white-space: nowrap;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-level-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-level-badge.skill-level-basic {
  background: #e3f2fd;
  color: #1976d2;
}

.skill-level-badge.skill-level-intermediate {
  background: #fff3e0;
  color: #f57c00;
}

.skill-level-badge.skill-level-expert {
  background: #fce4ec;
  color: #c2185b;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
}

.tag:hover {
  background: var(--action-blue);
  color: white;
}

.article-breadcrumb,
.glossary-breadcrumb {
  margin-bottom: 1rem;
}

.article-breadcrumb a,
.glossary-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.article-breadcrumb a:hover,
.glossary-breadcrumb a:hover {
  color: var(--action-blue);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.article-summary {
  background: var(--bg-soft);
  padding: 1rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.article-summary strong {
  display: block;
  margin-bottom: 0.5rem;
}

.article-search-box,
.glossary-search-box {
  position: relative;
  margin-bottom: 2rem;
}

.article-search-box input,
.glossary-search-box input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
}

.article-search-box button,
.glossary-search-box button {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.article-content {
  line-height: 1.8;
}

.article-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}

.article-content a.glossary-term,
.glossary-content a.article-link {
  color: var(--action-blue);
  text-decoration: underline;
  font-weight: 500;
}

.glossary-content a.article-link:hover {
  color: var(--action-blue-hover, #0052a3);
  text-decoration: underline;
}

.article-content mark {
  background: var(--gold-accent);
  color: var(--text-head);
  padding: 0.1rem 0.2rem;
}

.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-articles h2 {
  margin-bottom: 1.5rem;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.related-article-card {
  padding: 1rem;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
}

.related-article-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.related-article-card a {
  color: var(--text-head);
  text-decoration: none;
}

.related-article-card a:hover {
  color: var(--action-blue);
}

.glossary-content {
  line-height: 1.8;
}

.glossary-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--action-blue);
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
}

.glossary-content h2.glossary-term-highlighted {
  background: var(--gold-accent, #F09E00);
  color: var(--text-head, #0B2846);
  box-shadow: 0 0 20px rgba(240, 158, 0, 0.5);
  transform: scale(1.02);
  animation: glossary-highlight-pulse 0.5s ease-in-out;
}

@keyframes glossary-highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 158, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(240, 158, 0, 0.3);
  }
  100% {
    box-shadow: 0 0 20px 5px rgba(240, 158, 0, 0.5);
  }
}

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

.search-results,
.glossary-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
  
  .related-articles-grid {
    grid-template-columns: 1fr;
  }
  
  .academy-controls {
    flex-direction: column;
  }
}

