/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #ffffff;
  color: #333333;
  line-height: 1.5;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background-color: #dbeafe; /* blue-100 */
}

/* Layout */
.app-container {
  margin-top: 10vh;
  min-height: 100vh;
  background-color: #ffffff;
}

.content-wrapper {
  max-width: 1280px; /* Increased from 1152px */
  margin: 0 auto;
  padding: 2rem 1rem; /* Reduced for mobile */
}

@media (min-width: 768px) {
  .content-wrapper {
    padding: 3rem 1.5rem;
  }
}

.main-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem; /* gap-8 */
  margin-bottom: 3rem; /* mb-12 */
  border-bottom: 1px solid #e5e7eb; /* border-gray-200 */
  padding-bottom: 2rem; /* pb-8 */
}

@media (min-width: 768px) {
  .main-header {
    flex-direction: row;
  }
}

.header-content {
  flex: 1;
}

.header-title {
  font-size: 1.875rem; /* text-3xl for mobile */
  font-weight: 700; /* font-bold */
  letter-spacing: -0.025em; /* tracking-tight */
  margin-bottom: 1rem; /* mb-4 */
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  align-items: baseline;
  gap: 0.5rem; /* gap-2 */
}

@media (min-width: 768px) {
  .header-title {
    font-size: 3rem; /* text-5xl */
    margin-bottom: 1.5rem; /* mb-6 */
    gap: 1rem; /* gap-4 */
  }
}

.header-meta {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem; /* space-y-1 */
  font-size: 0.875rem; /* text-sm */
  color: #4b5563; /* text-gray-600 */
}

.header-meta a {
  color: #2563eb; /* text-blue-600 */
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  word-break: break-all; /* Prevent long URLs from overflowing */
}

.header-meta a:hover {
  text-decoration: underline;
}

.sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* space-y-3 */
}

@media (min-width: 768px) {
  .sidebar {
    width: 16rem; /* w-64 */
  }
}

.sidebar-button {
  width: 100%;
  padding: 0.75rem 1rem; /* py-3 px-4 */
  background-color: #f0f0f0;
  border: 2px solid #000000;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-button:hover {
  background-color: #e5e7eb;
}

/*
.main-content {
  max-width: 64rem;  Increased from 48rem
}
*/

/* Question Styles */
.question-section {
  margin-top: 3rem; /* mt-12 */
  display: flex;
  flex-direction: column;
  gap: 1rem; /* space-y-4 */
}

.question-main-title {
  border: 2px solid black;
  padding: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.question-header {
  background-color: #a5d8eb;
  border-radius: 9999px;
  padding: 0.375rem 1rem; /* py-1.5 px-4 */
  display: inline-block;
  width: fit-content;
}

.question-header span {
  font-weight: 700;
  font-size: 1rem;
}

.question-box {
  background-color: #f2f2f2;
  border-radius: 0.5rem; /* rounded-lg */
  padding: 1rem;
  font-size: 15px;
  line-height: 1.625; /* leading-relaxed */
}

.formula-box {
  background-color: #eef9fc;
  border-left: 4px solid #a5d8eb;
  padding: 1rem;
  font-style: italic;
  display: flex;
  flex-direction: column;
  gap: 0.375rem; /* space-y-1.5 */
  overflow-x: auto; /* Handle long formulas */
}

.formula-box p.title {
  font-weight: 500;
  font-style: normal;
  font-size: 0.875rem;
}

.formula-box p.formula {
  font-size: 1rem;
}

.explanation-text {
  padding-left: 0.5rem; /* pl-2 */
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 0.625rem; /* space-y-2.5 */
  line-height: 1.625;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
}

.final-answer-container {
  padding-top: 0.5rem; /* pt-2 */
}

.final-answer {
  font-size: 1.25rem; /* text-xl */
  font-weight: 700;
  color: #dc2626; /* text-red-600 */
  border-bottom: 2px solid #dc2626;
  display: inline-block;
  padding-bottom: 0.125rem; /* pb-0.5 */
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  margin-top: 1rem; /* mt-4 */
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #d1d5db; /* border-gray-300 */
  font-size: 0.75rem; /* text-xs */
  text-align: center;
  background-color: #ffffff;
}

.data-table th {
  border: 1px solid #d1d5db;
  padding: 0.25rem 0.5rem; /* py-1 px-2 */
  background-color: #f9fafb; /* bg-gray-50 */
  font-weight: 700;
}

.data-table td {
  border: 1px solid #d1d5db;
  padding: 0.25rem 0.5rem;
}

.data-table .text-right {
  text-align: right;
}

.data-table .highlight-row {
  background-color: #fff9f9;
}

.data-table .subtext {
  font-size: 10px;
  opacity: 0.5;
}

/* Step Styles */
.step-title {
  font-weight: 700;
  color: #4a90a4;
  border-bottom: 1px solid #a5d8eb;
  padding-bottom: 0.25rem; /* pb-1 */
  margin-bottom: 0.5rem;
}

.step-box {
  background-color: #fdf5e6;
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

/* Sections */
.instruction-section {
  margin-bottom: 2rem; /* mb-8 */
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* space-y-2 */
  font-size: 14px;
  line-height: 1.625;
  color: #4b5563;
}

.closing-section {
  padding-top: 3rem; /* pt-12 */
  padding-bottom: 2rem; /* pb-8 */
  text-align: center;
}

.closing-text {
  font-size: 1.125rem; /* text-lg */
  font-weight: 500;
  color: #4b5563;
  font-style: italic;
}

.footer {
  margin-top: 6rem; /* mt-24 */
  padding-top: 2rem; /* pt-8 */
  border-top: 1px solid #f3f4f6; /* border-gray-100 */
  text-align: center;
  color: #9ca3af; /* text-gray-400 */
  font-size: 0.75rem; /* text-xs */
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-delay {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-delay.active {
  opacity: 1;
  transform: scale(1);
}

.video-aside {
    position: sticky;
    top: 90px;
    width: 704px;
    height: 392px;
}

.video-sec {
  display: flex;
  justify-content: left;
  align-items: center;
  padding-left: 40px;
}

.page {
  display: grid;
  grid-template-columns: 70% 1fr;
  margin: 0 auto;
}

.video-box {
  width: 60%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .video-box {
    position: static;
    margin-bottom: 30px;
    width: 352px;
    height: 196px;
  }
}


/* Utilities */
.bold { font-weight: 700; }
.italic { font-style: italic; }
.underline-accent { text-decoration: underline; text-decoration-color: #a5d8eb; text-decoration-thickness: 2px; text-underline-offset: 2px; }
