/* ===================================
   SUBJECT PAGE STYLES
   =================================== */

/* Subject Header */
.subject-header {
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--secondary-light) 100%
  );
  padding: var(--spacing-xl) 0;
  text-align: center;
}

.subject-header-content {
  animation: fadeInUp 0.8s ease;
}

.subject-icon-large {
  font-size: 5rem;
  margin-bottom: var(--spacing-md);
}

.subject-header h1 {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
}

.subject-header p {
  font-size: var(--font-size-lg);
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===================================
   SUBJECT LAYOUT
   =================================== */
.subject-layout {
  padding: 0 0;
  min-height: 70vh;
  background: var(--background-dark);
}

.layout-grid {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: var(--spacing-xl);
  position: relative;
}

.graph-container {
  /* background: #ffffff; */
  background: transparent;
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.graph-container canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* ===================================
   SIDEBAR NAVIGATION
   =================================== */
.sidebar {
  position: sticky;
  top: 0px;
  /* height: fit-content; */
  max-height: calc(100vh);
  overflow-y: auto;
  background: var(--background);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-md);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
}

.sidebar-header h3 {
  font-size: var(--font-size-xl);
  color: var(--text-dark);
  font-weight: 500;
}

.sidebar-toggle {
  display: none;
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-lg);
}

.topic-nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.topic-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: var(--background);
  border: 20px solid transparent;
}

.topic-link:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  transform: translateX(5000px);
}

.topic-link.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
}

.topic-icon {
  font-size: var(--font-size-lg);
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--background-dark);
  border-radius: 100px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ===================================
   CONTENT CANVAS
   =================================== */
.content-canvas {
  background: var(--background);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  min-height: 600px;
  width: 100%; /* Changed from 98% */
  min-width: unset; /* Removed the 600px min-width constraint */
  max-width: 100%; /* Prevent overflow */
  display: flex;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.topic-content {
  background: none;
  width: 100%; /* Make it fluid */
  max-width: 100%; /* Prevent overflow */
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.spacer {
  border-right: 2px solid var(--primary-color);
  margin: 0rem 1.5rem;
}

/* Welcome Screen */

.welcome-screen {
  padding: 3rem 2rem;
  align-items: center;
  align-self: center;
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.welcome-header-layout {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: 100%;
}

.welcome-text {
  flex: 1;
  /* box-shadow: 0 10px 300px rgba(220, 38, 38, 0.1); */
  padding: 2rem;
  border-radius: 1rem;
}

.welcome-image {
  flex: 0 0 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-image img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.welcome-image img:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.welcome-text h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.welcome-text p {
  font-size: 1.125rem;
  color: var(--text-light);
   line-height: 1.8;
}

.features-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature-item {
  padding: 1.5rem;
  background: var(--background);
  border-radius: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.feature-item:hover {
  transform: translateX(10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  background: var(--background-alt);
}

.feature-Icon {
  flex-shrink: 0;
  color: var(--text-dark);
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--primary-color);
}

.feature-Icon i {
  font-size: 1.5rem;
  color: var(--background);
}

.feature-content {
  flex: 1;
}

.feature-item h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.feature-item p {
  font-size: 0.9375rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  .welcome-header-layout {
    flex-direction: column;
    gap: 2rem;
  }

  .welcome-image {
    flex: 0 0 auto;
    width: 100%;
    max-width: 300px;
  }

  .welcome-text {
    flex: 1;
    padding: 1rem;
  }

  .welcome-text h2 {
    font-size: 2rem;
  }

  .welcome-text p {
    font-size: 1rem;
  }
}

/* ===================================
   TOPIC CONTENT
   =================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  font-size: var(--font-size-sm);
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary-color);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary-dark);
}

.separator {
  color: var(--text-muted);
}

.topic-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--spacing-lg);
}

/* ===================================
   TABS
   =================================== */
.tabs {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
}

.tab-button {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-button i {
  font-size: 1rem;
}

.tab-button:hover {
  color: var(--primary-color);
  background: var(--primary-light);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tab-button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   NOTES TAB
   =================================== */
.notes-content {
   line-height: 1.8;
  color: var(--text-dark);
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word; /* Break long words */
  word-wrap: break-word; /* Legacy support */
}

.notes-content h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-dark);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--primary-color);
}

.notes-content h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-dark);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

.notes-content p {
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-base);
  color: var(--text-light);
}

.notes-content ul,
.notes-content ol {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.notes-content li {
  margin-bottom: var(--spacing-sm);
  color: var(--text-light);
  list-style: disc;
}

.notes-content ol li {
  list-style: decimal;
}

.notes-content strong {
  color: var(--text-dark);
  font-weight: 600;
}

.notes-content code {
  background: var(--background-alt);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: "Courier New", monospace;
  color: var(--primary-color);
}

.notes-content img,
.topic-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--spacing-md) 0;
}

/* UPDATE: Tables - Make scrollable on mobile */
.notes-content table,
.topic-content table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* UPDATE: Code blocks - Prevent overflow */
.notes-content pre,
.topic-content pre,
.notes-content code,
.topic-content code {
  max-width: 100%;
  overflow-x: auto;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.info-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary-color);
  padding: var(--spacing-md);
  border-radius: 0px;
  margin: var(--spacing-lg) 0;
}

.info-box.note {
display: none;
}

.info-box.interactive {
  display: none;
}

.info-box.warning {
  background: #fef3c7;
  border-left-color: var(--accent-orange);
}

.info-box.tip {
  background: var(--secondary-light);
  border-left-color: var(--secondary-color);
}

.idea-light {
  /* Standard bright amber, great for visual emphasis */
  color: #ffbf00;

  /* Optional: Make it slightly larger than surrounding text */
  font-size: 1.2em;

  /* Optional: Add a subtle text shadow for a 'glow' effect */
  text-shadow: 0 0 5px rgba(255, 191, 0, 0.6);
}

.warning-icon {
  color: #ffc107; /* A bright, standard amber/yellow color */
  font-size: 1.2em; /* Adjust size as needed */
  margin-right: 5px; /* Add some space if preceding text */
}

/* ===================================
   VIDEO TAB
   =================================== */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
}

.video-description {
  padding: var(--spacing-md);
  background: var(--background-alt);
  border-radius: var(--radius-md);
}

.video-description h3 {
  font-size: var(--font-size-xl);
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
}

.video-description p {
  color: var(--text-light);
  line-height: 1.7;
}

/* ===================================
   QUESTIONS TAB
   =================================== */
.questions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
}

.questions-header h2 {
  font-size: var(--font-size-2xl);
  color: var(--text-dark);
}

.score-display {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--primary-color);
}

.question-card {
  background: var(--background-alt);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  border: 2px solid var(--border-color);
  transition: all var(--transition-base);
}

.question-card.correct {
  border-color: var(--secondary-color);
  background: var(--secondary-light);
}

.question-card.incorrect {
  border-color: var(--accent-red);
  background: #fee2e2;
}

.question-number {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.question-text {
  font-size: var(--font-size-lg);
  color: var(--text-dark);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.answer-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--background);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.answer-option:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.answer-option input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.answer-option label {
  flex: 1;
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--text-dark);
}

.answer-option.selected {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.answer-option.correct-answer {
  border-color: var(--secondary-color);
  background: var(--secondary-light);
}

.answer-option.wrong-answer {
  border-color: var(--accent-red);
  background: #fee2e2;
}

.check-answer-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.check-answer-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.check-answer-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.answer-feedback {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  font-weight: 500;
}

.answer-feedback.correct {
  background-color: var(--secondary-light); /* Light red/pink background */
  border: 1px solid var(--secondary-color); /* Red border */
  color: var(--secondary-color); /* Darker red text */
}

/* Styles the X icon for incorrect answers */
.answer-feedback.correct .fa-circle-xmark {
  color: var(--secondary-color); /* Ensures the icon is red */
  margin-right: 5px;
}

.answer-feedback.incorrect {
  background-color: #fcebeb; /* Light red/pink background */
  border: 1px solid #d99a9a; /* Red border */
  color: var(--primary-color); /* Darker red text */
}

/* Styles the X icon for incorrect answers */
.answer-feedback.incorrect .fa-circle-xmark {
  color: var(--primary-color); /* Ensures the icon is red */
  margin-right: 5px;
}

.answer-feedback p {
  margin-top: 5px;
  margin-bottom: 0;
  font-size: 0.95em;
}

.answer-feedback strong {
  display: block;
  margin-bottom: var(--spacing-xs);
}

.questions-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 2px solid var(--border-color);
}

/* ===================================
   QUIZ COMPLETION
   =================================== */

.practice-header h3 {
  font-size: var(--font-size-base);
  margin-bottom: 0.5rem;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
/* ===================================
   ENHANCED MOBILE MEDIA QUERIES
   =================================== */

/* Large tablets and small desktops */
@media (max-width: 968px) {
  .layout-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .sidebar {
    position: relative;
    top: 0;
    max-height: none;
  }

  .content-canvas {
    width: 100%;
    min-width: unset;
    padding: var(--spacing-lg);
  }

  .sidebar-toggle {
    display: none; /* Hidden - we use new toggle buttons now */
  }

  /* Removed old topic-nav hiding - now handled by sidebar overlay system */

  /* Make spacer horizontal on mobile */
  .spacer {
    border-right: none;
    border-bottom: 2px solid var(--primary-color);
    margin: 1rem 0;
    width: 100%;
  }

  .welcome-content {
    flex-direction: column;
    gap: 2rem;
  }

  .welcome-text {
    flex: 1;
  }
}

/* Tablets and larger phones */
@media (max-width: 768px) {
  .subject-header h1 {
    font-size: var(--font-size-3xl);
  }

  .content-canvas {
    padding: var(--spacing-md);
    min-width: unset;
    width: 100%;
    flex-direction: column;
  }

  .topic-title {
    font-size: var(--font-size-2xl);
    word-wrap: break-word;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .tab-button {
    white-space: nowrap;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
  }

  .questions-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .questions-actions {
    flex-direction: column;
    width: 100%;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Notes content adjustments */
  .notes-content {
    font-size: var(--font-size-base);
    padding: 0;
  }

  .notes-content h1,
  .notes-content h2,
  .notes-content h3,
  .notes-content h4 {
    word-wrap: break-word;
  }

  /* Graph container */
  .graph-container {
    padding: var(--spacing-sm);
    overflow-x: auto;
  }

  /* Welcome screen */
  .welcome-screen {
    padding: 2rem 1rem;
  }

  .welcome-text h2 {
    font-size: 2rem;
  }

  .welcome-text p {
    font-size: 1rem;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .subject-header {
    padding: var(--spacing-lg) var(--spacing-sm);
  }

  .subject-icon-large {
    font-size: 3rem;
  }

  .subject-header h1 {
    font-size: var(--font-size-2xl);
  }

  .subject-header p {
    font-size: var(--font-size-base);
    padding: 0 var(--spacing-sm);
  }

  .content-canvas {
    padding: var(--spacing-sm);
    width: 100%;
    min-width: unset;
  }

  .topic-title {
    font-size: var(--font-size-xl);
  }

  .tabs {
    gap: var(--spacing-xs);
  }

  .tab-button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .answer-option {
    padding: var(--spacing-sm);
  }

  .answer-option label {
    font-size: var(--font-size-sm);
  }

  .breadcrumb {
    font-size: var(--font-size-xs);
    flex-wrap: wrap;
  }

  /* Comparison tables - stack on very small screens */
  .comparison-table {
    font-size: var(--font-size-xs);
  }

  .comparison-table table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .comparison-table thead th,
  .comparison-table tbody td {
    padding: 0.5rem var(--spacing-xs);
    font-size: var(--font-size-xs);
  }

  /* Feature items */
  .feature-item {
    padding: 1rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .welcome-text h2 {
    font-size: 1.5rem;
  }

  .welcome-text p {
    font-size: 0.875rem;
  }

  /* Section headers in sidebar */
  .section-header {
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .section-details h4 {
    font-size: var(--font-size-sm);
  }

  .section-meta {
    font-size: 0.625rem;
  }

  .topic-link {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .content-canvas {
    padding: var(--spacing-xs);
  }

  .subject-header h1 {
    font-size: var(--font-size-xl);
  }

  .topic-title {
    font-size: var(--font-size-lg);
  }

  .tab-button {
    padding: var(--spacing-xs);
    font-size: 0.75rem;
  }

  .welcome-text h2 {
    font-size: 1.25rem;
  }
}

/* ===================================
   UTILITY CLASSES FOR RESPONSIVE CONTENT
   =================================== */

/* Add these classes to elements that need special mobile handling */
.mobile-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-stack {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

@media (min-width: 769px) {
  .mobile-stack {
    flex-direction: row;
  }
}

/* Responsive iframe/embed containers */
.responsive-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.responsive-embed iframe,
.responsive-embed object,
.responsive-embed embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.equation-box {
  background-color: #f1f5f9;
  padding: 1rem;
  border-left: 4px solid #64748b;
  font-family: "Courier New", Courier, monospace;
  font-weight: 600;
  margin: 1rem 0;
  text-align: center;
  color: #0f172a;
}

/* ===================================
   OLD COLLAPSIBLE SIDEBAR SECTIONS (DEPRECATED - KEPT FOR BACKWARDS COMPATIBILITY)
   =================================== */
.topic-section {
  display: none; /* Hidden - using new unit-section instead */
}

.section-header {
  display: none; /* Hidden - using new unit-title instead */
}

.section-topics {
  display: none; /* Hidden - using new structure */
}

.topic-link {
  display: none; /* Hidden - using new topic-item instead */
}

/* ============================
CUSTOM TABLE STYLES
============================ */

/* Comparison Table Styles */
.comparison-table {
  width: 100%;
  margin: var(--spacing-md) 0;
  overflow-x: auto;
  border-radius: 0rem;
  /* box-shadow: var(--shadow-md); */
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
}

.comparison-table thead {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: var(--background);
  opacity: 0.9;
}

.comparison-table thead th {
  padding: var(--spacing-sm);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-base);
  letter-spacing: 0.5px;
  border-bottom: 3px solid var(--primary-shade);
}

.comparison-table thead th:first-child {
  border-top-left-radius: var(--radius-lg);
  border-radius: 0rem;
}

.comparison-table thead th:last-child {
  border-top-right-radius: var(--radius-lg);
  border-radius: 0rem;
}

.comparison-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}

.comparison-table tbody tr:last-child {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background-color: var(--background-alt);
}

.comparison-table tbody td {
  padding: 0.875rem var(--spacing-sm);
  color: var(--text-dark);
  line-height: 1.6;
}

.comparison-table tbody td:first-child {
  font-weight: 600;
  color: var(--text-dark);
  background-color: var(--background-dark);
  border-right: 2px solid var(--border-color);
}

/* Alternating row colors */
.comparison-table tbody tr:nth-child(even) {
  background-color: var(--background-alt);
}

.comparison-table tbody tr:nth-child(even):hover {
  background-color: var(--background-dark);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .comparison-table {
    font-size: var(--font-size-xs);
  }

  .comparison-table thead th,
  .comparison-table tbody td {
    padding: 0.75rem var(--spacing-xs);
  }

  .comparison-table thead th {
    font-size: var(--font-size-sm);
  }
}

/* Optional: Add highlight effect on cells */
.comparison-table tbody td:not(:first-child):hover {
  background-color: var(--primary-light);
  cursor: default;
}

/* Placeholder Image Styles */
.placeholder-image {
  background: linear-gradient(
    135deg,
    var(--background-alt) 0%,
    var(--background-dark) 100%
  );
  border: 2px dashed var(--text-muted);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  margin: var(--spacing-sm) 0;
  transition: border-color var(--transition-base);
}

.placeholder-image:hover {
  border-color: var(--text-light);
}

.placeholder-image p {
  margin: 0;
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
}

/* ===================================
   END OF SUBJECT PAGE STYLES
   =================================== */
/* Custom style for the list icons */
.info-box.warning ul li .fa-circle-xmark {
  /* Sets the icon color to the defined red variable */
  color: var(--primary-color);

  /* Adds a small space to the right of the icon for separation */
  margin-right: 0.5rem;
}

/* ===================================
    FILE MANAGER STYLES - PAST PAPERS
    =================================== */

.papers-layout {
  padding: var(--spacing-lg) 0;
}

.papers-main-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

.papers-sidebar {
  position: sticky;
  top: var(--spacing-md);
  align-self: start;
}

.papers-content {
  min-height: 600px;
}

/* Mobile responsive */
@media (max-width: 968px) {
  .papers-main-layout {
    grid-template-columns: 1fr;
  }

  .papers-sidebar {
    position: relative;
    top: 0;
  }
}

/* ===================================
   NEW SUBJECT UI LAYOUT STYLES
   =================================== */

.section-dark2 {
  padding: 2.5rem;
}

/* Three Column Layout */
.main-container {
  display: grid;
  grid-template-columns: 350px 1fr 350px;
  min-height: calc(100vh - 60px);
}

/* Left Sidebar - Syllabus Navigation */
.left-sidebar {
  background: var(--background);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
}

/* Custom Scrollbar for Left Sidebar */
.left-sidebar::-webkit-scrollbar {
  width: 6px;
}

.left-sidebar::-webkit-scrollbar-track {
  background: var(--background-dark);
  border-radius: 10px;
}

.left-sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.left-sidebar .sidebar-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

/* Unit Section Styling */
.unit-section {
  margin-bottom: 1.5rem;
}

.unit-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: var(--background-dark);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.unit-title:hover {
  background: var(--background-alt);
}

.unit-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-dark);
  font-weight: bold;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.unit-title-text {
  flex: 1;
}

.unit-topics {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.unit-topics.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Topic Item Styling (new simpler style) */
.topic-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-light);
  transition: all 0.2s;
}

.topic-item:hover {
  background: var(--background-dark);
  color: var(--text-dark);
}

.topic-item.active {
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

.topic-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  flex-shrink: 0;
}

.topic-item.completed .topic-checkbox {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  position: relative;
}

.topic-item.completed .topic-checkbox::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 10px;
  top: -2px;
  left: 2px;
}

/* Subsection Styling (non-interactive labels) */
.subsection-container {
  margin-bottom: 0.5rem;
}

.subsection-header {
  padding: 0.5rem 0.75rem;
  padding-left: 1.5rem; /* Left padding for visual grouping */
  cursor: default; /* Not clickable */
  pointer-events: none; /* Disable all interactions */
}

.subsection-title {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 1; /* Dimmed appearance */
}

.subsection-topics {
  padding-left: 1.5rem; /* Indent topics under subsection */
}

/* Center Content Area */
.content-area {
  background: var(--background);
  padding: 3rem;
  overflow-y: auto;
  width: 95%;
  margin: 0 auto;
  /* border-radius: var(--radius-lg); */
  align-content: center;
}

.content-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.content-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.content-meta a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.content-meta a:hover {
  color: var(--primary-color);
}

.content-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.reading-content {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
   line-height: 1.8;
  color: var(--text-dark);
  padding: var(--spacing-md);
}

/* Card-Based Structure for Content Sections */
.reading-content > h2 {
  font-family: var(--font-family);
  font-size: 2rem;
  font-weight: 700;
  margin: 3rem 0 1.5rem;
  color: var(--text-dark);
  padding: 1.5rem 2rem;
  background: var(--background-dark);
  border-radius: var(--radius-lg);
  border-left: 5px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Number styling in headings - removed red dot */
.reading-content > h2::before {
  content: none;
}

/* Content cards - wrap sections after h2 */
.reading-content > h2 ~ * {
  position: relative;
}

/* Group content in cards between h2 sections */
.reading-content h3 {
  font-family: var(--font-family);
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--primary-color);
  padding: 0.875rem 1.25rem;
  background: var(--background-dark);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--secondary-color);
}

/* Better paragraph spacing */
.reading-content p {
  margin-bottom: 1.5rem;
   line-height: 1.8;
  padding: 0.5rem 0;
}

/* Enhanced list styling with custom bullets */
.reading-content ul,
.reading-content ol {
  margin: 1.5rem 0 2rem 0;
  padding-left: 2rem;
  list-style: none;
}

.reading-content ul li,
.reading-content ol li {
  margin-bottom: 0.5rem;
  padding-left: 3rem;
  position: relative;
  line-height: 2;
}

/* Custom bullet points */
.reading-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(232, 17, 35, 0.1);
}

/* Custom numbered list */
.reading-content ol {
  counter-reset: custom-counter;
}

.reading-content ol li {
  counter-increment: custom-counter;
}

.reading-content ol li::before {
  content: counter(custom-counter);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Two-column layout for example lists */
.reading-content ul.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Strong/Bold text enhancement */
.reading-content strong,
.reading-content b {
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.1rem 0.2rem;
  background: rgba(232, 17, 35, 0.05);
  border-radius: 3px;
}

/* Callout Boxes - Key Takeaways */
.key-takeaway {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--secondary-color);
  padding: 2rem;
  margin: 2.5rem 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  backdrop-filter: blur(10px);
}

.key-takeaway::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, var(--secondary-color) 0%, transparent 100%);
  opacity: 0.05;
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.key-takeaway-title {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--secondary-dark);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.key-takeaway-title i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary-color);
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.key-takeaway ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.key-takeaway ul li {
  padding-left: 2rem;
  margin-bottom: 0.875rem;
  position: relative;
  line-height: 1.7;
}

.key-takeaway ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 1.125rem;
}

/* Callout Boxes - Exam Tips */
.exam-tip {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--accent-orange);
  padding: 2rem;
  margin: 2.5rem 0;
  border-radius: var(--radius-lg);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  box-shadow: var(--shadow-md);
  position: relative;
  backdrop-filter: blur(10px);
}

.exam-tip::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, var(--accent-orange) 0%, transparent 100%);
  opacity: 0.05;
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.exam-tip-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--accent-orange);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.exam-tip-title i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-orange);
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Additional callout box types */
.info-box {
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid #3b82f6;
  padding: 2rem;
  margin: 2.5rem 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}

.info-box-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: #3b82f6;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.info-box-title i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b82f6;
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.warning-box {
  background: rgba(239, 68, 68, 0.08);
  border-left: 4px solid var(--accent-red);
  padding: 2rem;
  margin: 2.5rem 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}

.warning-box-title {
  font-weight: 700;
  font-size: 1.125rem;
  /* color: var(--accent-red); */
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.warning-box-title i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-red);
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Tables styling */
.reading-content table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--background);
  display: table;
  table-layout: auto;
}

/* Ensure table container takes full width */
.reading-content > table,
.reading-content div > table {
  width: 100%;
}

.reading-content table thead {
  background: var(--primary-color);
  color: white;
}

.reading-content table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reading-content table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.reading-content table tbody tr {
  transition: background var(--transition-fast);
}

.reading-content table tbody tr:hover {
  background: var(--background-dark);
}

.reading-content table tbody tr:last-child td {
  border-bottom: none;
}

/* Code blocks and inline code */
.reading-content code {
  background: var(--background-dark);
  color: var(--primary-color);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
}

.reading-content pre {
  background: var(--background-dark);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.reading-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-dark);
}

/* Blockquotes */
.reading-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: var(--background-dark);
  border-left: 5px solid var(--primary-color);
  border-radius: var(--radius-lg);
  font-style: italic;
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}

.reading-content blockquote p {
  margin: 0;
}

/* Images in content */
.reading-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 2rem auto;
  /* box-shadow: var(--shadow-lg); */
  transition: transform var(--transition-base);
  display: block;
}

.reading-content img:hover {
  transform: scale(1.02);
}

/* Horizontal rules */
.reading-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border-color), transparent);
  margin: 3rem 0;
}

/* Section dividers with text */
.reading-content .section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 3rem 0;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
}

.reading-content .section-divider::before,
.reading-content .section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.reading-content .section-divider::before {
  margin-right: 1rem;
}

.reading-content .section-divider::after {
  margin-left: 1rem;
}

/* Definition terms */
.reading-content dt {
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 1rem;
  font-size: 1.125rem;
}

.reading-content dd {
  margin-left: 2rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--background-dark);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--secondary-color);
}

/* Highlighted/marked text */
.reading-content mark {
  background: rgba(232, 17, 35, 0.15);
  color: var(--text-dark);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* Smooth scroll behavior */
.reading-content {
  scroll-behavior: smooth;
}

/* Fade-in animation for content sections */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reading-content > * {
  animation: fadeInUp 0.6s ease-out backwards;
}

.reading-content > *:nth-child(1) { animation-delay: 0.05s; }
.reading-content > *:nth-child(2) { animation-delay: 0.1s; }
.reading-content > *:nth-child(3) { animation-delay: 0.15s; }
.reading-content > *:nth-child(4) { animation-delay: 0.2s; }
.reading-content > *:nth-child(5) { animation-delay: 0.25s; }

/* Hover effects for interactive elements */
.reading-content a {
  color: var(--primary-color);
  text-decoration: none;
  position: relative;
  transition: color var(--transition-fast);
  font-weight: 500;
}

.reading-content a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-base);
}

.reading-content a:hover {
  color: var(--primary-dark);
}

.reading-content a:hover::after {
  width: 100%;
}

/* Focus visible for accessibility */
.reading-content *:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Print styles for better printouts */
@media print {
  .reading-content {
    padding: 0;
  }

  .reading-content > h2::before {
    display: none;
  }

  .key-takeaway,
  .exam-tip,
  .info-box,
  .warning-box {
    page-break-inside: avoid;
  }

  .reading-content img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}

/* Right Sidebar - Tools & Resources */
.right-sidebar {
  background: var(--background);
  border-left: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
}

/* Custom Scrollbar for Right Sidebar */
.right-sidebar::-webkit-scrollbar {
  width: 6px;
}

.right-sidebar::-webkit-scrollbar-track {
  background: var(--background-dark);
  border-radius: 10px;
}

.right-sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.right-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.toc-item {
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.toc-item:hover {
  background: var(--background-dark);
  color: var(--text-dark);
}

.toc-item.active {
  border-left-color: var(--primary-color);
  background: var(--background-dark);
  color: var(--text-dark);
  font-weight: 500;
}

.resource-btn {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--background);
  color: var(--text-dark);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.resource-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.resource-btn i {
  font-size: 1rem;
}

.progress-box {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
}

.progress-bar-container {
  height: 8px;
  background: var(--background-dark);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.complete-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.75rem;
}

.complete-btn:hover {
  background: var(--primary-dark);
}

/* Action Button Styles */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
  font-size: var(--font-size-base);
}

.action-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(232, 17, 35, 0.3);
}

.action-btn i {
  font-size: 1rem;
}

/* Quick Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stat-card {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  color: var(--primary-color);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-dark);
}

.stat-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Study Timer */
.timer-box {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.timer-display {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: "Courier New", monospace;
  margin-bottom: 0.75rem;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.timer-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  background: var(--background-alt);
  color: var(--text-dark);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.timer-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.study-streak {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.study-streak i {
  color: #ff6b35;
}

/* Key Terms List */
.terms-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.term-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.term-item:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.term-word {
  font-weight: 500;
}

.term-item i {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* Related Topics */
.related-topics {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.related-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.related-link:hover {
  background: var(--background-dark);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.related-link i {
  font-size: 0.75rem;
}

/* Highlights */
.highlight-btn {
  background: var(--background-dark);
  border-color: var(--border-color);
}

.highlights-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-top: 0.5rem;
  text-align: center;
}

.highlights-count i {
  color: var(--primary-color);
}

/* Help Box */
.help-box {
  background: linear-gradient(135deg, var(--primary-color) 0%, #c00e1e 100%);
  color: white;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.help-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.help-text {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.help-btn {
  width: 100%;
  padding: 0.625rem;
  background: white;
  color: var(--primary-color);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.help-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ===================================
   SIDEBAR TOGGLE BUTTONS
   =================================== */

.sidebar-toggles {
  display: none;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  justify-content: space-between;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.sidebar-toggle-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.sidebar-toggle-btn i {
  font-size: 1rem;
}

/* Backdrop for overlay sidebars */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Responsive Design for New Layout */
@media (max-width: 1200px) {
  .main-container {
    grid-template-columns: 260px 1fr 260px;
  }
}

@media (max-width: 1024px) {
  /* Show toggle buttons */
  .sidebar-toggles {
    display: flex;
  }

  /* Make main container single column on medium screens */
  .main-container {
    grid-template-columns: 1fr;
  }

  /* Convert sidebars to overlay mode */
  .left-sidebar,
  .right-sidebar {
    position: fixed;
    top: 60px;
    bottom: 0;
    width: 320px;
    height: calc(100vh - 60px);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .left-sidebar {
    left: 0;
    transform: translateX(-100%);
  }

  .right-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    display: block; /* Re-enable right sidebar */
  }

  /* Active state - slide in */
  .left-sidebar.active {
    transform: translateX(0);
  }

  .right-sidebar.active {
    transform: translateX(0);
  }

  .section-dark2 {
    padding: 0rem;
  }

  .content-area {
    padding: 1.5rem;
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  /* Reduce sidebar width on mobile */
  .left-sidebar,
  .right-sidebar {
    width: 280px;
  }

  .content-area {
    padding: 1rem;
    width: 100%;
    margin: 0;
  }

  /* Responsive adjustments for reading content */
  .reading-content {
    padding: var(--spacing-sm);
  }

  .reading-content > h2 {
    font-size: 1.5rem;
    padding: 1rem 1.25rem;
    margin: 2rem 0 1rem;
  }

  .reading-content > h2::before {
    width: 32px;
    height: 32px;
  }

  .reading-content h3 {
    font-size: 1.125rem;
    padding: 0.75rem 1rem;
  }

  .reading-content ul.two-column {
    grid-template-columns: 1fr;
  }

  .key-takeaway,
  .exam-tip,
  .info-box,
  .warning-box {
    padding: 1.25rem;
    margin: 1.5rem 0;
  }

  .key-takeaway-title,
  .exam-tip-title,
  .info-box-title,
  .warning-box-title {
    font-size: 1rem;
  }

  .key-takeaway-title i,
  .exam-tip-title i,
  .info-box-title i,
  .warning-box-title i {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .reading-content table {
    font-size: 0.875rem;
  }

  .reading-content table th,
  .reading-content table td {
    padding: 0.75rem 1rem;
  }
}

/* ===================================
   TOPICS SIDE BUTTON STYLES
   =================================== */
