


/* ─── Responsive Breakpoints ─── */

/* Desktop & Small Desktop (max-width: 1200px) */
@media (max-width: 1200px) {
  .cards-view {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {
  /* Sidebar Off-canvas */
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    z-index: 1050;
    transition: left 0.3s ease-in-out;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
  }
    .sidebar.mobile-open {
        left: 0 !important;
    }
  .burger-btn {
    display: flex;
  }
  .sidebar-close-btn {
    display: flex;
  }
    .results-header {
     
        flex-direction: column;
    }
    .list-col-name {
        width: 100%;
    }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
  }
  .sidebar-overlay.active {
    display: block;
  }
  
  /* Topbar Adjustments */
  .topbar {
    padding: 0 20px;
  }
  .page-content {
    padding: 24px;
  }

  /* Stat Cards */
  .stat-cards, .stat-cards-main {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-cards-detail {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Table View wrapping */
  .table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: 12px;
  }
}

/* Large Mobile / Small Tablet (max-width: 768px) */
@media (max-width: 768px) {
  
  /* Toolbar Wrap */
  .exams-toolbar {
    flex-wrap: wrap;
  }
  .search-input-wrap {
    order: 1;
    width: 100%;
    flex: 1 1 100%;
  }
  .toolbar-btn {
    order: 2;
    flex: 1;
    justify-content: center;
  }
  .result-count {
    order: 3;
    width: 100%;
    text-align: left;
    margin-top: 8px;
    margin-left: 4px;
  }

  /* Cards View */
  .cards-view {
    grid-template-columns: 1fr;
  }

  /* List View Stacked */
  .list-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .list-exam-name {
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
    margin-left: 28px; /* space for checkbox */
    margin-top: -24px; /* Align with checkbox visually */
    display: block;
  }
  .list-meta {
    width: 100%;
    margin-left: 28px;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .list-actions {
    margin-left: 28px;
    width: calc(100% - 28px);
    justify-content: space-between;
  }

  /* Table View as Stacked Cards */
  .table-view {
    border: none;
    background: transparent;
  }
  .exam-table, 
  .exam-table tbody, 
  .exam-table tr, 
  .exam-table td {
    display: block;
    width: 100%;
  }
  .exam-table thead {
    display: none; /* hide headers */
  }
  .exam-table tr {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 16px;
    position: relative;
  }
  .exam-table td {
    padding: 8px 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }
  .exam-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    margin-right: 16px;
    text-align: left;
    flex-shrink: 0;
  }
  /* Checkbox alignment */
  .exam-table td:first-child {
    justify-content: flex-start;
  }
  .exam-table td:first-child::before {
    display: none;
  }
  /* Actions alignment */
  .exam-table td:last-child {
    justify-content: flex-end;
  }
  
  /* Results Tables Stacked */
  .results-table {
    border: none;
    background: transparent;
  }
  .results-table, 
  .results-table tbody, 
  .results-table tr, 
  .results-table td {
    display: block;
    width: 100%;
  }
  .results-table thead {
    display: none;
  }
  .results-table tr {
    background: var(--card-bg, #fff);
    border: 1.5px solid var(--border, #D1D5DB);
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 16px;
  }
  .results-table td {
    padding: 8px 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }
  .results-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted, #6B7280);
    text-transform: uppercase;
    margin-right: 16px;
    text-align: left;
    flex-shrink: 0;
  }
  .results-table td:last-child {
    justify-content: flex-end;
  }

  /* Score Journey */
  .score-journey-graph {
    flex-direction: column;
    align-items: center;
  }
  .sj-arrow {
    transform: rotate(90deg);
    margin: 16px 0;
  }
  
  /* Dropdown adjustment inside stacked table */
  .exam-dropdown-menu {
    right: 0;
    left: auto;
  }
}

/* Mobile (max-width: 576px) */
@media (max-width: 576px) {
  /* Stat Cards */
  .stat-cards, .stat-cards-main, .stat-cards-detail {
    grid-template-columns: 1fr !important;
  }
  .stat-value {
    font-size: 1.6rem; /* Reduced from 1.9rem */
  }
  .stat-icon {
    width: 38px; /* Reduced from 42px */
    height: 38px;
  }

  /* Topbar Adjustments */
  .topbar-actions {
    gap: 8px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .avatar {
    width: 34px;
    height: 34px;
  }
  .breadcrumb-nav .text-muted {
    display: none;
  }
  .breadcrumb-nav .sep {
    display: none;
  }

  /* Pagination */
  .pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .page-nav {
    order: 1;
  }
  .page-info {
    order: 2;
    width: 100%;
    text-align: center;
  }
  .rows-select {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  
  /* Hide secondary meta fields on list items */
  .list-meta span:nth-child(2),
  .list-meta span:nth-child(3) {
    display: none;
  }
  
  .list-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-continue {
    justify-content: center;
  }
  .exam-dropdown {
    align-self: flex-end;
    margin-top: 8px;
  }

  /* Exam Cards Internal Responsive */
  .card-footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .card-footer-row > div {
    width: 100%;
  }
  .card-actions {
    width: 100%;
    justify-content: space-between;
  }
  .card-actions .btn-continue {
    flex: 1;
    margin-right: 8px;
  }
  .card-stats {
    gap: 8px;
  }

  /* Profile Card & Overview Card */
  .participant-profile-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .ppc-right {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    gap: 8px;
  }
  .eoc-meta {
    font-size: 0.75rem;
  }
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  /* Modal / Cards Row */
  .cards-row {
    flex-direction: column;
    gap: 12px;
  }
  
  /* Pagination inside results */
  .pagination-container {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
}
