/* Intelligence Room - Inspired by Handshake Portfolio */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-primary: #F5F5F0;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #9B9B9B;
  --border: #E5E5E0;
  --accent: #1A1A1A;
  --accent-light: #E8E8E3;
  --green: #2D5A3D;
  --green-light: #E8F0EA;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Header */
header {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  font-weight: 400;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  gap: 3rem;
  padding: 1.5rem 0;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.stats-bar span {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-bar span::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.filters input,
.filters select {
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.filters input[type="text"] {
  flex: 1;
  min-width: 280px;
}

.filters input::placeholder {
  color: var(--text-muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}

.checkbox-label:hover {
  border-color: var(--accent);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Section Label */
.section-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

/* Articles Grid */
.articles {
  display: grid;
  gap: 1.5rem;
}

/* Article Card */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s;
  position: relative;
}

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

.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.relevance {
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.deep-dive-badge {
  background: var(--green-light);
  color: var(--green);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.article-card h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 400;
  margin-bottom: 0.875rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.summary {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--accent-light);
  color: var(--text-primary);
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 2.5rem;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

.close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.close:hover {
  background: var(--accent-light);
  color: var(--text-primary);
}

/* Article Full View */
.article-full h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0.75rem 0 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.original-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.625rem 1rem;
  background: var(--bg-primary);
  border-radius: 8px;
  margin-bottom: 2rem;
  transition: background 0.2s;
}

.original-link:hover {
  background: var(--accent-light);
}

.section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section h4 {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.section p,
.section li {
  line-height: 1.7;
  color: var(--text-secondary);
}

.section ul {
  padding-left: 1.5rem;
}

.section li {
  margin-bottom: 0.5rem;
}

.context {
  font-style: italic;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
}

/* Empty States */
.loading,
.empty,
.error {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.empty::before {
  content: '📚';
  display: block;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.error {
  color: #C53030;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1.25rem;
  }
  
  header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
  }
  
  .stats-bar {
    flex-direction: column;
    gap: 1rem;
  }
  
  .filters {
    flex-direction: column;
    padding: 1.25rem;
  }
  
  .filters input,
  .filters select {
    width: 100%;
    min-width: auto;
  }
  
  .article-card {
    padding: 1.25rem;
  }
  
  .article-card h3 {
    font-size: 1.25rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
  
  .meta {
    flex-direction: column;
    gap: 0.375rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
