/* TTRPG News Trawler Design System */
/* Uses unified color system from styles.css */

:root {
  /* Map to main design system colors from styles.css */
  --color-background: var(--bg-primary);
  --color-surface: var(--bg-secondary);
  --color-text: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-primary: var(--accent-primary);
  --color-primary-hover: var(--accent-primary-hover);
  --color-border: var(--border-color);
  --color-card-bg: var(--glass-bg);
  --color-card-border: var(--glass-border);
  
  /* RGB versions for opacity control (derived from main colors) */
  --color-gray-400-rgb: 119, 124, 124;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;
  --color-teal-500-rgb: 33, 128, 141;
  
  /* Additional news-specific colors that don't map directly */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-red-400: var(--accent-crimson);
  --color-orange-400: var(--accent-orange);

  /* Typography */
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;

  /* Spacing */
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --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);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
}

/* News Container */
.news-container {
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family-base);
}

/* Hamburger Menu */
.hamburger-menu {
  position: fixed;
  top: var(--space-20);
  left: var(--space-20);
  z-index: 1000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  padding: var(--space-12);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all var(--duration-normal) var(--ease-standard);
}

.hamburger-menu span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--duration-normal) var(--ease-standard);
}

.hamburger-menu:hover {
  background: rgba(var(--color-teal-300-rgb), 0.1);
  border-color: var(--color-primary);
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation Sidebar */
.nav-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  transform: translateX(-100%);
  transition: transform var(--duration-normal) var(--ease-standard);
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.nav-sidebar.active {
  transform: translateX(0);
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-24);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.nav-header h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0;
}

.nav-close {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 32px;
  cursor: pointer;
  padding: var(--space-8);
  line-height: 1;
  transition: all var(--duration-fast) var(--ease-standard);
}

.nav-close:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

.nav-list {
  list-style: none;
  padding: var(--space-24);
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.nav-list li {
  margin-bottom: var(--space-8);
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-base);
  transition: all var(--duration-fast) var(--ease-standard);
}

.nav-list a:hover {
  background: rgba(var(--color-teal-300-rgb), 0.1);
  color: var(--color-primary);
}

.nav-list i {
  width: 20px;
  text-align: center;
}

.nav-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-16) 0;
}

/* Navigation Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-standard);
  z-index: 998;
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Main Content */
.news-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-24) var(--space-32) var(--space-32);
}

/* News Controls (Search, Filter, Sort) */
.news-controls {
  background: var(--color-card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-20);
  margin-bottom: var(--space-32);
  box-shadow: var(--shadow-md);
}

.controls-row {
  display: flex;
  gap: var(--space-16);
  margin-bottom: var(--space-16);
  align-items: center;
  flex-wrap: wrap;
}

/* Search Input */
.search-container {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: var(--space-12);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-12) var(--space-12) var(--space-12) 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  transition: all var(--duration-normal) var(--ease-standard);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-teal-300-rgb), 0.1);
}

.search-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/* Sort Dropdown */
.sort-container {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.sort-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin: 0;
  white-space: nowrap;
}

.sort-select {
  padding: var(--space-8) var(--space-12);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-base);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  min-width: 140px;
}

.sort-select:hover {
  border-color: var(--color-primary);
}

.sort-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-teal-300-rgb), 0.1);
}

/* Filter Buttons */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.filter-btn {
  padding: var(--space-8) var(--space-16);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family-base);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  white-space: nowrap;
}

.filter-btn i {
  font-size: 12px;
}

.filter-btn:hover {
  background: rgba(var(--color-teal-300-rgb), 0.1);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(var(--color-teal-300-rgb), 0.3);
}

.filter-btn.active i {
  color: var(--color-white);
}

/* Header - HIDDEN per user request */
.news-header {
  display: none;
}

.header-controls {
  display: flex;
  gap: var(--space-16);
  justify-content: center;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto;
}

.date-selector,
.search-box {
  flex: 1;
  min-width: 200px;
}

.date-selector label {
  display: block;
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* Form Controls */
.form-control {
  width: 100%;
  padding: var(--space-8) var(--space-12);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  color: var(--color-text);
  font-size: var(--font-size-base);
  transition: border-color var(--duration-fast) var(--ease-standard);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

select.form-control {
  cursor: pointer;
}

/* Filters Section - HIDDEN per user request */
.filters-section {
  display: none;
}

.category-filters {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.filter-btn {
  padding: var(--space-4) var(--space-12);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  font-weight: 500;
}

.filter-btn:hover {
  background: rgba(var(--color-teal-300-rgb), 0.1);
  border-color: var(--color-primary);
}

.filter-btn.active {
  background: var(--color-primary);
  color: var(--color-charcoal-800);
  border-color: var(--color-primary);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.sort-controls label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.sort-controls select {
  min-width: 150px;
}

/* News Sections */
.news-section {
  margin-bottom: var(--space-12);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-20);
}

.section-header h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin: 0;
}

.collapse-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  color: var(--color-text);
  font-size: var(--font-size-2xl);
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
}

.collapse-btn:hover {
  background: rgba(var(--color-teal-300-rgb), 0.1);
  border-color: var(--color-primary);
}

.section-content {
  transition: all var(--duration-normal) var(--ease-standard);
}

.section-content.collapsed {
  max-height: 0;
  overflow: hidden;
}

/* News Grid - UNIFORM HEIGHT FOR ALL CARDS */
.news-grid,
.crowdfunding-grid,
.releases-grid,
.streaming-grid,
.creators-grid,
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-12);
  grid-auto-flow: dense;
}

.news-card,
.crowdfunding-card,
.release-card,
.streaming-card,
.creator-card,
.trend-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 0;
  padding: 0;
  transition: all var(--duration-normal) var(--ease-standard);
  display: flex;
  flex-direction: column;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  min-height: 280px;
  overflow: hidden;
  position: relative;
}

.news-card:hover,
.crowdfunding-card:hover,
.release-card:hover,
.streaming-card:hover,
.creator-card:hover,
.trend-card:hover {
  border-color: var(--color-primary);
  background: rgba(var(--color-teal-300-rgb), 0.05);
  transform: translateY(-2px);
  color: var(--color-text);
  text-decoration: none;
}

.news-card h3,
.crowdfunding-card h3,
.release-card h3,
.streaming-card h3,
.creator-card h3,
.trend-card h3 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

/* Article images */
.article-image {
  width: 100%;
  height: 240px;
  object-fit: contain;
  object-position: center;
  padding: var(--space-16);
  display: block;
  background: var(--color-surface);
  flex-shrink: 0;
}

/* Promo card images - proper aspect ratio for portrait covers */
.news-card.is-promo .article-image {
  height: 240px;
  object-fit: contain;
  object-position: center;
  padding: var(--space-12);
  background: linear-gradient(135deg, rgba(50, 184, 198, 0.05), rgba(74, 173, 184, 0.02));
}

.news-card .card-content,
.crowdfunding-card .card-content,
.release-card .card-content,
.streaming-card .card-content,
.creator-card .card-content,
.trend-card .card-content {
  padding: var(--space-8);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Add spotlight grid to handle images better */
.spotlight-grid,
.news-grid,
.crowdfunding-grid,
.releases-grid,
.streaming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-12);
  grid-auto-flow: dense;
}

.news-meta {
  display: none;
}

.news-summary {
  display: none;
}

/* Promotional Badge Styling */
.promo-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-teal-500));
  color: var(--color-charcoal-800);
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  padding: 4px 10px;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.news-card.is-promo {
  border-color: rgba(var(--color-teal-300-rgb), 0.4);
}

.news-card.is-promo:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(var(--color-teal-300-rgb), 0.2);
}

/* Generator Tools Reference */
.generators-reference {
  margin-top: var(--space-32);
  padding-top: var(--space-32);
  border-top: 2px solid var(--color-border);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-20);
  margin-top: var(--space-20);
}

.tool-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: var(--space-24);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--duration-normal) var(--ease-standard);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tool-card:hover {
  border-color: var(--color-primary);
  background: rgba(var(--color-teal-300-rgb), 0.1);
  transform: translateY(-2px);
}

.tool-card i {
  font-size: 40px;
  color: var(--color-primary);
  margin-bottom: var(--space-16);
}

.tool-card h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.tool-card p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

/* Sidebar */
.news-sidebar {
  margin-top: var(--space-32);
}

.sidebar-section {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: var(--space-20);
  margin-bottom: var(--space-20);
}

.sidebar-section h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-16);
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.activity-item {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.tag {
  display: inline-block;
  padding: var(--space-6) var(--space-12);
  background: rgba(var(--color-teal-300-rgb), 0.15);
  border: 1px solid rgba(var(--color-teal-300-rgb), 0.3);
  border-radius: var(--radius-base);
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  text-decoration: none;
}

.tag:hover {
  background: rgba(var(--color-teal-300-rgb), 0.35);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(50, 184, 198, 0.3);
  color: var(--color-teal-300);
}

.trending-tag-link {
  position: relative;
}

.trending-tag-link::after {
  content: "→";
  margin-left: 6px;
  opacity: 0;
  transition: all var(--duration-fast) var(--ease-standard);
}

.trending-tag-link:hover::after {
  opacity: 1;
  margin-left: 8px;
}

/* Category Sticky Tabs - Comic Book Style */
.section-category-tab {
  position: sticky;
  top: 100px;
  float: left;
  margin-left: -50px;
  margin-right: 10px;
  width: 40px;
  height: 240px;
  background: linear-gradient(135deg, rgba(50, 184, 198, 0.9), rgba(74, 173, 184, 0.9));
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-charcoal-800);
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.section-category-tab:hover {
  width: 50px;
  margin-left: -60px;
  box-shadow: 4px 4px 12px rgba(50, 184, 198, 0.5);
}

/* Tier Badges */
.tier-badge {
  display: block;
  font-size: 0.5rem;
  font-weight: 600;
  padding: 2px 4px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* Category Descriptions */
.category-description {
  font-size: 0.85rem;
  color: var(--color-teal-200);
  margin-bottom: var(--space-16);
  padding: var(--space-12);
  background: rgba(50, 184, 198, 0.1);
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  font-style: italic;
}

/* Category-specific colors - Tier 1 (Daily Priority) */
.tab-dnd-official {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(220, 50, 50, 0.9));
}

.tab-crowdfunding {
  background: linear-gradient(135deg, rgba(255, 195, 113, 0.9), rgba(255, 159, 64, 0.9));
}

.tab-streaming {
  background: linear-gradient(135deg, rgba(170, 128, 252, 0.9), rgba(132, 94, 194, 0.9));
}

/* Tier 2 (Weekly Priority) */
.tab-industry {
  background: linear-gradient(135deg, rgba(74, 173, 184, 0.9), rgba(50, 184, 198, 0.9));
}

.tab-alt-systems {
  background: linear-gradient(135deg, rgba(149, 175, 192, 0.9), rgba(100, 130, 150, 0.9));
}

.tab-digital {
  background: linear-gradient(135deg, rgba(126, 214, 223, 0.9), rgba(80, 180, 200, 0.9));
}

.tab-professional {
  background: linear-gradient(135deg, rgba(100, 210, 150, 0.9), rgba(70, 180, 120, 0.9));
}

/* Tier 3 (Bi-weekly Priority) */
.tab-publisher {
  background: linear-gradient(135deg, rgba(200, 160, 255, 0.9), rgba(160, 120, 230, 0.9));
}

.tab-retail {
  background: linear-gradient(135deg, rgba(180, 150, 120, 0.9), rgba(140, 110, 80, 0.9));
}

.tab-events {
  background: linear-gradient(135deg, rgba(255, 220, 100, 0.9), rgba(230, 180, 60, 0.9));
}

.tab-community {
  background: linear-gradient(135deg, rgba(130, 200, 230, 0.9), rgba(90, 160, 200, 0.9));
}

.tab-education {
  background: linear-gradient(135deg, rgba(220, 180, 140, 0.9), rgba(180, 140, 100, 0.9));
}

.news-section {
  position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
  .news-main {
    padding: var(--space-16);
  }
  
  /* Mobile-optimized controls */
  .news-controls {
    padding: var(--space-16);
  }
  
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-container {
    width: 100%;
  }
  
  .sort-container {
    width: 100%;
    justify-content: space-between;
  }
  
  .sort-select {
    flex: 1;
    max-width: 200px;
  }
  
  .filter-buttons {
    gap: var(--space-6);
  }
  
  .filter-btn {
    font-size: 11px;
    padding: var(--space-6) var(--space-12);
  }
  
  .filter-btn i {
    display: none; /* Hide icons on mobile to save space */
  }
  
  .section-category-tab {
    width: 32px;
    height: 200px;
    font-size: 0.6rem;
    margin-left: -42px;
  }

  .news-header h1 {
    font-size: var(--font-size-3xl);
  }

  .header-controls {
    flex-direction: column;
  }

  .filters-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-grid,
  .tools-grid {
    grid-template-columns: 1fr;
  }
}
