/* Custom styles for the problem-solution.html section with terminal theme */

/* Full-width background for the terminal effect */
#pbn-challenge {
  background: transparent;
  padding: 100px 0 60px; /* Added even more padding to the top */
  margin-top: -80px;
}

/* Card Container (formerly Terminal Container) */
.terminal-container {
  width: 100%;
  max-width: 1100px; /* Wider card */
  margin: 0 auto;
  color: #fff;
  position: relative;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  background-color: rgba(25, 25, 30, 0.95); /* Much darker background, no purple */
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(40, 40, 45, 0.8);
  overflow: hidden;
  border: none;
  transform: none; /* Remove the 3D effect */
  padding-top: 15px; /* Add padding to the top of the card */
}

/* Arrow Container */
.arrow-container {
  text-align: center;
  margin-top: 30px;
  height: 80px;
}

/* Card Header (formerly Terminal Header) */
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #1a1a1f, #222228); /* Darker grey gradient */
  padding: 15px 20px;
  border-bottom: 1px solid rgba(50, 50, 55, 0.8);
  margin-bottom: 10px;
}

.terminal-title {
  text-align: center;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.terminal-controls {
  font-size: 0.9rem;
}

/* Card Body (formerly Terminal Body) */
.terminal-body {
  display: flex;
  padding: 20px 0;
  background-color: rgba(20, 20, 25, 0.98); /* Much darker background */
  min-height: 225px; /* 25% smaller height */
  position: relative;
  overflow: hidden;
}

/* Line Numbers */
.line-numbers {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  color: rgba(100, 100, 255, 0.5);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  user-select: none;
  text-align: right;
  min-width: 40px;
  border-right: 1px solid rgba(100, 100, 255, 0.2);
}

.line-numbers span {
  line-height: 1.6;
}

/* Code Content */
.code-content {
  flex-grow: 1;
  padding: 0 15px;
}

/* Typewriter Sections */
.typewriter-section {
  margin-bottom: 20px;
  opacity: 1; /* Start visible for immediate animation */
  text-align: left;
  position: relative;
  padding-left: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.section-icon {
  font-size: 1rem;
  margin-right: 10px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  font-family: monospace;
  transform: scaleX(0.7);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  font-family: 'JetBrains Mono', 'Orbitron', sans-serif;
  letter-spacing: 1px;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  animation: typing 1.5s steps(20, end) forwards;
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 20px;
  background-color: currentColor;
  margin-left: 5px;
  animation: blink 0.7s step-end infinite;
}

.section-text {
  font-size: 0.9rem;
  margin: 5px 0 10px 30px;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  opacity: 0;
  overflow: visible;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Enable word wrapping */
  max-width: 90%; /* Prevent text from going too far */
  text-align: left; /* Ensure left alignment */
  line-height: 1.4;
  position: relative;
  animation: fadeIn 0.5s forwards; /* Use fade in instead of typing */
}

.section-complete {
  font-size: 0.8rem;
  color: rgba(100, 255, 100, 0.8);
  margin-left: 30px;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
  animation-delay: 2s;
}

/* Terminal Prompt */
.terminal-prompt {
  margin-top: 20px;
  display: flex;
  align-items: center;
}

.prompt-symbol {
  color: #27c93f;
  margin-right: 8px;
  font-weight: bold;
}

.prompt-text {
  color: rgba(255, 255, 255, 0.8);
}

.prompt-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.8);
  margin-left: 5px;
  animation: blink 1s step-end infinite;
}

/* Color-specific styles with enhanced glow effect */
#domain .section-title, #domain .section-text, #domain .cursor {
  color: #ff6600;
  text-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

#client .section-title, #client .section-text, #client .cursor {
  color: #2ECC71;
  text-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
}

#link .section-title, #link .section-text, #link .cursor {
  color: #9B59B6;
  text-shadow: 0 0 8px rgba(155, 89, 182, 0.5);
}

#deploy .section-title, #deploy .section-text, #deploy .cursor {
  color: #3498DB;
  text-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

#content .section-title, #content .section-text, #content .cursor {
  color: #999999;
  text-shadow: 0 0 8px rgba(153, 153, 153, 0.5);
}

/* Immediate animation start - no delays */
#domain .section-title { animation-delay: 0s; }
#domain .section-text { animation-delay: 0.3s; }
#client .section-title { animation-delay: 0.6s; }
#client .section-text { animation-delay: 0.9s; }
#link .section-title { animation-delay: 1.2s; }
#link .section-text { animation-delay: 1.5s; }
#deploy .section-title { animation-delay: 1.8s; }
#deploy .section-text { animation-delay: 2.1s; }
#content .section-title { animation-delay: 2.4s; }
#content .section-text { animation-delay: 2.7s; }

/* Enhanced arrow styling */
.arrow-chevron {
  position: relative;
  width: 2.5rem;
  height: 0.6rem;
  display: inline-block;
  margin: 0 20px;
  opacity: 0.8;
}

.arrow-chevron:before,
.arrow-chevron:after {
  content: '';
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
}

.arrow-chevron:before {
  left: 0;
  transform: skewY(30deg);
}

.arrow-chevron:after {
  right: 0;
  width: 50%;
  transform: skewY(-30deg);
}

/* Domain - Orange */
.domain-arrow:before, 
.domain-arrow:after {
  background: #ff6600;
}

/* Client - Green */
.client-arrow:before, 
.client-arrow:after {
  background: #2ECC71;
}

/* Link - Purple */
.link-arrow:before, 
.link-arrow:after {
  background: #9B59B6;
}

/* Deploy - Blue */
.deploy-arrow:before, 
.deploy-arrow:after {
  background: #3498DB;
}

/* Content - Grey */
.content-arrow:before, 
.content-arrow:after {
  background: #999999;
}

/* Enhanced arrow animation - each arrow with different delay */
.domain-arrow {
  animation: full-arrow-animation 2s ease-in-out infinite;
  animation-delay: 0s;
}

.client-arrow {
  animation: full-arrow-animation 2s ease-in-out infinite;
  animation-delay: 0.4s;
}

.link-arrow {
  animation: full-arrow-animation 2s ease-in-out infinite;
  animation-delay: 0.8s;
}

.deploy-arrow {
  animation: full-arrow-animation 2s ease-in-out infinite;
  animation-delay: 1.2s;
}

.content-arrow {
  animation: full-arrow-animation 2s ease-in-out infinite;
  animation-delay: 1.6s;
}

/* Animation Keyframes */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes full-arrow-animation {
  0% {
    opacity: 0.3;
    transform: translateY(0) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(15px) scale(1.1);
  }
  100% {
    opacity: 0.3;
    transform: translateY(30px) scale(0.8);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .terminal-container {
    max-width: 100%;
  }
  
  .section-title {
    font-size: 1.2rem;
  }
  
  .section-text {
    font-size: 0.8rem;
  }
  
  .line-numbers {
    display: none;
  }
}
