/* Custom Styles & CSS Transitions */

/* Custom Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes growUp {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-down {
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-grow-up {
  animation: growUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: bottom;
}

/* Nav Button Styling */
.nav-btn {
  color: #64748b; /* slate-500 */
}

.nav-btn:hover {
  color: #334155; /* slate-700 */
  background-color: #f1f5f9; /* slate-100 */
}

.nav-btn.active {
  color: #4f46e5; /* indigo-600 */
  background-color: #e0e7ff; /* indigo-100 */
  font-weight: 600;
}

/* Mobile Nav Button Styling */
.mobile-nav-btn {
  color: #475569; /* slate-600 */
}

.mobile-nav-btn:hover {
  color: #1e293b; /* slate-800 */
  background-color: #f8fafc; /* slate-50 */
}

.mobile-nav-btn.active {
  color: #4f46e5; /* indigo-600 */
  background-color: #e0e7ff; /* indigo-50 */
  border-left: 4px solid #4f46e5;
}

/* Custom Scrollbar for better UI */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Infographic custom styling */
.info-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.15);
}

/* Custom Markdown formatting overrides for light theme readability */
article h1 {
  color: #1e293b;
  font-size: 1.875rem; /* 30px */
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

article h2 {
  color: #4338ca; /* indigo-700 */
  font-size: 1.5rem; /* 24px */
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid #4f46e5;
  padding-left: 0.75rem;
}

article h3 {
  color: #1e293b;
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

article h4 {
  color: #334155;
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

article p {
  color: #475569; /* slate-600 */
  line-height: 1.75;
  margin-bottom: 1rem;
}

article ul {
  list-style-type: disc;
  list-style-position: inside;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

article ol {
  list-style-type: decimal;
  list-style-position: inside;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

article li {
  margin-bottom: 0.5rem;
  color: #475569;
}

article pre {
  background-color: #f8fafc;
  color: #1e293b;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

article code {
  background-color: #f1f5f9;
  color: #4f46e5;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
}

article hr {
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-top: 1px solid #e2e8f0;
}

/* Alternating Layout Styles */
.alternating-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.alternating-section {
  display: grid;
  grid-template-cols: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .alternating-section {
    grid-template-columns: 1fr 1fr;
  }
  
  .alternating-section.reverse {
    direction: rtl;
  }
  
  .alternating-section.reverse > * {
    direction: ltr; /* Reset text direction for nested content */
  }
}
