/* Articles Page Layout - Uses unified CSS variables from researcher.scss */
.articles-page {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: fixed;
  top: 5.5rem;
  left: 1.5rem;
  z-index: 101;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle-btn i {
  font-size: 0.9rem;
}

.sidebar-toggle-btn .toggle-text {
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.2);
  background: var(--bg-surface);
  border-color: var(--accent);
}

.sidebar-toggle-btn.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

/* Filter Panel - Floating Sidebar */
.filter-panel {
  position: fixed;
  top: 6rem;
  left: 2rem;
  width: 280px;
  background: var(--bg-elevated);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  transform: translateX(0);
  opacity: 1;
}

.filter-panel.collapsed {
  transform: translateX(calc(-100% - 2rem));
  opacity: 0;
  pointer-events: none;
}

/* Filter Header */
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.filter-header h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.filter-close {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.filter-close:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

/* Filter Stats */
.filter-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: 8px;
}

.filter-stats span {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}

.filter-stats .filtered-articles {
  color: #22c55e;
}

/* Tag Filters */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tag-filter:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.tag-filter.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

.tag-count {
  background: var(--accent-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Clear Filters Button */
.clear-filters {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-filters:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  transform: translateY(-1px);
}

/* Articles Container */
.articles-container {
  flex: 1;
  min-width: 0;
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

.articles-container.sidebar-open {
  margin-left: 320px;
}

/* Articles Header */
.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.articles-header h1 {
  color: var(--text-primary);
  font-size: 2.5rem;
  margin: 0;
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.5s ease;
}

/* Article Card */
.article-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideUp 0.4s ease;
  position: relative;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

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

.article-card.hidden {
  display: none;
}

.article-card.filtering {
  animation: fadeOut 0.3s ease forwards;
}

/* Article Card Content */
.article-card-content {
  padding: 1.5rem;
}

.article-card-header {
  margin-bottom: 1rem;
}

.article-card-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  line-height: 1.4;
}

.article-card-header h3 a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.article-card-header h3 a:hover {
  color: var(--accent-hover);
}

.article-card-header h3 a i {
  font-size: 0.8rem;
  opacity: 0.7;
}

.article-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.article-description {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  opacity: 0.9;
}

/* Article Tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.article-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--accent-muted);
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.article-tag:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent);
  transform: scale(1.05);
}

/* Article Source */
.article-source {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

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

.no-results h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.no-results button {
  background: transparent;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-size: 1rem;
}

/* Mobile Filter Button */
.mobile-filter-btn {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transition: all 0.3s ease;
}

.mobile-filter-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.3);
}

.filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.filter-badge:empty {
  display: none;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .articles-page {
    flex-direction: column;
  }

  .sidebar-toggle-btn {
    top: 5rem;
    left: 1rem;
  }

  .filter-panel {
    top: 6rem;
    left: 1rem;
    width: 260px;
  }

  .articles-container.sidebar-open {
    margin-left: 0;
  }

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

@media (max-width: 768px) {
  .articles-page {
    padding: 1rem;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  .filter-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 199;
    max-height: 70vh;
    opacity: 1;
  }

  .filter-panel.collapsed {
    transform: translateY(100%);
    opacity: 1;
    pointer-events: auto;
  }

  .filter-panel.active {
    transform: translateY(0);
  }

  .mobile-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

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

  .articles-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .articles-header h1 {
    font-size: 2rem;
  }
}

/* Scrollbar Styling */
.filter-panel::-webkit-scrollbar {
  width: 6px;
}

.filter-panel::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

.filter-panel::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
