/* terminal-card.css */
:root {
  --cmd-duration: 1.5s;
  --cursor-blink-speed: 0.8s;
}

.code-editor {
  width: 520px;
  background: linear-gradient(145deg, #1a1b20, #24252a);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0;
  overflow: hidden;
  margin-left: 0;
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
}

.code-editor::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96f7d2);
  animation: rainbow 8s linear infinite;
  background-size: 400% 100%;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.title {
  font-family: 'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  color: #e0e0e0;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
  position: relative;
  padding-left: 20px;
}

.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 15px 0 5px; /* Ajuste del padding para dar más espacio a la derecha */
  box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
}

.title::after {
  content: '';
  display: flex;
  gap: 8px;
}

.title::before {
  content: '';
  display: inline-flex;
  width: 12px;
  height: 12px;
  background: #ff5f56;
  border-radius: 50%;
  position: relative;
  margin-right: 0;
  box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f; /* Reducido el espaciado entre puntos */
  order: 2;
  flex-shrink: 0; /* Evita que los puntos se compriman */
}

.title-text {
  order: 1;
  margin-right: 10px; /* Reducido el margen para dar más espacio a los puntos */
}

.editor-content {
  padding: 16px;
  font-family: 'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace;
  font-size: 14px;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.1);
  min-height: 140px;
  position: relative;
  overflow: hidden;
}

.cmd {
  position: relative;
  display: flex;
  align-items: center;
  margin: 8px 0;
  padding-left: 20px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
}

.cmd::before {
  content: '>';
  position: absolute;
  left: 0;
  color: #6e7681;
  font-weight: bold;
}

.cmd span {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid transparent;
  animation: typing var(--cmd-duration) steps(40, end) forwards,
             blink-caret var(--cursor-blink-speed) step-end infinite;
  max-width: 100%;
}

.cmd::after {
  content: '';
  position: absolute;
  left: 10px;
  bottom: -5px;
  width: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  animation: lineExpand 0.3s ease forwards;
  animation-delay: calc(var(--cmd-duration) + 0.3s);
}

/* Animation delays for typing effect and appearance on each command */
.cmd:nth-child(1) { animation-delay: 0.2s; }
.cmd:nth-child(2) { animation-delay: calc(1 * var(--cmd-duration) + 0.2s); }
.cmd:nth-child(3) { animation-delay: calc(2 * var(--cmd-duration) + 0.2s); }
.cmd:nth-child(4) { animation-delay: calc(3 * var(--cmd-duration) + 0.2s); }
.cmd:nth-child(5) { animation-delay: calc(4 * var(--cmd-duration) + 0.2s); }

.cmd:nth-child(1) span { animation-delay: 0.2s, 0s; }
.cmd:nth-child(2) span { animation-delay: calc(1 * var(--cmd-duration) + 0.2s), 0s; }
.cmd:nth-child(3) span { animation-delay: calc(2 * var(--cmd-duration) + 0.2s), 0s; }
.cmd:nth-child(4) span { animation-delay: calc(3 * var(--cmd-duration) + 0.2s), 0s; }
.cmd:nth-child(5) span { animation-delay: calc(4 * var(--cmd-duration) + 0.2s), 0s; }

/* Color classes for different command lines */
.color-0 { color: #e44400; } /* Teal */
.color-1 { color: #45b7d1; } /* Light blue */
.color-2 { color: #96f7d2; } /* Mint */
.color-3 { color: #ff6b6b; } /* Coral */
.color-4 { color: #d0a9f5; } /* Lavender */

/* Keyframe animations */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #4ecdc4; }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineExpand {
  to {
    width: calc(100% - 20px);
  }
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Responsive design */
@media (max-width: 768px) {
  .code-editor {
    width: 90%;
    margin: 0 auto;
  }
  
  .editor-content {
    padding: 12px;
    font-size: 13px;
  }
  
  .cmd {
    padding-left: 18px;
  }
}