/* =========================================
   1. GLOBAL & ANIMATED BACKGROUND
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  /* Matching the Main Site's Animated Background */
  background: linear-gradient(-45deg, #4776E6, #8E54E9, #23d5ab, #23a6d5);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: #2d3436;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 20px 5%;
  text-align: center;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  position: static;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #212121;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  margin-bottom: 3px;
  letter-spacing: -1px;
}

header p {
  color: #212121;
  margin-bottom: 20px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 10px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  display: inline-block;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* =========================================
   3. MAIN CONTENT AREA
   ========================================= */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Subject Buttons Grid */
#subject-selection h2 {
  color: white;
  font-size: 2.2rem;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 700;
}

#subjects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
}

#subjects button {
  background: rgba(255, 255, 255, 0.95);
  color: #4776E6;
  border: none;
  padding: 25px 20px;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

#subjects button:hover {
  transform: translateY(-8px);
  background: #fff;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  color: #8E54E9;
}

/* =========================================
   4. PLANNER DASHBOARD (GLASS CARD)
   ========================================= */
#planner-area {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  padding: 40px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.8);
}

.planner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  border-bottom: 2px solid #f0f2f5;
  padding-bottom: 20px;
}

.planner-header h2 {
  color: #273c75;
  font-size: 2rem;
  font-weight: 800;
}

#back-btn {
  background: #f0f2f5;
  color: #273c75;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#back-btn:hover {
  background: #e2e8f0;
  transform: translateX(-5px);
}

/* Progress Cards */
.progress-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.progress-card {
  background: #fff;
  padding: 25px;
  border-radius: 20px;
  border: 1px solid #eef2ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s;
}

.progress-card:hover {
  transform: translateY(-5px);
}

.progress-label {
  font-size: 0.9rem;
  color: #636e72;
  font-weight: 600;
  margin-bottom: 10px;
}

.progress-count {
  font-size: 1.8rem;
  color: #4776E6;
  font-weight: 800;
}

/* =========================================
   5. TABLE STYLING
   ========================================= */
#chapters-container {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #eee;
}

#chapters-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

#chapters-table thead {
  background: #f8f9fa;
}

#chapters-table th {
  padding: 20px;
  text-align: left;
  color: #273c75;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

#chapters-table td {
  padding: 20px;
  border-bottom: 1px solid #f0f2f5;
}

#chapters-table tbody tr:hover {
  background: #fcfdff;
}

#chapters-table td:first-child {
  font-weight: 600;
  color: #2d3436;
  width: 40%;
}

/* Custom Checkboxes */
.checkbox-cell {
  text-align: center;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #4cd137;
  transition: transform 0.2s;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  justify-content: flex-end;
}

.action-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  background: #4776E6;
  color: white;
  font-family: 'Poppins', sans-serif;
}

.action-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.action-btn.danger {
  background: #ff7675;
}

/* =========================================
   6. FOOTER & UTILS
   ========================================= */
.hidden { display: none !important; }

footer {
  text-align: center;
  padding: 25px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0,0,0,0.2);
  margin-top: auto;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  #planner-area { padding: 20px; }
  .planner-header { flex-direction: column; gap: 20px; text-align: center; }
  .action-buttons { justify-content: center; }
  .action-btn { flex: 1; font-size: 0.8rem; }
  #chapters-table th, #chapters-table td { padding: 12px; font-size: 0.85rem; }
}
