/* ==========================================================================
   ITDA Centralized School Monitoring & Management System (Record Wise V2)
   responsive.css - Breakpoints for Desktop, Laptop, Tablet & Mobile Devices
   ========================================================================== */

/* Laptop / Medium Screens (<= 1200px) */
@media (max-width: 1200px) {
  .global-search-container {
    width: 200px;
  }

  .global-search-input:focus {
    width: 240px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .col-8, .col-4 {
    grid-column: span 12;
  }
}

/* Tablet Screens (<= 992px) */
@media (max-width: 992px) {
  /* Sidebar off-canvas drawer */
  .app-sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 1000;
  }

  .app-container.mobile-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-container.mobile-sidebar-open .sidebar-overlay {
    display: block;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .app-header {
    padding: 0 1.25rem;
  }

  .main-content {
    padding: 1.25rem;
  }

  .user-details-small {
    display: none;
  }

  .col-6, .col-4, .col-3 {
    grid-column: span 12;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  html {
    font-size: 13.5px;
  }

  .global-search-container {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-search-box {
    min-width: 100%;
  }

  .table-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .table-pagination {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .modal-dialog {
    max-width: calc(100% - 1rem);
    margin: 0.5rem auto;
    max-height: 96vh;
    border-radius: var(--radius-lg);
  }

  .modal-body {
    padding: 1rem;
    max-height: calc(96vh - 120px);
  }

  .modal-footer {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
  }

  /* Form columns full width on mobile */
  .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-row > [class*="col-"],
  .col-12, .col-8, .col-6, .col-4, .col-3, .col-2 {
    grid-column: span 12 !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
  }

  .marks-input {
    width: 70px;
    padding: 0.35rem 0.3rem;
    font-size: 0.85rem;
  }
}

/* Ultra Small Mobile (<= 480px) */
@media (max-width: 480px) {
  .breadcrumb-nav {
    display: none;
  }

  .btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
  }

  .page-title-group h1 {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   Print & PDF Export Styles
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 11pt !important;
  }

  .app-sidebar,
  .app-header,
  .sidebar-overlay,
  .page-actions,
  .table-toolbar,
  .toast-container,
  .modal-backdrop,
  .btn {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .main-content {
    padding: 0 !important;
    margin: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
    break-inside: avoid;
    margin-bottom: 1rem !important;
  }

  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
  }

  .kpi-card {
    box-shadow: none !important;
    border: 1px solid #d1d5db !important;
    padding: 0.5rem !important;
  }

  table.data-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  table.data-table th,
  table.data-table td {
    border: 1px solid #e5e7eb !important;
    padding: 6px 8px !important;
    color: #111827 !important;
  }

  .badge {
    border: 1px solid #ccc !important;
    color: #111827 !important;
  }
}
