/* CTA buttons */
.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  background-color: #0054fc;
  padding: 2rem;
}

/* Stack CTA buttons on very small screens */
@media (max-width: 500px) {
  .cta-buttons {
    flex-direction: column;
  }
}

.cta-buttons button {
  border: 2px solid white;
  border-radius: 15px;
  padding: 14px 50px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: .2s;
}

.cta-buttons button:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.individual-btn {
  background-color: #0054fc00;
  color: white;
  border: 2px solid #2f80ed;
}

.business-btn {
  background-color: #0054fc00;
  color: white;
  border: 2px solid #2f80ed;
}

.business-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.4);
}

.business-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Dashboard layout */
.dashboard-section {
  border: 2px none red;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 0;
  padding: 0 20px; /* small horizontal breathing room */
}

/* Sidebar section */
.sidebar-section {
  border: 2px none green;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin-top: 50px;
  gap: 20px;
  height: 100%;
}

.sidebar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  cursor: pointer;
  gap: 20px;
  padding: 0px 20px 0px 20px;
  width: 220px;
  transition: 1s;
}

.sidebar:hover {
  background: linear-gradient(-90deg, #dee9ff, #ffffff);
}

.sidebar img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.sidebar p {
  font-size: 15px;
}

/* Main section */
.main-section {
  border: 2px none green;
  background-color: #dee9ff;
  padding: 20px 70px;
  min-height: 1000px;
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-section h1 {
  border: 2px none black;
  font-size: 50px;
  font-weight: 900;
  text-align: left;
  width: 100%;
}

#dashboard-title sup {
  font-size: 20px;
  font-weight: 900;
  color: #0054fc;
}

#topic-description {
  font-size: 18px;
  opacity: .5;
  text-align: left;
  margin-top: -20px;
}

/* Training grid and cards */
.training-grid {
  border: 2px none red;
  display: grid;
  justify-content: flex-start;
  align-items: flex-start;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  padding: 10px;
}

.training {
  border: 2px none blue;
  cursor: pointer;
  display: flex;
  background-color: white;
  flex-direction: column;
  padding: 10px;
  margin: 0;
  width: 250px;
  border-radius: 10px;
  box-shadow: -5px 5px 0px rgb(0, 0, 0, .25);
  transition: .2s;
}

.training:hover {
  transform: translateY(-10px);
}

.training img {
  pointer-events: none;
  border-radius: 7px;
  width: 100%;
  height: 100px;
  object-fit: cover;
  margin: 0;
}

.training h3 {
  font-size: 20px;
  font-weight: 700;
  text-align: left;
  padding: 10px;
  margin: 0;
}

.training p {
  font-size: 15px;
  text-align: left;
  padding: 10px;
  margin: 0;
  opacity: .5;
}

/* Lessons list */
.lessons-div {
  border: 2px none red;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 10px;
  gap: 20px;
}

.lesson {
  width: 90%;
  background-color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px 0px 10px;
  box-shadow: -5px 5px 0px rgb(0, 0, 0, .25);
  cursor: pointer;
  transition: .2s;
}

.lesson:hover {
  transform: translateX(-10px);
}

.lesson h3 {
  font-size: 20px;
}

.lesson h3:hover {
  text-decoration: underline;
}

.lesson p {
  font-size: 15px;
  opacity: .5;
}

/* News */
.news-item {
  border-left: 2px solid #d4e3ff;
  border-top: 2px solid #d4e3ff;
  padding-left: 15px;
  padding-bottom: 15px;
  background: linear-gradient(135deg, #dee9ff, #ffffff);
}

#news-des {
  color: #0054fc;
  border-left: 5px solid #0054fc;
  padding: 10px;
  background: linear-gradient(90deg, #dee9ff, #ffffff);
}

.news-pin {
  cursor: pointer;
  transition: .2s;
}

.news-pin:hover {
  transform: scale(1.1);
  rotate: 10deg;
}

/* Hide news block under large widths (your intent) */
@media (max-width: 1600px) {
  .news-div {
    display: none;
  }
}

/* Training grid responsive */
@media (max-width: 1300px) {
  .training-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

@media (max-width: 1000px) {
  .main-section {
    padding: 20px 30px;
  }
}

/* Tablet-ish: shrink text in cards/lessons */
@media (max-width: 930px) {
  .training-grid {
    grid-template-columns: 1fr 1fr;
  }

  .training {
    width: 200px;
  }

  .training p,
  .lesson p {
    display: none;
  }
}

/* Dashboard and sidebar on small screens */
@media (max-width: 830px) {
  .dashboard-section {
    flex-direction: column;
    padding: 0 10px;
  }

  .sidebar-section {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    width: 100%;
  }

  .sidebar {
    width: auto;
    padding: 8px 12px;
    gap: 10px;
  }

  .sidebar p {
    font-size: 13px;
  }

  .sidebar:hover {
    background: linear-gradient(0deg, #dee9ff, #ffffff);
  }

  .main-section {
    margin-top: 16px;
  }
}

/* Phone layout for training cards */
@media (max-width: 570px) {
  .training-grid {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 12px;
  }

  .training {
    width: 90%;
    max-width: 360px;
    margin-inline: auto;
  }

  .training img {
    border: 2px solid #0054fc;
  }

  .training p {
    display: block;
    font-size: 14px;
  }
}

/* Divider styling */
.divider-div {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  margin-top: 50px;
}

.divider {
  border: 1px solid #7ea9ff;
  width: 100%;
}

.divider-div p {
  font-size: 15px;
  padding: 10px;
  font-weight: 900;
  color: #7ea9ff;
}

/* Modal Styles */

/* Modal overlay - HIDDEN by default */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  overflow: hidden;
  /* Hidden by default */
  display: none;
  /* When shown (via JS), center content */
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

/* When modal is shown via JS */
.modal[style*="display: block"] {
  display: flex !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal content */
.modal-content {
  background-color: #ffffff;
  border: 2px solid #dee9ff; /* changed from red */
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  padding: 30px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideDown 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Center on very small screens */
  margin: auto;
}

/*
.modal-content img {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 15px;
  margin-bottom: 20px;
}
*/

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h2 {
  color: #0054fc;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 10px;
  margin-top: 0;
}

.modal-content h3 {
  color: #0054fc;
  font-size: 22px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 15px;
}

#lesson-content {
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 20px;
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 8px;
}

#lesson-content p {
  margin-bottom: 15px;
}

#lesson-content ul,
#lesson-content ol {
  background: linear-gradient(135deg, #dee9ff, #ffffff);
  padding: 10px 30px;
  border-radius: 0px;
  border-left: 5px solid #0054fc;
}

#lesson-content li {
  margin-bottom: auto;
}
#lesson-content strong {
  color: #0054fc;
  font-weight: 700;
}
#lesson-content img {
  border: 2px solid #0054fc;
  width: 90%;
  border-radius: 10px;
}
#lesson-content h5 {
  background-color: #dee9ff;
  border: 2px solid #0054fc;
  color: #333;
  font-size: 16px;
  padding: 10px;
  border-radius: 10px;
  font-weight: 500;
}
#lesson-content a {
  color: #0054fc;
  font-weight: 700;
}
#lesson table {
  width:100%; 
  border-collapse: collapse;
}
#lesson tr {
  background-color: #f0f0f0;
}
#lesson th {
  border: 1px solid #ddd; 
  padding: 10px;
}
#lesson td {
  border: 1px solid #ddd; 
  padding: 10px;
}


.close {
  position: absolute;
  top: 16px;
  right: 22px;
  cursor: pointer;
  z-index: 1;
}

.close img {
  width: 40px;
  transition: .2s;
}

.close img:hover {
  transform: scale(.7);
}

/* Lesson navigation in modal */
.lesson-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid #dee9ff;
  gap: 12px;
  flex-shrink: 0;
}

.lesson-navigation button {
  padding: 12px 30px;
  background-color: #0054fc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
}

.lesson-navigation button:hover {
  background-color: #003dbd;
  transform: translateY(-2px);
}

.lesson-navigation button:active {
  transform: translateY(0);
}

.lesson-navigation button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.lesson-navigation button:disabled:hover {
  background-color: #ccc;
  transform: none;
}

#lesson-progress {
  font-size: 16px;
  font-weight: 700;
  color: #0054fc;
  flex: 1;
  text-align: center;
}

/* Tablet adjustments for modal */
@media (max-width: 900px) {
  .modal-content {
    width: 92%;
    max-width: 700px;
  }
}

/* Mobile adjustments for modal and main text/buttons */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 500px;
    padding: 18px 14px;
    max-height: 90vh;
  }

  .modal-content h2 {
    font-size: 22px;
    padding-right: 30px; /* space for close button */
  }

  .modal-content h3 {
    font-size: 18px;
  }

  #lesson-content {
    font-size: 15px;
    max-height: 60vh;
  }

  .lesson-navigation {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .lesson-navigation button {
    width: 100%;
    font-size: 14px;
    padding: 12px 0;
  }

  #lesson-progress {
    order: -1;
    font-size: 14px;
    text-align: center;
    margin-bottom: 6px;
  }

  .close {
    font-size: 28px;
    top: 12px;
    right: 16px;
  }

  /* Smaller headings and tighter CTA on mobile */
  .main-section h1 {
    font-size: 32px;
  }

  #topic-description {
    font-size: 15px;
  }

  .cta-buttons {
    padding: 1.2rem;
    gap: 0.6rem;
  }

  .cta-buttons button {
    padding: 10px 18px;
    font-size: 16px;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
  }
}

/* Very small phones */
@media (max-width: 480px) {
  .modal-content {
    width: 96%;
    padding: 14px 12px;
    max-height: 92vh;
    border-radius: 0px;
  }
}

/* Smooth scrollbar */
#lesson-content::-webkit-scrollbar {
  width: 6px;
}

#lesson-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#lesson-content::-webkit-scrollbar-thumb {
  background: #0054fc;
  border-radius: 10px;
}

#lesson-content::-webkit-scrollbar-thumb:hover {
  background: #003dbd;
}

/* Sidebar horizontal scrollbar */
.sidebar-section::-webkit-scrollbar {
  width: 3px;
}

/* Track */
.sidebar-section::-webkit-scrollbar-track {
  background: white;
}

/* Handle */
.sidebar-section::-webkit-scrollbar-thumb {
  background: #0054fc;
  border-radius: 0px;
}

/* Handle on hover */
.sidebar-section::-webkit-scrollbar-thumb:hover {
  background: black;
}
