/*--------------------------------------
  Enhanced Elementary Homework Answers Page CSS
----------------------------------------*/

/* Define custom properties for easy theming */
:root {
  --primary-color: #003366;
  --secondary-color: #002244;
  --accent-color: #ffd400;
  --bg-color: #ffffff;
  --light-bg: #f9f9f9;
  --text-color: #333333;
  --shadow: rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition-speed: 0.3s;
  --accordion-bg: linear-gradient(135deg, #003366, #004080);
  --accordion-active-bg: linear-gradient(135deg, #ffd400, #ffcc00);
}

/* Base styles */
body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* Container for the page */
.container {
  max-width: 900px;
  margin: 3rem auto;
  background-color: var(--bg-color);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px var(--shadow);
}

/* Page Title */
.page-title {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-size: 2.8rem;
  letter-spacing: 1px;
}

/* Unit Accordion Container */
.unit {
  margin-bottom: 2rem;
}

/* Accordion Button */
.accordion {
  background: var(--accordion-bg);
  color: var(--bg-color);
  cursor: pointer;
  padding: 1rem 1.5rem;
  width: 100%;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.3rem;
  text-align: left;
  margin-bottom: 0.5rem;
  transition: background var(--transition-speed), color var(--transition-speed);
  position: relative;
  overflow: hidden;
}

/* Add an arrow indicator via pseudo-element */
.accordion::after {
  content: "\25BC"; /* down arrow */
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  transition: transform var(--transition-speed);
}

/* When active, change background and rotate arrow */
.accordion.active {
  background: var(--accordion-active-bg);
  color: var(--primary-color);
}

.accordion.active::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Unit content (accordion panel) */
.unit-content {
  background-color: var(--bg-color);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  padding: 0 1rem;
}

/* When panel is open, allow content to show (using a large max-height) */
.accordion.active + .unit-content {
  max-height: 1000px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Tabs container inside each Unit */
.tabs {
  width: 100%;
}

/* Tab menu (the header area for parts A, B, C) */
.tab-menu {
  list-style: none;
  padding: 0;
  display: flex;
  border-bottom: 2px solid #ddd;
  margin-bottom: 1rem;
}

/* Tab Menu Items */
.tab-menu li {
  flex: 1;
  text-align: center;
  cursor: pointer;
  padding: 0.8rem 0;
  font-size: 1.1rem;
  transition: background-color var(--transition-speed);
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  background-color: #f1f1f1;
  color: var(--primary-color);
}

/* Active tab styling */
.tab-menu li.active {
  background-color: var(--accent-color);
  color: var(--primary-color);
  font-weight: bold;
}

/* Hover state for tabs */
.tab-menu li:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
}

/* Tab content container */
.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

/* Answer Sections within tab content */
.answer-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.answer-section:last-child {
  border-bottom: none;
}

.answer-section h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.answer-section ul {
  list-style-type: none;
  padding-left: 0;
}

.answer-section li {
  padding: 0.3rem 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* Fade In Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .page-title {
    font-size: 2rem;
  }
  
  .accordion {
    font-size: 1.1rem;
    padding: 0.8rem 1rem;
  }
  
  .tab-menu li {
    font-size: 1rem;
    padding: 0.6rem 0;
  }
  
  .answer-section h4 {
    font-size: 1rem;
  }
  
  .answer-section li {
    font-size: 0.9rem;
  }
  
  .container {
    margin: 1rem;
    padding: 1.5rem;
  }
}
