/* ============================================
   Interactive System Architecture Diagram
   ============================================ */

.interactive-architecture-section {
  background: linear-gradient(180deg, rgba(136, 0, 255, 0.02) 0%, rgba(0, 0, 0, 0) 100%);
  overflow: hidden;
}

.arch-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.arch-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.8;
}

.arch-diagram-container {
  position: relative;
  width: 100%;
  min-height: 600px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#arch-connections-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.arch-layers {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.arch-layer {
  background: rgba(10, 10, 15, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.arch-layer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 224, 122, 0.05), rgba(0, 120, 212, 0.05));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.arch-layer:hover {
  border-color: rgba(0, 224, 122, 0.4);
  transform: translateX(10px);
  box-shadow: 0 8px 32px rgba(0, 224, 122, 0.2);
}

.arch-layer:hover::before {
  opacity: 1;
}

.arch-layer.active {
  border-color: rgba(0, 224, 122, 0.6);
  background: rgba(0, 224, 122, 0.05);
  box-shadow: 0 8px 32px rgba(0, 224, 122, 0.3);
}

.arch-layer-icon {
  width: 80px;
  height: 80px;
  background: rgba(0, 224, 122, 0.1);
  border: 2px solid rgba(0, 224, 122, 0.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #00e07a;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.arch-layer:hover .arch-layer-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 30px rgba(0, 224, 122, 0.4);
}

.arch-layer-content {
  flex: 1;
}

.arch-layer-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #00e07a, #0078d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.arch-layer-content p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.arch-layer-metrics {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.metric-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-family: "JetBrains Mono", monospace;
}

.metric-badge i {
  color: #00e07a;
}

.metric-value {
  color: #00e07a;
  font-weight: 700;
}

.arch-layer-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #888;
}

.status-dot.active {
  background: #00e07a;
  box-shadow: 0 0 10px rgba(0, 224, 122, 0.6);
  animation: pulse 2s infinite;
}

/* Architecture Detail Panel */
.arch-detail-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 90%;
  max-width: 700px;
  max-height: 80%;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 2px solid rgba(0, 224, 122, 0.3);
  border-radius: 24px;
  padding: 3rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  overflow-y: auto;
}

.arch-detail-panel.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: all;
}

.arch-detail-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arch-detail-close:hover {
  background: rgba(255, 0, 0, 0.1);
  border-color: rgba(255, 0, 0, 0.3);
  transform: rotate(90deg);
}

.arch-detail-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #00e07a, #0078d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.arch-detail-content p {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.arch-detail-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.arch-detail-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.arch-detail-list li i {
  color: #00e07a;
}

/* ============================================
   Interactive Timeline Section
   ============================================ */

.interactive-timeline-section {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 136, 255, 0.02) 100%);
  overflow: hidden;
  padding: 8rem 0 10rem;
}

.timeline-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.timeline-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.8;
}

.timeline-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 6rem 0;
  scroll-behavior: smooth;
  margin-bottom: 3rem;
}

.timeline-container::-webkit-scrollbar {
  height: 10px;
}

.timeline-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  margin: 0 2rem;
}

.timeline-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #00e07a, #0078d4);
  border-radius: 5px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #00e07a, #00ffff);
}

.timeline-track {
  position: relative;
  min-width: max-content;
  padding: 0 4rem;
  display: flex;
  gap: 6rem;
  align-items: center;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, 
    rgba(0, 224, 122, 0.1) 0%, 
    rgba(0, 224, 122, 0.3) 50%, 
    rgba(0, 224, 122, 0.1) 100%
  );
  transform: translateY(-50%);
  box-shadow: 0 0 20px rgba(0, 224, 122, 0.2);
}

.timeline-progress {
  position: absolute;
  top: 50%;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #00e07a, #0078d4);
  transform: translateY(-50%);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 224, 122, 0.5);
}

.timeline-item {
  position: relative;
  width: 450px;
  flex-shrink: 0;
}




.timeline-card {
  background: linear-gradient(135deg, rgba(10, 10, 15, 0.95), rgba(0, 20, 40, 0.9));
  border: 2px solid rgba(0, 224, 122, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 224, 122, 0.05), rgba(0, 120, 212, 0.05));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.timeline-card:hover::before {
  opacity: 1;
}

.timeline-item[data-side="top"] .timeline-card {
  margin-bottom: 4rem;
}

.timeline-item[data-side="bottom"] .timeline-card {
  margin-top: 4rem;
}

.timeline-card:hover {
  border-color: rgba(0, 224, 122, 0.6);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 224, 122, 0.3);
}

.timeline-date {
  color: #00e07a;
  font-size: 0.9rem;
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 0.75rem;
  font-weight: 600;
  display: inline-block;
  background: rgba(0, 224, 122, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 224, 122, 0.3);
}

.timeline-title {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #00e07a, #0078d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  line-height: 1.3;
}

.timeline-company {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-company::before {
  content: '🏢';
  font-size: 1.2rem;
}

.timeline-description {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.timeline-achievements {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 224, 122, 0.03);
  padding: 1rem;
  border-radius: 10px;
  border-left: 3px solid #00e07a;
}

.achievement-tag {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.achievement-tag i {
  color: #00e07a;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.timeline-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tech-badge {
  background: rgba(0, 136, 255, 0.15);
  border: 1px solid rgba(0, 136, 255, 0.4);
  color: #0078d4;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tech-badge:hover {
  background: rgba(0, 136, 255, 0.25);
  border-color: rgba(0, 136, 255, 0.6);
  transform: translateY(-2px);
}

/* Timeline Navigation */
.timeline-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
}



/* ============================================
   Tech Stack Comparison Tool
   ============================================ */

.tech-comparison-section {
  background: linear-gradient(180deg, rgba(0, 136, 255, 0.02) 0%, rgba(136, 0, 255, 0.02) 100%);
}

.comparison-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.comparison-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.8;
}

.comparison-tool {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 3rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 3rem;
}

.comparison-section {
  margin-bottom: 3rem;
}

.comparison-section:last-child {
  margin-bottom: 0;
}

.comparison-section-title {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
}

.comparison-section-title i {
  color: #00e07a;
}

.comparison-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.comparison-option {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.comparison-option i {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.comparison-option:hover {
  border-color: rgba(0, 224, 122, 0.3);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
}

.comparison-option:hover i {
  color: #00e07a;
  transform: scale(1.1);
}

.comparison-option.active {
  border-color: rgba(0, 224, 122, 0.6);
  background: rgba(0, 224, 122, 0.08);
  color: #00e07a;
  box-shadow: 0 4px 20px rgba(0, 224, 122, 0.2);
}

.comparison-option.active i {
  color: #00e07a;
}

.comparison-generate {
  text-align: center;
  margin-top: 3rem;
}

.comparison-generate .btn {
  padding: 1rem 3rem;
  font-size: 1rem;
}

/* Comparison Results */
.comparison-results {
  margin-top: 3rem;
}

.results-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.results-title i {
  color: #00e07a;
}

.results-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.result-card {
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2.5rem;
}

.result-card.alternative {
  background: rgba(136, 0, 255, 0.05);
  border-color: rgba(136, 0, 255, 0.2);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-header h4 {
  font-size: 1.8rem;
  background: linear-gradient(135deg, #00e07a, #0078d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #00e07a;
  font-family: "JetBrains Mono", monospace;
}

.result-score i {
  color: #e09a00;
}

.result-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.result-tech-stack .tech-badge {
  background: rgba(0, 224, 122, 0.1);
  border: 1px solid rgba(0, 224, 122, 0.3);
  color: #00e07a;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.result-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.result-pros h5,
.result-cons h5 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.result-pros h5 {
  color: #00e07a;
}

.result-cons h5 {
  color: #ff5555;
}

.result-pros ul,
.result-cons ul {
  list-style: none;
  padding: 0;
}

.result-pros li,
.result-cons li {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.6;
}

.result-metrics {
  margin-bottom: 2rem;
}

.result-metric {
  margin-bottom: 1rem;
}

.metric-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: "JetBrains Mono", monospace;
}

.metric-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e07a, #0078d4);
  border-radius: 4px;
  transition: width 1s ease;
}

.result-cost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
}

.result-cost h5 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: #00e07a;
}

.cost-breakdown {
  margin-bottom: 1rem;
}

.cost-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.cost-total {
  font-size: 1.3rem;
  font-weight: 700;
  color: #00e07a;
  text-align: right;
  padding-top: 1rem;
  border-top: 2px solid rgba(0, 224, 122, 0.3);
  font-family: "JetBrains Mono", monospace;
}

.result-comparison-note {
  background: rgba(136, 0, 255, 0.1);
  border: 1px solid rgba(136, 0, 255, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: 1fr;
  }

  .result-pros-cons {
    grid-template-columns: 1fr;
  }

  .arch-diagram-container {
    padding: 2rem;
  }

  .arch-layer {
    flex-direction: column;
    text-align: center;
  }

  .timeline-item {
    width: 380px;
  }
  
  .timeline-card {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .arch-diagram-container {
    padding: 1.5rem;
    min-height: 500px;
    touch-action: manipulation; /* Enable touch interactions */
  }

  .arch-layer {
    padding: 1.5rem;
    gap: 1.5rem;
    cursor: pointer; /* Show it's clickable */
    -webkit-tap-highlight-color: rgba(0, 224, 122, 0.1); /* Touch feedback */
  }

  .arch-layer-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .arch-detail-panel {
    padding: 2rem;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }

  .timeline-item {
    width: 320px;
  }

  .timeline-card {
    padding: 1.8rem;
  }
  
  .timeline-title {
    font-size: 1.5rem;
  }
  
  .timeline-company {
    font-size: 1rem;
  }
  
  .timeline-date {
    font-size: 0.85rem;
  }

  .comparison-tool {
    padding: 2rem;
  }

  .comparison-options {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .comparison-option {
    cursor: pointer; /* Show it's clickable */
    -webkit-tap-highlight-color: rgba(0, 224, 122, 0.1);
  }

  .result-card {
    padding: 1.8rem;
  }
  
  .comparison-section-title {
    font-size: 1.2rem;
  }
  
  .timeline-nav-btn {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    -webkit-tap-highlight-color: rgba(0, 224, 122, 0.2);
  }
}

@media (max-width: 480px) {
  .arch-layers {
    gap: 1rem;
  }

  .arch-layer {
    padding: 1.2rem;
    gap: 1rem;
  }
  
  .arch-layer-icon {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
  
  .arch-layer-content h3 {
    font-size: 1.2rem;
  }
  
  .arch-layer-content p {
    font-size: 0.85rem;
  }
  
  .metric-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }
  
  .arch-detail-panel {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  .arch-detail-close {
    width: 36px;
    height: 36px;
    top: 1rem;
    right: 1rem;
  }

  .timeline-container {
    padding: 4rem 0;
  }

  .timeline-item {
    width: 280px;
  }
  
  .timeline-card {
    padding: 1.5rem;
  }
  
  .timeline-title {
    font-size: 1.3rem;
  }
  
  .timeline-company {
    font-size: 0.95rem;
  }
  
  .timeline-date {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  
  .timeline-description {
    font-size: 0.85rem;
  }
  
  .achievement-tag {
    font-size: 0.8rem;
  }
  
  .tech-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }
  
  .timeline-nav-btn {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  .comparison-section-title {
    font-size: 1rem;
  }

  .comparison-option {
    padding: 1rem;
    font-size: 0.85rem;
  }
  
  .comparison-option i {
    font-size: 1.5rem;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .result-header h4 {
    font-size: 1.4rem;
  }
  
  .result-card {
    padding: 1.5rem;
  }
  
  .result-tech-stack .tech-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  .result-metric {
    margin-bottom: 0.75rem;
  }
  
  .metric-label {
    font-size: 0.8rem;
  }
  
  /* Touch-friendly buttons */
  .arch-detail-close,
  .timeline-nav-btn,
  .comparison-option,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Better scrolling on mobile */
  .timeline-container {
    -webkit-overflow-scrolling: touch;
  }
  
  .arch-detail-panel {
    -webkit-overflow-scrolling: touch;
  }
}
