/**
 * Stealth Takedown System - Page-specific styles
 * Extends the main styles.css
 */

/* Additional color variables for this page */
:root {
  --accent-green: #2d5a3d;
  --accent-green-bright: #3d7a52;
  --accent-blue: #1e3a5f;
  --accent-orange: #8b4513;
  --bg-card-hover: #1a1a25;
}

/* Module Container - accounts for fixed nav */
.module-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px;
  padding-top: calc(var(--nav-height, 80px) + 40px);
}

/* Module Header - centered title section */
.module-header {
  text-align: center;
  margin-bottom: 80px;
  position: relative;
}

.module-header::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

/* Override breadcrumb padding for this page since we have module-container */
.module-container .breadcrumb {
  padding-top: 0;
  margin-bottom: 40px;
}

/* Page header styling */
.module-header h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--accent-gold) 0%, #e8d78a 50%, var(--accent-gold-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  text-shadow: 0 0 60px rgba(201, 162, 39, 0.3);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  letter-spacing: 0.1em;
}

/* Section Styling */
.module-container section {
  margin-bottom: 60px;
}

.module-container h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.module-container h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 15px;
  letter-spacing: 0.1em;
}

.module-container p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

/* Info Tooltip */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--border-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: var(--accent-gold);
  cursor: help;
  position: relative;
  margin-left: 6px;
  vertical-align: middle;
  transition: all 0.3s ease;
}

.info-icon:hover {
  background: var(--accent-gold);
  color: var(--bg-dark);
  transform: scale(1.1);
}

.info-icon .tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  padding: 15px 20px;
  border-radius: 8px;
  width: 280px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: normal;
  color: var(--text-secondary);
  line-height: 1.6;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  z-index: 100;
}

.info-icon .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--border-accent);
}

.info-icon:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Requirements Cards */
.requirements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.requirement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  transition: all 0.4s ease;
}

.requirement-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.requirement-card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 15px;
}

.requirement-card .icon svg {
  width: 100%;
  height: 100%;
  fill: var(--accent-gold);
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.requirement-card:hover .icon svg {
  opacity: 1;
  transform: scale(1.1);
}

.requirement-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.requirement-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Flow Diagram */
.flow-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 40px;
}

.flow-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.flow-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-gold), var(--accent-orange), var(--accent-red));
  z-index: 0;
}

.flow-step {
  background: var(--bg-dark);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 25px;
  text-align: center;
  position: relative;
  z-index: 1;
  transition: all 0.4s ease;
  cursor: pointer;
  min-width: 140px;
}

.flow-step:nth-child(1) { border-color: var(--accent-green); }
.flow-step:nth-child(2) { border-color: var(--accent-gold); }
.flow-step:nth-child(3) { border-color: var(--accent-orange); }
.flow-step:nth-child(4) { border-color: var(--accent-red); }

.flow-step:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.flow-step:nth-child(1):hover { box-shadow: 0 15px 40px rgba(45, 90, 61, 0.3); }
.flow-step:nth-child(2):hover { box-shadow: 0 15px 40px rgba(201, 162, 39, 0.3); }
.flow-step:nth-child(3):hover { box-shadow: 0 15px 40px rgba(139, 69, 19, 0.3); }
.flow-step:nth-child(4):hover { box-shadow: 0 15px 40px rgba(139, 38, 53, 0.3); }

.flow-step .roll-range {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.flow-step h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.flow-step:nth-child(1) h4 { color: var(--accent-green-bright); }
.flow-step:nth-child(2) h4 { color: var(--accent-gold); }
.flow-step:nth-child(3) h4 { color: #cd853f; }
.flow-step:nth-child(4) h4 { color: var(--accent-red-bright); }

.flow-step .desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Main Resolution Table */
.table-container {
  overflow-x: auto;
  margin-bottom: 40px;
}

.module-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.module-container thead th {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 18px 15px;
  background: linear-gradient(180deg, #1a1a25 0%, #12121a 100%);
  border-bottom: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 0.9rem;
}

.module-container tbody td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: background 0.3s ease;
}

.module-container tbody tr:hover td {
  background: var(--bg-card-hover);
}

.module-container tbody td:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}

.cell-clean { color: var(--accent-green-bright); }
.cell-subdue { color: var(--accent-gold); }
.cell-scramble { color: #cd853f; }
.cell-fail { color: var(--accent-red-bright); }
.cell-na { color: var(--text-dim); }

/* Subdue Dice Section */
.subdue-formula {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 30px 40px;
  text-align: center;
  margin-bottom: 30px;
}

.subdue-formula .formula {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent-gold);
  margin-bottom: 15px;
}

.subdue-formula .explanation {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Subdue Dice Table */
.subdue-table-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.subdue-column {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.subdue-column table {
  font-size: 0.9rem;
}

.subdue-column thead th {
  padding: 14px 12px;
  font-size: 0.8rem;
}

.subdue-column tbody td {
  padding: 10px 12px;
  font-size: 0.9rem;
}

/* Alert States */
.alert-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  margin-bottom: 40px;
}

.alert-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.alert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.alert-card.unaware::before { background: #2d5a3d; }
.alert-card.alert::before { background: #3d6a8a; }
.alert-card.suspicious::before { background: var(--accent-gold); }
.alert-card.searching::before { background: var(--accent-orange); }
.alert-card.lockdown::before { background: var(--accent-red); }

.alert-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-accent);
}

.alert-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.alert-card.unaware h4 { color: var(--accent-green-bright); }
.alert-card.alert h4 { color: #5a9abf; }
.alert-card.suspicious h4 { color: var(--accent-gold); }
.alert-card.searching h4 { color: #cd853f; }
.alert-card.lockdown h4 { color: var(--accent-red-bright); }

.alert-card .modifier {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  display: inline-block;
}

.alert-card .desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Scramble Options */
.scramble-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.scramble-option {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 25px;
  transition: all 0.4s ease;
}

.scramble-option:hover {
  border-color: var(--border-accent);
  transform: translateX(5px);
}

.scramble-option h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.scramble-option .mechanic {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.scramble-option p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Class Table */
.class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.class-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px;
  transition: all 0.3s ease;
}

.class-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.class-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.class-card .mod {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.class-card .flavour {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Exclusions */
.exclusion-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.exclusion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.exclusion-item .x-icon {
  color: var(--accent-red);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Quick Reference */
.quick-ref {
  background: linear-gradient(135deg, var(--bg-card) 0%, #1a1520 100%);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.quick-ref-item h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quick-ref-item p {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0;
}

/* Why This Exists Section */
.why-section {
  margin-bottom: 80px;
}

.why-narrative {
  background: linear-gradient(135deg, rgba(15, 15, 20, 0.8), rgba(10, 10, 15, 0.9));
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 12px 12px 0;
  padding: 40px 45px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.why-narrative::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 0% 0%, rgba(201, 162, 39, 0.05), transparent 50%);
  pointer-events: none;
}

.why-narrative p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  position: relative;
}

.why-narrative p:last-child {
  margin-bottom: 0;
}

.why-narrative .scenario-intro {
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.why-narrative .highlight-line {
  color: var(--text-primary);
  font-weight: 500;
}

.why-narrative .math-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 20px 25px;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.why-narrative .math-block .label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.why-narrative .math-block .value {
  color: var(--accent-gold);
}

.why-narrative .math-block .result {
  color: var(--accent-red-bright);
  font-weight: 600;
}

.why-narrative .dramatic {
  font-size: 1.15rem;
  color: var(--text-primary);
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin: 2rem 0;
  font-style: italic;
}

.why-narrative .punchline {
  font-size: 1.2rem;
  color: var(--accent-gold);
  font-weight: 600;
  text-align: center;
  margin-top: 1.5rem;
}

.why-explanation h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent-gold);
  margin-bottom: 20px;
  letter-spacing: 0.08em;
}

.why-explanation p {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.why-explanation p:last-child {
  margin-bottom: 0;
}

.why-explanation .extreme-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin: 2rem 0;
}

.why-explanation .extreme {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 25px;
}

.why-explanation .extreme h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.why-explanation .extreme p {
  font-size: 1rem;
  margin-bottom: 0;
}

.why-explanation .solution-summary {
  background: linear-gradient(135deg, var(--bg-card), rgba(201, 162, 39, 0.05));
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 30px 35px;
  margin-top: 2rem;
}

.why-explanation .solution-summary p {
  margin-bottom: 1rem;
}

.why-explanation .solution-summary p:last-child {
  margin-bottom: 0;
}

.why-explanation .final-note {
  text-align: center;
  font-size: 1.15rem;
  color: var(--text-primary);
  font-style: italic;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* Download Button */
.btn-download {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

/* Download Modal */
.download-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.download-modal.active {
  opacity: 1;
  visibility: visible;
}

.download-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.download-modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(25, 25, 35, 0.98), rgba(15, 15, 25, 0.98));
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.download-modal.active .download-modal-content {
  transform: scale(1) translateY(0);
}

.download-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.download-modal-close:hover {
  color: var(--text-primary);
}

.download-modal-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.download-modal-subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.download-modal-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.download-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.download-option-support {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.download-option-support:hover {
  background: rgba(201, 162, 39, 0.1);
  border-color: rgba(201, 162, 39, 0.3);
}

.download-option-free {
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.download-option-free:hover {
  background: rgba(201, 162, 39, 0.2);
  border-color: rgba(201, 162, 39, 0.5);
}

.download-option-icon {
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.download-option-text {
  text-align: left;
}

.download-option-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.download-option-text small {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.download-modal-note {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.7;
}

/* Module Footer */
.module-footer {
  text-align: center;
  padding-top: 60px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 60px;
}

.module-footer p {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Responsive */
@media (max-width: 1024px) {
  .requirements-grid { grid-template-columns: 1fr; }
  .flow-steps { flex-direction: column; gap: 20px; }
  .flow-steps::before { display: none; }
  .alert-grid { grid-template-columns: repeat(2, 1fr); }
  .subdue-table-container { grid-template-columns: 1fr; }
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-ref { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .why-narrative {
    padding: 30px 25px;
  }
  .why-explanation .extreme-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .module-header h1 { font-size: 2rem; letter-spacing: 0.15em; }
  .module-container { padding: 30px 20px; }
  .scramble-grid { grid-template-columns: 1fr; }
  .exclusion-list { grid-template-columns: 1fr; }
  .class-grid { grid-template-columns: 1fr; }
}
