/* instructions.css */

.instructions-page-wrapper {
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
  font-family: 'Inter', system-ui, sans-serif;
  /* Use a subtle background for the whole page if needed, or let the app's default show through */
  background-color: #f8f9fa;
  min-height: calc(100vh - 80px); /* Assuming there's a header */
}

.instructions-main-container {
  max-width: 1200px;
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0,0,0,0.05);
  padding: 4rem 3rem;
  position: relative;
  overflow: hidden;
  
  /* Initial state for main container animation */
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  animation: containerEntrance 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

/* Decorative animated gradient blob behind the content to give it life */
.instructions-main-container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(238,119,82,0.1) 0%, rgba(231,60,126,0.05) 25%, rgba(35,166,213,0.05) 50%, rgba(255,255,255,0) 70%);
  animation: blobRotate 20s linear infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes blobRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.instructions-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  z-index: 1;
}

.instructions-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #1a202c;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.instructions-header p {
  font-size: 1.2rem;
  color: #4a5568;
  max-width: 600px;
  margin: 0 auto;
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}

.instruction-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  color: #2d3748;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  
  /* Initial hidden state for entrance animation */
  opacity: 0;
  transform: translateY(30px);
}

.instruction-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.instruction-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e0;
}

.instruction-card h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #1a202c;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.instruction-step {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.instruction-step:hover {
  background: #f1f5f9;
  transform: translateX(4px);
}

.instruction-step:last-child {
  margin-bottom: 0;
}

.instruction-step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #2b6cb0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Number badge style */
.instruction-step h3::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #3182ce;
  color: white;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: bold;
}

.instruction-card {
  counter-reset: step-counter; /* Reset counter for each card */
}

.instruction-step h3 {
  counter-increment: step-counter; /* Increment counter */
}

/* Remove the hardcoded numbers from HTML later or hide them if we use counter */

.instruction-step p {
  font-size: 1rem;
  line-height: 1.6;
  color: #4a5568;
  margin: 0;
  padding-left: 2.5rem; /* Indent under the badge */
}

/* Staggered step entrance animation inside the card */
.instruction-step {
  opacity: 0;
  transform: translateX(-15px);
}

.instruction-card.is-visible .instruction-step {
  animation: slideInRight 0.6s ease-out forwards;
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Adding staggered delays for steps */
.instruction-card.is-visible .instruction-step:nth-child(2) { animation-delay: 0.2s; }
.instruction-card.is-visible .instruction-step:nth-child(3) { animation-delay: 0.35s; }
.instruction-card.is-visible .instruction-step:nth-child(4) { animation-delay: 0.5s; }
.instruction-card.is-visible .instruction-step:nth-child(5) { animation-delay: 0.65s; }
.instruction-card.is-visible .instruction-step:nth-child(6) { animation-delay: 0.8s; }

@media (max-width: 768px) {
  .instructions-main-container {
    padding: 2rem 1.5rem;
  }
  .instructions-header h1 {
    font-size: 2.2rem;
  }
}
