/* ===================================
   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-alt);
}

.layout-grid {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: var(--spacing-xl);
  position: relative;
}

.graph-container {
  background: #ffffff;
  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);
  /* border-radius: var(--radius-sm); */
  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: 700;
}

.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-sm);
  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(5px);
}

.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: 10px;
}

.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: 98%;
  min-width: 600px;
  display: flex;
  box-shadow: #d99a9a;
}

.topic-content {
  background: var(--background);
  /* min-width: 900px;
  max-width: 900px; */
}

.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;
  align-items: flex-start;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: center;
}

.welcome-text {
  flex: 0 0 45%;
  /* box-shadow: 0 10px 300px rgba(220, 38, 38, 0.1); */
  padding: 2rem;
  border-radius: 1rem;
}

.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-content {
    flex-direction: column;
  }

  .welcome-text {
    flex: 1;
  }
}

/* ===================================
   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);
}
.tab-button a {
  font-size: var(--font-size-lg);
}

.tab-button {
  padding: var(--spacing-sm) var(--spacing-sm);
  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;
}

.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);
}

.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-xl);
  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);
}

.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.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
   =================================== */
@media (max-width: 968px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
    max-height: none;
  }

  .sidebar-toggle {
    display: block;
  }

  .topic-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
  }

  .topic-nav.active {
    max-height: 1000px;
  }
}

@media (max-width: 768px) {
  .subject-header h1 {
    font-size: var(--font-size-3xl);
  }

  .content-canvas {
    padding: var(--spacing-md);
  }

  .topic-title {
    font-size: var(--font-size-2xl);
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-button {
    white-space: nowrap;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
  }

  .questions-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .questions-actions {
    flex-direction: column;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
  }

  .answer-option {
    padding: var(--spacing-sm);
  }

  .answer-option label {
    font-size: var(--font-size-sm);
  }
}

/* ===================================
   COLLAPSIBLE SIDEBAR SECTIONS
   =================================== */
.topic-section {
  margin-bottom: var(--spacing-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--background-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.section-header:hover {
  background: var(--primary-shade);
}

.section-header.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.section-header.active .section-info h4,
.section-header.active .section-info .section-meta {
  color: white;
}

.section-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
}

.section-status {
  width: 24px;
  height: 24px;
  border-radius: 20%;
  border: 2px solid var(--secondary-color);
  background: var(--background);
  flex-shrink: 0;
  display: none; /* Hide status indicator for cleaner look like image */
}

.section-details h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.125rem;
}

.section-meta {
  font-size: var(--font-size-xs);
  color: var(--text-dark);
}

.section-toggle {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  transition: transform var(--transition-fast);
  font-size: var(--font-size-sm);
  border-radius: 50%;
  border: 1px solid var(--primary-color);
}

.section-header.active .section-toggle {
  transform: rotate(180deg);
  color: var(--background);
  border: 1px solid var(--background);
}

.section-topics {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
  margin-top: var(--spacing-xs);
}

.section-topics.expanded {
  max-height: 2000px;
}

.topic-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 3rem;
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  background: var(--background-dark);
  border: 1px solid transparent;
  margin-bottom: var(--spacing-xs);
}

.topic-link:hover {
  background: var(--background);
  border-color: var(--primary-color);
  transform: translateX(10px);
  color: var(--primary-color);
}

.topic-link.active {
  color: var(--primary-color);
  /* border-color: var(--primary-dark); */
  transform: translateX(0px);
  background: var(--background-dark);
  border: 1px solid transparent;
}

.topic-icon {
  display: none; /* Hide icons for cleaner look like image */
}

/* ============================
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;
  }
}

/* ===================================
   TOPICS SIDE BUTTON STYLES
   =================================== */
