/* General Styles */
body {
    background-image: url(indexBGimg.jpg);
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    background-size: cover;
  }

  /* Teacher Dashboard - Use same background as student dashboard */
  body:has(.teacher-dashboard-container) {
    background-image: url(indexBGimg.jpg);
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    background-size: cover;
  }

  /* Login Box Styles */
  .login-box {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 15px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  /* Form Floating Input Styles */
  .form-floating label {
    color: #333;
    font-weight: bold;
  }
  
  /* Form Input Field Styles */
  .form-control {
    border-radius: 10px;
    border: 1px solid #ccc;
    box-shadow: none;
    transition: all 0.3s ease;
  }
  
  /* Focused Input Field */
  .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
  }
  
  /* Button Styles */
  .btn-primary {
    background-color: #007bff;
    border: none;
    padding: 10px;
    font-size: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
  }
  
  .btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
  }
  
  /* Form Checkbox Styles */
  .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #007bff;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.2);
    border-color: #0056b3;
  }

  .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
  }

  .form-check-label {
    font-weight: 600;
    color: #1f2933;
    cursor: pointer;
  }

  /* Responsive Design */
  @media (max-width: 576px) {
    .login-box {
      width: 90%;
      padding: 1.5rem;
      margin: 1rem;
    }
  }
  
  /* Dashboard-specific styles moved from dashboard.html */
  @media (max-width: 767.98px) {
    .sidebar-offcanvas {
      width: 80vw !important;
      max-width: 320px;
    }
    .main-content-mobile {
      padding: 1rem 0.5rem;
      margin-left: 0 !important;
      width: 100%;
      overflow-x: auto;
    }
    .qrcode-wrapper {
      max-width: 250px;
    }
    #qrcode.d-inline-block img, #qrcode.d-inline-block canvas,
    #qrcodeMobile.d-inline-block img, #qrcodeMobile.d-inline-block canvas {
      max-width: 190px;
    }
    .container-fluid {
      padding-left: 0.5rem;
      padding-right: 0.5rem;
    }
    .card {
      margin-bottom: 1rem;
    }
    .table-responsive {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
  }
  @media (max-width: 575.98px) {
    .table-responsive {
      font-size: 0.85rem;
    }
    .card-title {
      font-size: 1rem;
    }
    .card-header h5 {
      font-size: 1rem;
    }
    .table {
      font-size: 0.85rem;
    }
    .table th,
    .table td {
      padding: 0.5rem 0.25rem;
    }
    .btn {
      font-size: 0.875rem;
      padding: 0.375rem 0.75rem;
    }
    .form-select {
      font-size: 0.875rem;
    }
  }
  .qrcode-wrapper {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  #qrcode.d-inline-block img, #qrcode.d-inline-block canvas,
  #qrcodeMobile.d-inline-block img, #qrcodeMobile.d-inline-block canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    pointer-events: none !important;
    cursor: default !important;
  }
  
  /* Completely disable any hover effects on QR codes */
  .qrcode-wrapper img,
  .qrcode-wrapper canvas,
  #qrcode img,
  #qrcode canvas,
  #qrcodeMobile img,
  #qrcodeMobile canvas {
    pointer-events: none !important;
    cursor: default !important;
  }
  
  .qrcode-wrapper img:hover,
  .qrcode-wrapper canvas:hover,
  #qrcode img:hover,
  #qrcode canvas:hover,
  #qrcodeMobile img:hover,
  #qrcodeMobile canvas:hover {
    pointer-events: none !important;
    cursor: default !important;
  }
  
  /* Override any tooltip libraries */
  .qrcode-wrapper *,
  #qrcode *,
  #qrcodeMobile * {
    pointer-events: none !important;
    cursor: default !important;
  }
  
  /* Disable tooltips globally for QR code areas */
  .qrcode-wrapper [title],
  #qrcode [title],
  #qrcodeMobile [title] {
    pointer-events: none !important;
    cursor: default !important;
  }
  
  @media (min-width: 768px) {
    .fixed-sidebar {
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      width: 270px;
      z-index: 1030;
      border-right: 1px solid #e0e0e0;
      background: #f8f9fa;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
    }
    .main-content-mobile {
      margin-left: 270px !important;
      padding-left: 1.5rem;
      padding-right: 1.5rem;
      width: calc(100% - 270px);
      max-width: none;
    }
    .container-fluid .row {
      margin-left: 0;
      margin-right: 0;
    }
  }
  @media (min-width: 992px) {
    .main-content-mobile {
      padding-left: 2rem;
      padding-right: 2rem;
    }
  }
  #userStatsTable th.char-col, #userStatsTable td.char-col,
  #studentStatsTable th.char-col, #studentStatsTable td.char-col {
    min-width: 28px;
    max-width: 40px;
    width: auto;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center;
  }
  #userStatsTable th.stat-col, #userStatsTable td.stat-col,
  #studentStatsTable th.stat-col, #studentStatsTable td.stat-col {
    min-width: 80px;
    width: auto;
    text-align: center;
  }
  @media (max-width: 575.98px) {
    #userStatsTable th.stat-col, #userStatsTable td.stat-col,
    #studentStatsTable th.stat-col, #studentStatsTable td.stat-col {
      min-width: 60px;
      font-size: 0.8rem;
    }
    #userStatsTable th.char-col, #userStatsTable td.char-col,
    #studentStatsTable th.char-col, #studentStatsTable td.char-col {
      min-width: 24px;
      max-width: 32px;
    }
  }
  
  /* Account Type Selection Styles */
  .account-type-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .account-type-option {
    cursor: pointer;
    flex: 1;
    max-width: 120px;
  }
  
  .account-type-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }
  
  .account-type-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
  }
  
  .account-type-card.selected {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-color: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
  }
  
  .account-type-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    pointer-events: none;
  }
  
  .account-type-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
  }
  
  .account-type-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
  }
  
  .account-type-card.selected .account-type-label {
    color: white;
  }
  
  /* Responsive design for account type */
  @media (max-width: 576px) {
    .account-type-container {
      flex-direction: column;
      gap: 0.75rem;
    }
    
    .account-type-option {
      max-width: none;
    }
    
    .account-type-card {
      padding: 1rem;
    }
    
    .account-type-icon {
      font-size: 1.5rem;
    }
  }


  /* Teacher Dashboard - General Card Improvements */
  .teacher-dashboard-container .card {
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    background-color: #ffffff;
  }
  
  /* Make cards full height */
  .teacher-dashboard-container {
    min-height: calc(100vh - 76px);
    display: flex;
    flex-direction: column;
  }
  
  .teacher-dashboard-container .row {
    flex: 1;
    min-height: 0;
  }
  
  .teacher-dashboard-container .col-lg-6 {
    display: flex;
    flex-direction: column;
  }
  
  .teacher-dashboard-container .card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  
  .teacher-dashboard-container .card-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  
  /* Fix table container to use available space */
  .teacher-dashboard-container .table-responsive {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  
  .teacher-dashboard-container .table-responsive table {
    margin-bottom: 0;
  }

  .card-header {
    border-radius: 12px 12px 0 0 !important;
    background-color: #ffffff;
  }

  /* Teacher Dashboard Sections Table */
  #sectionsList tr {
    cursor: pointer;
    transition: all 0.2s ease;
  }

  #sectionsList tr:hover {
    background-color: #f0f7ff;
    transform: translateX(2px);
  }

  #sectionsList tr:hover td:first-child {
    background-color: #f0f7ff;
  }

  #sectionsList code {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #90caf9;
    border-radius: 6px;
    font-weight: 600;
    color: #1976d2;
  }

  #sectionsList .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    border-radius: 12px;
    font-weight: 600;
  }

  /* Section Content Toggle - Ensure only one is visible */
  #sectionContent.section-hidden,
  #sectionContent[style*="display: none"] {
    display: none !important;
  }

  #sectionContentEmpty.section-hidden,
  #sectionContentEmpty[style*="display: none"] {
    display: none !important;
  }

  #sectionContent:not(.section-hidden) {
    display: block !important;
  }

  #sectionContentEmpty:not(.section-hidden) {
    display: flex !important;
  }

  /* Hamburger menu button */
  .dropdown button[data-bs-toggle="dropdown"] {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s ease;
  }

  .dropdown button[data-bs-toggle="dropdown"]:hover {
    background-color: #f0f7ff;
    border-color: #90caf9;
    transform: scale(1.05);
  }

  .dropdown button[data-bs-toggle="dropdown"]:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #90caf9;
  }

  /* Dropdown menu improvements */
  .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    padding: 0.5rem;
  }

  .dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
  }

  .dropdown-item:hover {
    background-color: #f0f7ff;
    transform: translateX(4px);
  }

  /* Button improvements */
  .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
  }

  .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .btn:active {
    transform: translateY(0);
  }

  /* Table improvements */
  .table {
    border-radius: 8px;
    overflow: hidden;
  }

  .table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #495057;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
  }

  .table tbody td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
  }

  /* Input group improvements */
  .input-group-text {
    border-radius: 8px 0 0 8px;
    background-color: #f8f9fa;
    border-color: #ced4da;
  }

  .form-control, .form-select {
    border-radius: 8px;
    transition: all 0.2s ease;
  }

  .form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
  }

  /* Empty state improvements */
  #sectionContentEmpty {
    background: #ffffff;
  }

  /* Modal improvements */
  .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  }

  .modal-header {
    padding: 1.25rem 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
  }

  /* Navbar improvements */
  .navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
  }

  /* Badge improvements */
  .badge {
    padding: 0.4rem 0.7rem;
    font-weight: 500;
    border-radius: 12px;
  }

  /* Teacher Dashboard Desktop Layout */
  @media (min-width: 992px) {
    .teacher-dashboard-container {
      padding-bottom: 2rem;
    }
    
    .teacher-dashboard-container .container-fluid {
      max-width: 1400px;
      height: 100%;
    }
    
    .teacher-dashboard-container .col-lg-6 {
      padding-left: 1rem;
      padding-right: 1rem;
    }
    
    .teacher-dashboard-container .card {
      margin-bottom: 0;
    }
  }

  /* Teacher Dashboard Mobile Styles */
  @media (max-width: 991.98px) {
    .col-lg-6 {
      margin-bottom: 1.5rem;
    }
  }

  @media (max-width: 767.98px) {
    .navbar-brand {
      font-size: 1rem;
    }
    .card-header {
      flex-direction: column;
      align-items: flex-start !important;
      gap: 0.5rem;
    }
    .card-header h5 {
      margin-bottom: 0;
    }
    .card-header > div {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
    /* Mobile: Better close button placement in section header */
    #sectionContent .card-header {
      flex-direction: row;
    }
    #sectionContent .card-header > div:first-child {
      width: 100%;
    }
    #sectionContent .card-header > div:first-child > div:first-child {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    #sectionContent .card-header > div:last-child {
      width: 100%;
      margin-top: 0.5rem;
    }
    .form-select.form-select-sm {
      width: 100% !important;
      margin-bottom: 0.5rem;
    }
    .table-responsive {
      margin: 0 -0.5rem;
      padding: 0 0.5rem;
    }
    #sectionsList th:nth-child(2),
    #sectionsList td:nth-child(2) {
      min-width: 120px;
    }
    .btn-sm {
      font-size: 0.8rem;
      padding: 0.35rem 0.65rem;
    }
  }
