/* =============================================================================
   ALGOFAIRNESS PROJECT PAGE STYLES
   Specific styles for the dissertation case study page
   ============================================================================= */

/* Hero styling */
.algofairness-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
}

/* Content warning - large version */
.content-warning-section {
  padding: var(--space-8) 0;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

body.dark-mode .content-warning-section {
  background: linear-gradient(135deg, #422006 0%, #78350f 100%);
}

.content-warning.large {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #f59e0b;
}

body.dark-mode .content-warning.large {
  background: rgba(0, 0, 0, 0.4);
  border-color: #d97706;
}

.content-warning.large .content-warning-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.content-warning.large p {
  font-size: var(--text-base);
  line-height: 1.7;
  margin: 0;
  color: #92400e;
}

body.dark-mode .content-warning.large p {
  color: #fcd34d;
}

/* Research questions */
.research-questions {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary-color);
}

body.dark-mode .research-questions {
  background: rgba(255, 255, 255, 0.05);
}

.research-questions h3 {
  margin-bottom: var(--space-4);
  color: var(--primary-color);
}

.research-questions ol {
  margin: 0;
  padding-left: var(--space-6);
}

.research-questions li {
  margin-bottom: var(--space-3);
  line-height: 1.6;
}

/* Figure showcase - main figures */
.figure-showcase {
  margin: var(--space-8) 0;
}

.figure-main {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  overflow: hidden;
}

body.dark-mode .figure-main {
  background: rgba(0, 0, 0, 0.3);
}

.research-figure {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

.research-figure.clickable {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.research-figure.clickable:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

.figure-caption {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--gray-700);
}

body.dark-mode .figure-caption {
  background: rgba(255, 255, 255, 0.05);
  color: var(--gray-300);
}

/* Figure grid - multiple figures */
.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.figure-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

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

.figure-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .figure-item {
  background: rgba(255, 255, 255, 0.05);
}

.figure-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.figure-item .research-figure {
  border-radius: 0;
}

.figure-item .figure-caption {
  margin: 0;
  border-radius: 0;
  background: transparent;
  padding: var(--space-4);
  border-top: 1px solid var(--gray-200);
}

body.dark-mode .figure-item .figure-caption {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Interpretation boxes */
.interpretation {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
  border-left: 4px solid #10b981;
}

body.dark-mode .interpretation {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(16, 185, 129, 0.05) 100%
  );
}

.interpretation h3 {
  color: #065f46;
  margin-bottom: var(--space-4);
}

body.dark-mode .interpretation h3 {
  color: #34d399;
}

.interpretation ul {
  margin: 0;
  padding-left: var(--space-6);
}

.interpretation li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

/* Findings table enhancements */
.findings-table-container {
  margin: var(--space-8) 0;
  overflow-x: auto;
}

.findings-table-container h3 {
  margin-bottom: var(--space-4);
}

.highlight-row {
  background: rgba(139, 92, 246, 0.1) !important;
}

body.dark-mode .highlight-row {
  background: rgba(139, 92, 246, 0.2) !important;
}

/* Mitigation stages */
.mitigation-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

@media (max-width: 900px) {
  .mitigation-stages {
    grid-template-columns: 1fr;
  }
}

.stage-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

body.dark-mode .stage-card {
  background: rgba(255, 255, 255, 0.05);
}

.stage-header {
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.stage-header.pre {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.stage-header.in {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.stage-header.post {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
}

body.dark-mode .stage-header.pre {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.3) 0%,
    rgba(59, 130, 246, 0.2) 100%
  );
}

body.dark-mode .stage-header.in {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.3) 0%,
    rgba(16, 185, 129, 0.2) 100%
  );
}

body.dark-mode .stage-header.post {
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.3) 0%,
    rgba(236, 72, 153, 0.2) 100%
  );
}

.stage-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--gray-800);
}

body.dark-mode .stage-num {
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
}

.stage-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--gray-800);
}

body.dark-mode .stage-header h3 {
  color: var(--white);
}

.stage-body {
  padding: var(--space-4);
}

.stage-body p {
  margin-bottom: var(--space-3);
}

.stage-body ul {
  margin: 0;
  padding-left: var(--space-4);
  list-style: none;
}

.stage-body li {
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
}

/* Pareto showcase */
.pareto-showcase .figure-main {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

body.dark-mode .pareto-showcase .figure-main {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.pareto-interpretation {
  margin-top: var(--space-6);
  padding: var(--space-6);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

body.dark-mode .pareto-interpretation {
  background: rgba(255, 255, 255, 0.05);
}

.pareto-interpretation h3 {
  margin-bottom: var(--space-4);
}

.pareto-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.baseline {
  background: #ef4444;
}

.legend-dot.reweighed {
  background: #3b82f6;
}

.legend-dot.inproc {
  background: #10b981;
}

.legend-dot.bert {
  background: #f59e0b;
}

/* Pipeline detailed */
.pipeline-detailed {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

@media (max-width: 768px) {
  .pipeline-detailed {
    grid-template-columns: 1fr;
  }
}

.pipeline-phase {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

body.dark-mode .pipeline-phase {
  background: rgba(255, 255, 255, 0.05);
}

.phase-header {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.phase-header.discovery {
  background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
}

.phase-header.modeling {
  background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
}

.phase-header.advanced {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
}

.phase-header.synthesis {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
}

body.dark-mode .phase-header.discovery {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.4) 0%,
    rgba(99, 102, 241, 0.3) 100%
  );
}

body.dark-mode .phase-header.modeling {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.4) 0%,
    rgba(34, 197, 94, 0.3) 100%
  );
}

body.dark-mode .phase-header.advanced {
  background: linear-gradient(
    135deg,
    rgba(251, 146, 60, 0.4) 0%,
    rgba(251, 146, 60, 0.3) 100%
  );
}

body.dark-mode .phase-header.synthesis {
  background: linear-gradient(
    135deg,
    rgba(248, 113, 113, 0.4) 0%,
    rgba(248, 113, 113, 0.3) 100%
  );
}

.phase-range {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-700);
}

body.dark-mode .phase-range {
  color: var(--white);
}

.phase-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--gray-800);
}

body.dark-mode .phase-header h3 {
  color: var(--white);
}

.phase-steps {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.step {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

body.dark-mode .step {
  background: rgba(0, 0, 0, 0.2);
}

/* Tech stack detailed */
.tech-stack-detailed {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

@media (max-width: 640px) {
  .tech-stack-detailed {
    grid-template-columns: 1fr;
  }
}

.tech-category h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
  color: var(--gray-600);
}

body.dark-mode .tech-category h3 {
  color: var(--gray-400);
}

/* Code sample */
.code-sample {
  margin-top: var(--space-8);
}

.code-sample h3 {
  margin-bottom: var(--space-4);
}

.code-sample pre {
  background: #1e293b;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.code-sample code {
  font-family: var(--font-mono);
  color: #e2e8f0;
}

.code-sample .keyword {
  color: #c084fc;
}

.code-sample .string {
  color: #86efac;
}

.code-sample .comment {
  color: #64748b;
  font-style: italic;
}

/* Takeaways grid */
.takeaways-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

@media (max-width: 640px) {
  .takeaways-grid {
    grid-template-columns: 1fr;
  }
}

.takeaway-card {
  background: var(--white);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform 0.3s ease;
}

body.dark-mode .takeaway-card {
  background: rgba(255, 255, 255, 0.05);
}

.takeaway-card:hover {
  transform: translateY(-4px);
}

.takeaway-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
}

.takeaway-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  color: var(--primary-color);
}

.takeaway-card p {
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin: 0;
  line-height: 1.6;
}

body.dark-mode .takeaway-card p {
  color: var(--gray-400);
}

/* ==========================================================================
   Lightbox Styles
   ========================================================================== */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-content {
  max-width: 95vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: white;
  cursor: pointer;
  z-index: 10001;
  transition: transform 0.2s ease;
  background: none;
  border: none;
  line-height: 1;
}

.lightbox-close:hover {
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: white;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 1rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}
