/* General Styles */
.kids-lms-admin-dashboard,
.kids-lms-student-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.dashboard-section {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
  color: #2c3e50;
  margin-bottom: 30px;
  font-size: 24px;
}

h3 {
  color: #34495e;
  margin-bottom: 20px;
  font-size: 20px;
}

/* Forms */
form {
  margin-bottom: 20px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}

button:hover {
  background: #2980b9;
}

/* Tables */
.classes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.classes-table th,
.classes-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.classes-table th {
  background: #f8f9fa;
  font-weight: 600;
}

/* Progress Bars */
.progress-bar {
  background: #eee;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress {
  background: #2ecc71;
  height: 100%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 14px;
  color: #666;
}

/* Class Cards */
.enrolled-classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.class-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.class-card h4 {
  color: #2c3e50;
  margin-bottom: 10px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-dialog {
  display: flex !important;
  align-items: center;
  min-height: 100vh;
  justify-content: center;
}

.modal-content {
  position: relative;
  background: #fff;
  margin: 50px auto;
  padding: 20px;
  width: 80%;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-body {
  overflow-y: auto;
  max-height: 60vh;
}

.close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

/* Last Topic Section */
.last-topic {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.last-topic h4 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.last-topic p {
  color: #666;
  margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .enrolled-classes {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    margin: 20px auto;
  }
}

/* Admin Dashboard Layout Fixes */
.kids-lms-admin-dashboard .sidebar {
  border-right: 1px solid #eee;
  background: #fff;
  min-height: 100vh;
}
.kids-lms-main-content {
  background: #f8f9fa;
  min-height: 100vh;
  padding-bottom: 40px;
}
.kids-lms-admin-dashboard .card {
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.kids-lms-admin-dashboard .card-header {
  background: #fff;
  border-bottom: 1px solid #f1f1f1;
  font-weight: 600;
}
.kids-lms-admin-dashboard .list-group-item {
  border: none;
  background: transparent;
}
.kids-lms-admin-dashboard .rounded-circle {
  object-fit: cover;
}
@media (max-width: 991px) {
  .kids-lms-admin-dashboard .sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #eee;
  }
  .kids-lms-main-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Stronger scroll lock for all modals, including fullscreen */
body.modal-open,
html.modal-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}
.modal-fullscreen {
  height: auto !important;
}

/* Student Dashboard Styles */
.kids-lms-student-dashboard {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.kids-lms-student-dashboard .sidebar {
  border-right: 1px solid #e9ecef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: 0;
  position: relative;
  background: #fff;
  z-index: 2;
  overflow-y: auto;
}
.kids-lms-student-dashboard .sidebar .nav {
  flex: 1 1 auto;
}
.kids-lms-student-dashboard .sidebar .nav-link {
  color: #495057;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
  padding: 0.75rem 1.25rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kids-lms-student-dashboard .sidebar .nav-link.active {
  background: #e7f1ff;
  color: #0d6efd;
  font-weight: 600;
}
.kids-lms-student-dashboard .sidebar .nav-link:hover {
  background: #f8f9fa;
  color: #0d6efd;
}
.kids-lms-student-dashboard .sidebar .position-absolute.bottom-0 {
  position: static !important;
  margin-top: auto;
  border-top: 1px solid #e9ecef;
  background: #fff;
  padding: 1.5rem 1rem 1.5rem 1rem;
  text-align: center;
}
.kids-lms-student-dashboard .sidebar .rounded-circle {
  margin-bottom: 0.5rem;
}
.kids-lms-student-dashboard .sidebar .fw-bold {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  word-break: break-all;
}
.kids-lms-student-dashboard .sidebar .text-muted.small {
  font-size: 0.92rem;
  color: #6c757d !important;
  margin-bottom: 0.1rem;
}

/* --- MAIN CONTENT --- */
.kids-lms-main-content,
.kids-lms-student-dashboard main {
  padding-top: 2.5rem !important;
  padding-bottom: 2.5rem !important;
  padding-left: 2.5rem !important;
  padding-right: 2.5rem !important;
  background: #f8f9fa;
  min-height: 100vh;
}

/* --- CARDS --- */
.kids-lms-student-dashboard .card {
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border: none;
  background: #fff;
}
.kids-lms-student-dashboard .card-body {
  padding: 2rem 1.5rem;
}
.kids-lms-student-dashboard .progress,
.kids-lms-student-dashboard .progress-bar {
  border-radius: 8px;
}
.kids-lms-student-dashboard .progress {
  background: #f1f3f5;
}

/* --- DASHBOARD CARDS --- */
#dashboard-courses-overview > .col-md-4 {
  margin-bottom: 1.5rem;
}
.kids-lms-student-dashboard .row.g-3 > .col-md-6 {
  margin-bottom: 1.5rem;
}
.kids-lms-student-dashboard .card {
  min-height: 180px;
}

/* --- SEARCH BAR --- */
.kids-lms-student-dashboard .search-bar,
.kids-lms-student-dashboard form.d-flex {
  background: #fff;
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid #e9ecef;
  max-width: 350px;
}
.kids-lms-student-dashboard .search-bar .form-control,
.kids-lms-student-dashboard form.d-flex .form-control {
  border: none;
  padding: 0.75rem 1rem;
  background: transparent;
  font-size: 1rem;
}
.kids-lms-student-dashboard .search-bar .form-control:focus,
.kids-lms-student-dashboard form.d-flex .form-control:focus {
  box-shadow: none;
  outline: none;
}
.kids-lms-student-dashboard .search-bar .btn,
.kids-lms-student-dashboard form.d-flex .btn {
  border-radius: 0 25px 25px 0;
  padding: 0.75rem 1.5rem;
  border: 1px solid #e9ecef;
  background: #fff;
  color: #0d6efd;
  transition: background 0.2s, color 0.2s;
}
.kids-lms-student-dashboard .search-bar .btn:hover,
.kids-lms-student-dashboard form.d-flex .btn:hover {
  background: #0d6efd;
  color: #fff;
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
  .kids-lms-main-content,
  .kids-lms-student-dashboard main {
    padding: 1.25rem !important;
  }
  .kids-lms-student-dashboard .sidebar {
    min-width: 100px;
    max-width: 220px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
@media (max-width: 768px) {
  .kids-lms-student-dashboard .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 220px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
  }
  .kids-lms-student-dashboard .sidebar.show {
    left: 0;
  }
  .kids-lms-student-dashboard main {
    margin-left: 0;
    width: 100%;
  }
  #kidsLmsCourseContentModal .modal-dialog {
    max-width: 95%;
    margin: 1rem;
  }
}

/* --- FIXES FOR OVERLAP --- */
.kids-lms-student-dashboard .sidebar .nav {
  margin-bottom: 2rem;
}
.kids-lms-student-dashboard .sidebar .position-absolute.bottom-0 {
  margin-top: 2rem;
}

/* Course Cards */
.course-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e9ecef;
  cursor: pointer;
  overflow: hidden;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.course-card .card-img-top {
  transition: transform 0.3s ease;
}

.course-card:hover .card-img-top {
  transform: scale(1.05);
}

.course-card .card-body {
  padding: 1.5rem;
}

.course-card .progress {
  border-radius: 10px;
  background-color: #f8f9fa;
}

.course-card .progress-bar {
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* Progress Circle */
.progress-circle {
  transition: stroke-dashoffset 0.5s ease;
}

/* Course Content Modal */
#kidsLmsCourseContentModal .modal-dialog {
  max-width: 90%;
}

#kidsLmsCourseContentModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.course-content-text {
  line-height: 1.6;
  font-size: 1rem;
}

.course-content-ebook iframe,
.course-content-video iframe {
  border: none;
  border-radius: 8px;
}

.course-content-video video {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Recent Activity */
.activity-item {
  padding: 0.75rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.activity-item:hover {
  background-color: #f8f9fa;
}

/* Progress Report Table */
.progress-table {
  font-size: 0.9rem;
}

.progress-table th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
}

.progress-table td {
  vertical-align: middle;
}

/* Analytics Cards */
.analytics-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease;
}

.analytics-card:hover {
  transform: translateY(-2px);
}

.analytics-card h4 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.analytics-card.success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.analytics-card.warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.analytics-card.info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Status Badges */
.status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Message Display */
#kids-lms-student-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
  max-width: 400px;
}

#kids-lms-student-messages .alert {
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Search Bar */
.search-bar {
  background: white;
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.search-bar .form-control {
  border: none;
  padding: 0.75rem 1rem;
}

.search-bar .form-control:focus {
  box-shadow: none;
}

.search-bar .btn {
  border-radius: 0 25px 25px 0;
  padding: 0.75rem 1.5rem;
}

/* Course Cards */
.course-card {
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.125) !important;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(13, 110, 253, 0.15) !important;
  border-color: rgba(13, 110, 253, 0.25) !important;
}

.course-card .card-img-top {
  transition: all 0.3s ease;
}

.course-card:hover .card-img-top {
  transform: scale(1.05);
}

.course-card .card-body {
  transition: all 0.3s ease;
}

.course-card:hover .card-body {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.course-card .card-title {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1rem;
  line-height: 1.4;
}

.course-card .btn {
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
}

.course-card:hover .btn {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* Course Image Styles */
.course-card .card-img-top {
  border-radius: 0.375rem 0.375rem 0 0;
  object-fit: cover;
}

/* Responsive Course Grid */
@media (max-width: 767px) {
  .course-card .card-img-top {
    height: 150px !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .course-card .card-img-top {
    height: 180px !important;
  }
}
