/* RAID101 Premium Modern Redesign - Version 6.0 */

:root {
  --primary-color: #1D74B3;
  --header-bg: #252525;
  --accent-orange: #ba502f;
  --bg-main: #f3f4f6;
  --text-main: #1f2937;
  --text-dim: #6b7280;
  --panel-bg: #ffffff;
  --panel-border: #e5e7eb;
  --panel-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --panel-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Modern Header */
header {
  background-color: var(--header-bg);
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

header .logo {
  height: 50px;
  width: auto;
}

header .header-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

header .subtitle {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Container & Layout */
.container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* View Toggle - Styled as modern segmented control */
.view-toggle {
  display: inline-flex;
  background-color: white;
  padding: 0.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
}

.view-toggle label {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-toggle input[type="radio"]:checked+span,
.view-toggle label:has(input:checked) {
  background-color: var(--header-bg);
  color: white;
}

.view-toggle input[type="radio"] {
  display: none;
}

/* Category Cards (Horizontal scroll refinement) */
.category-cards {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.category-card {
  background: white;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--panel-shadow-hover);
  border-color: var(--accent-orange);
}

.category-card.active {
  background-color: var(--accent-orange);
  color: white;
  border-color: var(--accent-orange);
}

.category-card .category-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Control Panel (Floating Search & Filters) */
.controls {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  height: fit-content;
}

.search-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
}

.search-box button {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#searchButton {
  background: var(--header-bg);
  color: white;
  border: none;
}

#resetButton {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: var(--text-main);
}

#searchButton:hover {
  background: #333;
}

#resetButton:hover {
  background: #e5e7eb;
}

/* Filter Pill Badges */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-filter {
  padding: 0.375rem 1rem;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.category-filter.active {
  background: var(--accent-orange);
  color: white;
  border-color: var(--accent-orange);
}

/* Modern List View (Feed Style) */
.articles-list {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
  display: none;
}

.article-list-item {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s;
  gap: 1.5rem;
}

.article-list-item:last-child {
  border-bottom: none;
}

.article-list-item:hover {
  background-color: #f9fafb;
}

.article-list-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-orange);
}

.article-list-content {
  flex: 1;
  min-width: 0;
}

.article-list-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.article-list-title a {
  color: var(--header-bg);
  text-decoration: none;
}

.article-list-title a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.article-list-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.article-list-meta .article-author {
  font-weight: 600;
}

.article-list-meta .article-category {
  color: var(--accent-orange);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.article-list-preview {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-list-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Stats Area */
.stats {
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* Article Grid (Panels) */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--panel-shadow-hover);
}

.article-category {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-orange);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: block;
}

.article-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.article-title a {
  color: var(--header-bg);
  text-decoration: none;
}

.article-meta {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
}

.article-author {
  font-weight: 600;
}

.article-preview {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.article-actions {
  display: flex;
  justify-content: flex-end;
}

/* Download/Action Buttons */
.download-btn {
  padding: 0.5rem 1rem;
  background-color: var(--accent-orange);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
}

.download-btn:hover {
  background-color: #a0452a;
  transform: scale(1.02);
}

/* Detailed Article View */
.article-content-wrapper {
  background: white;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: var(--panel-shadow);
  max-width: 900px;
  margin: 0 auto;
}

.category-ribbon {
  background: var(--accent-orange);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 1rem;
}

#articleContent h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--header-bg);
}

.article-meta-horizontal {
  background: #f9fafb;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #f3f4f6;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  display: flex;
  gap: 1.5rem;
}

.article-body {
  font-size: 1.125rem;
  line-height: 1.75;
  color: #374151;
}

.article-body p {
  margin-bottom: 1.5rem;
}

/* Utility States */
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .controls {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .article-content-wrapper {
    padding: 1.5rem;
  }
}