/* =========================================================
   GLOBAL RESPONSIVE FIXES FOR SCHOOL PORTAL
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

table {
  max-width: 100%;
}

/* Make wide tables scroll on mobile */
.responsive-table,
.table-responsive,
.roadmap-box,
.mail-main,
.admin-content,
.teacher-content,
.student-content,
.content,
.main-content {
  max-width: 100%;
}

/* =========================================================
   MOBILE TABLE SCROLL
   ========================================================= */

@media (max-width: 768px) {
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  thead,
  tbody,
  tr {
    width: 100%;
  }

  th,
  td {
    font-size: 12px;
    padding: 6px;
  }
}

/* =========================================================
   FORMS
   ========================================================= */

@media (max-width: 768px) {
  input,
  select,
  textarea,
  button {
    max-width: 100%;
    font-size: 14px;
  }

  input,
  select,
  textarea {
    width: 100% !important;
  }

  button,
  .btn,
  .mail-button {
    width: 100%;
    margin-bottom: 8px;
  }

  form {
    max-width: 100%;
  }
}

/* =========================================================
   ROADMAP RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
  .roadmap-box {
    padding: 10px !important;
    margin-bottom: 12px !important;
    overflow-x: auto;
  }

  .roadmap-grid-form {
    display: block !important;
  }

  .roadmap-grid-form label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
  }

  .roadmap-table {
    display: block;
    overflow-x: auto;
    width: 100%;
    font-size: 12px;
  }

  .roadmap-table th,
  .roadmap-table td {
    min-width: 120px;
    font-size: 12px;
    padding: 6px;
  }

  .unit-heading {
    font-size: 18px !important;
  }

  .exam-final-label,
  .assessment-label {
    min-width: 180px !important;
    padding: 6px 20px !important;
  }
}

/* =========================================================
   MAIL RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
  .mail-layout {
    display: block !important;
    min-height: auto !important;
  }

  .mail-sidebar {
    width: 100% !important;
    border-right: 0 !important;
    border-bottom: 1px solid #ccc;
  }

  .mail-main {
    width: 100% !important;
    padding: 10px !important;
  }

  .mail-toolbar {
    display: block !important;
  }

  .mail-search {
    display: block !important;
  }

  .mail-search input {
    width: 100% !important;
    margin-bottom: 8px;
  }

  .mail-list-box {
    overflow-x: auto;
  }

  .mail-table {
    min-width: 700px;
  }

  .mail-reader {
    margin-top: 12px;
  }

  .compose-modal {
    width: 96% !important;
    margin: 15px auto !important;
    max-height: 94vh !important;
  }

  .compose-modal-actions {
    display: block !important;
  }
}

/* =========================================================
   ADMIN / TEACHER / STUDENT LAYOUT GENERAL FIX
   ========================================================= */

@media (max-width: 768px) {
  .admin-layout,
  .teacher-layout,
  .student-layout,
  .dashboard-layout {
    display: block !important;
  }

  .admin-sidebar,
  .teacher-sidebar,
  .student-sidebar,
  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    height: auto !important;
  }

  .admin-main,
  .teacher-main,
  .student-main,
  .main-content,
  .content {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 10px !important;
  }

  .admin-nav-link,
  .teacher-nav-link,
  .student-nav-link {
    display: block;
    padding: 10px;
  }
}

/* =========================================================
   CARDS / DASHBOARD
   ========================================================= */

@media (max-width: 768px) {
  .card,
  .dashboard-card,
  .stat-card,
  .course-card {
    width: 100% !important;
    margin-bottom: 12px;
  }

  .grid,
  .dashboard-grid,
  .cards-grid {
    display: block !important;
  }
}