/* KeenSec Resources Hub & Research Library Styling
   Aligned to Main Index Page Design System
*/

.resources-page {
  width: 100%;
}

/* ==========================================================================
   1. Showcase Preview Elements (Within Centered Hero)
   ========================================================================== */

.res-showcase-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  gap: 8px;
  overflow-x: auto;
}

.res-stab {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.res-stab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.res-stab.active {
  color: #ffffff;
  background: rgba(51, 113, 255, 0.18);
  border-color: rgba(51, 113, 255, 0.4);
  box-shadow: 0 0 16px rgba(51, 113, 255, 0.25);
}

.res-spanel {
  padding: 24px;
}

.res-spanel[hidden] {
  display: none;
}

.res-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.res-metric-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.res-met-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.res-met-val {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.2;
}

.res-met-val.green { color: #10b981; }
.res-met-val.cyan { color: #06b6d4; }
.res-met-val.purple { color: #a855f7; }
.res-met-val.blue { color: #3b82f6; }
.res-met-val.amber { color: #f59e0b; }

.res-met-sub {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.35;
}

.res-code-block {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.res-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.res-code-badge {
  background: rgba(51, 113, 255, 0.15);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.res-code-block pre {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #cbd5e1;
  overflow-x: auto;
}

.res-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 12px;
}

.res-ft-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.res-ft-link {
  color: #60a5fa;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.res-ft-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* ==========================================================================
   2. Interactive Research Workbench (Dark Story Band)
   ========================================================================== */

.res-preset-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.res-bar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 6px;
}

.res-preset-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.res-preset-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

.res-preset-btn.active {
  background: rgba(51, 113, 255, 0.15);
  border-color: rgba(51, 113, 255, 0.45);
  box-shadow: 0 0 16px rgba(51, 113, 255, 0.2);
  color: #ffffff;
}

.res-pdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: absolute;
  top: 10px;
  right: 10px;
}

.res-pdot.purple { background: #a855f7; box-shadow: 0 0 8px #a855f7; }
.res-pdot.blue { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.res-pdot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.res-pdot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.res-pdot.cyan { background: #06b6d4; box-shadow: 0 0 8px #06b6d4; }
.res-pdot.amber { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

.res-pbtn-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.res-pbtn-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.res-search-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.res-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.res-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.res-search-field {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.res-search-field:focus {
  border-color: #3b82f6;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.res-search-field::placeholder {
  color: #94a3b8;
}

.res-search-stats {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}

/* Dual Workbench Layout */
.res-dual-workbench {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
}

.res-pane {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.res-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.res-pane-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.res-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.res-pill.live {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.res-badge-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #60a5fa;
  letter-spacing: 0.06em;
}

/* Notes Selection List */
.res-notes-nav {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
}

.res-note-item {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: inherit;
}

.res-note-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(3px);
}

.res-note-item.active {
  background: rgba(51, 113, 255, 0.14);
  border-color: rgba(51, 113, 255, 0.45);
  box-shadow: 0 0 20px rgba(51, 113, 255, 0.2);
}

.res-note-item[hidden] {
  display: none !important;
}

.res-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.res-item-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.res-cat-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.res-cat-tag.cat-hr { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.res-cat-tag.cat-meas { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.res-cat-tag.cat-ta { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.res-cat-tag.cat-sim { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.res-cat-tag.cat-aware { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.res-time-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
  margin-left: auto;
}

.res-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.35;
  margin: 0 0 6px;
}

.res-item-sub {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

/* Inspector Pane */
.res-inspect-body {
  padding: 28px;
}

.res-inspect-header {
  margin-bottom: 24px;
}

.res-inspect-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 8px;
}

.res-inspect-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 10px;
}

.res-inspect-lead {
  font-size: 15px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

/* Thesis Card */
.res-thesis-card {
  background: rgba(30, 41, 59, 0.5);
  border-left: 3px solid #3b82f6;
  border-radius: 0 10px 10px 0;
  padding: 18px 22px;
  margin-bottom: 24px;
}

.res-thesis-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #60a5fa;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.res-thesis-card p {
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
  font-style: italic;
}

/* Checklist Block */
.res-checklist-block {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

.res-block-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 14px;
}

.res-checklist-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.res-checklist-items li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.45;
}

.res-checklist-items li strong {
  color: #ffffff;
}

.check-icon {
  color: #10b981;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

/* Telemetry Formula */
.res-telemetry-formula {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.res-formula-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.formula-tag {
  background: rgba(51, 113, 255, 0.15);
  color: #60a5fa;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.res-formula-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #38bdf8;
  margin: 0;
  line-height: 1.5;
}

/* Action Bar */
.res-inspect-action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   3. Complete Field Notes Grid (Light Mode Main System)
   ========================================================================== */

.resource-library {
  padding-top: 80px;
  padding-bottom: 80px;
}

.res-grid-header {
  margin-bottom: 32px;
}

.res-grid-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 680px;
  margin-top: 8px;
}

.res-search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.search-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.res-search-input-wrap input {
  width: 100%;
  padding-left: 42px !important;
  max-width: none !important;
}

/* Modern Card Grid Layout */
.resource-results {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
  gap: 28px !important;
  margin-top: 24px;
}

.res-card-modern {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.res-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.res-card-modern[hidden] {
  display: none !important;
}

.res-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.res-card-top .resource-number {
  font-size: 38px;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1;
}

.res-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.res-card-meta .mono {
  font-size: 11px;
  color: var(--accent-ink);
  letter-spacing: 0.06em;
  font-weight: 600;
}

.res-reading-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-sunken);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.res-card-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.res-card-main h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px;
  color: var(--text-heading);
}

.res-card-main h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.res-card-main h2 a:hover {
  color: var(--accent-ink);
}

.res-card-main p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 20px;
}

.res-card-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text);
}

.res-card-bullets li {
  position: relative;
  padding-left: 16px;
  line-height: 1.45;
}

.res-card-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.res-card-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.res-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
  transition: all 0.15s ease;
}

.res-read-btn:hover {
  color: var(--blue-hover);
  gap: 10px;
}

.res-platform-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.res-platform-link:hover {
  color: var(--text-heading);
}

/* ==========================================================================
   4. Research Methodology Matrix (6 Light Cards)
   ========================================================================== */

.res-methodology-section {
  padding-top: 40px;
  padding-bottom: 80px;
}

.res-standards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.res-standard-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.res-standard-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.res-std-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-subtle);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.res-standard-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text-heading);
}

.res-standard-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   5. NIST Reference Section
   ========================================================================== */

.res-nist-section {
  padding-top: 20px;
  padding-bottom: 80px;
}

.res-nist-card {
  background: linear-gradient(135deg, var(--bg-raised) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

.res-nist-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.res-nist-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}

.res-nist-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text-heading);
}

.res-nist-content p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 760px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 980px) {
  .res-dual-workbench {
    grid-template-columns: 1fr;
  }

  .res-nist-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .res-grid-2col {
    grid-template-columns: 1fr;
  }

  .res-standards-grid {
    grid-template-columns: 1fr;
  }

  .resource-results {
    grid-template-columns: 1fr !important;
  }

  .res-preset-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .res-preset-btn {
    width: 100%;
  }
}
