/**
 * CECCM Design System - Responsive Design Utilities
 * 
 * Comprehensive responsive styles for images, forms, tables, and videos
 * Ensures all content displays properly on mobile devices
 * 
 * Version: 1.0.0
 * Date: 2026-03-13
 */

/* ============================================
   RESPONSIVE IMAGES
   ============================================ */

/* Base responsive image */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive image utility classes */
.img-responsive {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Responsive image with aspect ratio */
.img-aspect {
  position: relative;
  overflow: hidden;
}

.img-aspect img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Aspect ratio utilities */
.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-portrait {
  aspect-ratio: 3 / 4;
}

.aspect-landscape {
  aspect-ratio: 4 / 3;
}

/* Thumbnail responsive styles */
.video-thumbnail img,
.thumbnail img,
.card-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Avatar responsive styles */
.user-avatar,
.user-avatar-small,
.avatar {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* Logo responsive */
.logo-img {
  max-width: 100%;
  height: auto;
}

/* Profile images and avatars */
.profile-avatar,
.profile-avatar img {
  width: 100%;
  max-width: 150px;
  height: auto;
  border-radius: var(--radius-full, 50%);
  object-fit: cover;
}

/* Card and grid images */
.card-img-top,
.card-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Background images */
.bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Image gallery responsive */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2, 0.5rem);
}

.image-gallery img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-md, 8px);
}

/* Mobile image optimizations */
@media (max-width: 640px) {
  .profile-avatar,
  .profile-avatar img {
    max-width: 100px;
  }

  .image-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .image-gallery img {
    height: 120px;
  }
}

/* ============================================
   RESPONSIVE VIDEOS
   ============================================ */

/* Video container with aspect ratio */
.video-container,
.video-player,
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.video-container iframe,
.video-container video,
.video-player iframe,
.video-player video,
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive video element (no container) */
video {
  max-width: 100%;
  height: auto;
}

/* Video card responsive */
.video-card .video-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-card .video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base, 0.3s ease);
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

/* Live stream video responsive */
.live-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

.live-video-container iframe,
.live-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Video player section responsive */
.video-player-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6, 1.5rem);
  margin-bottom: var(--space-8, 2rem);
}

/* Video details responsive */
.video-details {
  padding: var(--space-4, 1rem);
}

.video-details h1 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: var(--space-3, 0.75rem);
}

.video-description {
  color: var(--color-text-secondary, #94a3b8);
  line-height: var(--leading-relaxed, 1.625);
  margin-bottom: var(--space-4, 1rem);
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 0.75rem);
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, #64748b);
}

/* Video grid modern responsive */
.video-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: var(--space-6, 1.5rem);
}

/* Video filter form responsive */
.video-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4, 1rem);
  align-items: center;
}

.video-filter-form .filter-group {
  flex: 1;
  min-width: 200px;
}

.video-filter-form .btn {
  flex-shrink: 0;
}

/* Comments section responsive */
.comments-section {
  margin-top: var(--space-8, 2rem);
  padding: var(--space-6, 1.5rem);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

.comment {
  display: flex;
  gap: var(--space-3, 0.75rem);
  padding: var(--space-4, 1rem);
  border-radius: var(--radius-lg, 12px);
}

.comment-avatar {
  flex-shrink: 0;
}

.comment-avatar .avatar-initial {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  border-radius: 50%;
  font-weight: var(--font-weight-bold, 700);
  color: #0a0e1a;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  margin-bottom: var(--space-2, 0.5rem);
}

.comment-author {
  font-weight: var(--font-weight-semibold, 600);
}

.comment-badge {
  padding: 2px var(--space-2, 0.5rem);
  background: rgba(6, 182, 212, 0.15);
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-xs, 0.75rem);
  color: #06b6d4;
}

.comment-time {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #64748b);
}

.comment-text {
  line-height: var(--leading-relaxed, 1.625);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.comment-actions {
  display: flex;
  gap: var(--space-3, 0.75rem);
  margin-top: var(--space-2, 0.5rem);
}

.btn-reply,
.btn-delete {
  background: none;
  border: none;
  color: var(--color-text-secondary, #94a3b8);
  cursor: pointer;
  font-size: var(--text-sm, 0.875rem);
  padding: 0;
  transition: color var(--transition-fast, 0.15s ease);
}

.btn-reply:hover,
.btn-delete:hover {
  color: var(--color-accent-cyan, #06b6d4);
}

.btn-delete:hover {
  color: #ef4444;
}

/* Reply form */
.reply-form {
  margin-top: var(--space-3, 0.75rem);
  padding: var(--space-3, 0.75rem);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md, 8px);
}

.reply-form textarea {
  width: 100%;
  min-height: 80px;
  margin-bottom: var(--space-2, 0.5rem);
}

/* Related videos responsive */
.related-videos {
  margin-top: var(--space-8, 2rem);
}

.related-videos .video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4, 1rem);
}

/* Mobile video styles */
@media (max-width: 768px) {
  .video-player-section {
    gap: var(--space-4, 1rem);
  }

  .video-details {
    padding: var(--space-3, 0.75rem);
  }

  .video-meta {
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
  }

  .video-grid-modern {
    grid-template-columns: 1fr;
    gap: var(--space-4, 1rem);
  }

  .video-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .video-filter-form .filter-group {
    min-width: 100%;
  }

  .video-filter-form .btn {
    width: 100%;
  }

  .comments-section {
    padding: var(--space-4, 1rem);
  }

  .comment {
    padding: var(--space-3, 0.75rem);
  }

  .comment-avatar .avatar-initial {
    width: 32px;
    height: 32px;
    font-size: var(--text-sm, 0.875rem);
  }

  .related-videos .video-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .video-container,
  .video-player,
  .video-wrapper {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md, 8px);
  }

  .video-details h1 {
    font-size: 1.125rem;
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   RESPONSIVE FORMS
   ============================================ */

/* Form row - stacks on mobile */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4, 1rem);
}

/* Form group responsive */
.form-group {
  margin-bottom: var(--space-5, 1.25rem);
}

/* Search and filter forms */
.search-filter-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4, 1rem);
  align-items: end;
}

.search-filter-form .form-group-buttons {
  display: flex;
  gap: var(--space-2, 0.5rem);
  flex-wrap: wrap;
}

/* Form inputs responsive */
.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Form labels */
.form-group label {
  display: block;
  margin-bottom: var(--space-2, 0.5rem);
  font-weight: var(--font-weight-medium, 500);
}

/* Form buttons container */
.form-buttons {
  display: flex;
  gap: var(--space-3, 0.75rem);
  flex-wrap: wrap;
}

/* Inline form - stacks on mobile */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 0.75rem);
  align-items: center;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: var(--space-3, 0.75rem);
  margin-top: var(--space-6, 1.5rem);
  flex-wrap: wrap;
}

/* Contact form responsive */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-8, 2rem);
  margin-bottom: var(--space-8, 2rem);
}

.contact-info {
  padding: var(--space-6, 1.5rem);
}

.contact-form {
  padding: var(--space-6, 1.5rem);
}

/* Form card styling */
.contact-form form,
.add-comment-form form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

/* Textarea responsive */
textarea {
  min-height: 120px;
  resize: vertical;
}

/* Checkbox and radio responsive */
.form-check,
.checkbox-group,
.radio-group {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  flex-wrap: wrap;
}

/* File input responsive */
input[type="file"] {
  width: 100%;
  max-width: 100%;
}

/* Form helper text */
.form-helper-text,
.form-text {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #64748b);
  margin-top: var(--space-1, 0.25rem);
}

/* Error messages responsive */
.error-message,
.error-messages {
  padding: var(--space-3, 0.75rem);
  margin-bottom: var(--space-4, 1rem);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm, 0.875rem);
}

/* Mobile form styles */
@media (max-width: 768px) {
  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--space-6, 1.5rem);
  }

  .contact-info {
    order: 2;
  }

  .contact-form {
    order: 1;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Stack inline forms on mobile */
  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .form-inline input,
  .form-inline select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .contact-form,
  .contact-info {
    padding: var(--space-4, 1rem);
  }

  /* Smaller touch targets adjusted */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
  }

  /* Button full width on very small screens — scoped to form actions only */
  .form-actions .btn,
  .form-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
  }
}

/* ============================================
   RESPONSIVE TABLES
   ============================================ */

/* Table responsive wrapper */
.table-responsive {
  position: relative;
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* Add shadow to indicate scrollable content */
.table-responsive::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1));
  opacity: 0;
  transition: opacity var(--transition-base, 0.3s ease);
  pointer-events: none;
}

.table-responsive.has-overflow::after {
  opacity: 1;
}

/* Data table base styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.data-table th,
.data-table td {
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: var(--color-bg-secondary, rgba(255, 255, 255, 0.05));
  font-weight: var(--font-weight-semibold, 600);
  border-bottom: 2px solid var(--color-border, rgba(255, 255, 255, 0.1));
}

.data-table td {
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
}

.data-table tr:hover td {
  background: var(--color-bg-secondary, rgba(255, 255, 255, 0.03));
}

/* Card-based table for mobile */
@media (max-width: 640px) {
  .table-cards-mobile .data-table,
  .table-cards-mobile table {
    min-width: 100%;
  }

  .table-cards-mobile thead {
    display: none;
  }

  .table-cards-mobile tbody {
    display: block;
  }

  .table-cards-mobile tr {
    display: block;
    margin-bottom: var(--space-4, 1rem);
    background: var(--color-bg-elevated, rgba(255, 255, 255, 0.05));
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-4, 1rem);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  }

  .table-cards-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2, 0.5rem) 0;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.05));
    white-space: normal;
  }

  .table-cards-mobile td:last-child {
    border-bottom: none;
  }

  .table-cards-mobile td::before {
    content: attr(data-label);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--color-text-secondary, #94a3b8);
    margin-right: var(--space-3, 0.75rem);
  }

  .table-cards-mobile td:empty::before {
    display: none;
  }
}

/* Action buttons in tables */
.action-buttons {
  display: flex;
  gap: var(--space-2, 0.5rem);
  flex-wrap: nowrap;
}

/* User cell in tables */
.user-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full, 50%);
  object-fit: cover;
}

/* Status badges in tables */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--font-weight-medium, 500);
  text-transform: capitalize;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--font-weight-medium, 500);
}

.badge-primary {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Empty state in tables */
.empty-state {
  text-align: center;
  padding: var(--space-8, 2rem);
  color: var(--color-text-muted, #64748b);
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: var(--space-2, 0.5rem);
  display: block;
}

.empty-state p {
  margin: 0;
}

/* Admin table enhancements */
@media (max-width: 768px) {
  /* Horizontal scroll for tables */
  .table-responsive {
    margin: 0 calc(-1 * var(--space-4, 1rem));
    padding: 0 var(--space-4, 1rem);
    width: calc(100% + var(--space-8, 2rem));
  }

  /* Smaller table cells on mobile */
  .data-table th,
  .data-table td {
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    font-size: var(--text-sm, 0.875rem);
  }

  /* Stack action buttons vertically on very small screens */
  .action-buttons {
    flex-direction: column;
    gap: var(--space-1, 0.25rem);
  }

  .action-buttons .btn {
    padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
    font-size: var(--text-xs, 0.75rem);
  }

  /* Hide less important columns on mobile */
  .data-table th.hide-mobile,
  .data-table td.hide-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  /* Even smaller on very small screens */
  .data-table th,
  .data-table td {
    padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem);
    font-size: var(--text-xs, 0.75rem);
  }

  .user-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1, 0.25rem);
  }

  .user-avatar-small {
    width: 24px;
    height: 24px;
  }
}

/* ============================================
   RESPONSIVE CARDS
   ============================================ */

/* Card grid responsive */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-6, 1.5rem);
}

/* Stats grid responsive */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-4, 1rem);
}

/* Navigation cards grid */
.admin-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4, 1rem);
}

/* ============================================
   RESPONSIVE PAGINATION
   ============================================ */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1, 0.25rem);
  justify-content: center;
  padding: var(--space-4, 1rem) 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-2, 0.5rem);
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  font-size: var(--text-sm, 0.875rem);
  transition: all var(--transition-fast, 0.15s ease);
}

.pagination a {
  background: var(--color-bg-secondary, rgba(255, 255, 255, 0.05));
  color: var(--color-text-secondary, #94a3b8);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
}

.pagination a:hover {
  background: var(--color-primary, #06b6d4);
  color: var(--color-bg-dark, #0a0e1a);
  border-color: var(--color-primary, #06b6d4);
}

.pagination .active {
  background: var(--color-primary, #06b6d4);
  color: var(--color-bg-dark, #0a0e1a);
  border-color: var(--color-primary, #06b6d4);
}

.pagination .disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Pagination info */
.pagination-info {
  text-align: center;
  color: var(--color-text-muted, #64748b);
  font-size: var(--text-sm, 0.875rem);
  margin-bottom: var(--space-3, 0.75rem);
}

/* ============================================
   RESPONSIVE MODALS
   ============================================ */

.modal-content {
  width: 95%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
}

/* ============================================
   RESPONSIVE BUTTONS
   ============================================ */

/* Button group responsive */
.btn-group {
  display: inline-flex;
  gap: var(--space-2, 0.5rem);
  flex-wrap: wrap;
}

/* Button container - stacks on mobile */
.btn-container {
  display: flex;
  gap: var(--space-3, 0.75rem);
  flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE SECTIONS
   ============================================ */

/* Section responsive padding */
.section {
  padding: var(--space-10, 2.5rem) 0;
}

.section-header {
  margin-bottom: var(--space-6, 1.5rem);
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  font-size: var(--text-xl, 1.25rem);
  font-weight: var(--font-weight-semibold, 600);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Hide on mobile */
@media (max-width: 640px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Show on mobile only */
.show-mobile {
  display: none !important;
}

@media (max-width: 640px) {
  .show-mobile {
    display: block !important;
  }
}

/* Text alignment responsive */
@media (max-width: 640px) {
  .text-center-mobile {
    text-align: center !important;
  }

  .text-left-mobile {
    text-align: left !important;
  }
}

/* ============================================
   RESPONSIVE BREAKPOINT OVERRIDES
   ============================================ */

/* Extra small devices (phones, 480px and below) */
@media (max-width: 480px) {
  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
  }

  .search-filter-form .form-row {
    grid-template-columns: 1fr;
  }

  .search-filter-form .form-group-buttons {
    width: 100%;
  }

  .search-filter-form .form-group-buttons .btn {
    flex: 1;
  }

  /* Buttons */
  .btn-container {
    flex-direction: column;
  }

  .btn-container .btn {
    width: 100%;
  }

  /* Cards */
  .card-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-nav-grid {
    grid-template-columns: 1fr;
  }

  /* Sections */
  .section {
    padding: var(--space-6, 1.5rem) 0;
  }

  /* Pagination */
  .pagination a,
  .pagination span {
    min-width: 32px;
    height: 32px;
    font-size: var(--text-xs, 0.75rem);
  }
}

/* Small devices (landscape phones, 481px to 640px) */
@media (min-width: 481px) and (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium devices (tablets, 641px to 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large devices (desktops, 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra large devices (large desktops, 1025px and up) */
@media (min-width: 1025px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  /* Ensure images don't break across pages */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Ensure tables don't break across pages */
  table {
    page-break-inside: avoid;
  }

  /* Show all content */
  .table-responsive {
    overflow: visible;
  }

  /* Hide navigation */
  .mobile-menu-toggle,
  .mobile-menu {
    display: none !important;
  }

  /* Hide decorative footer elements */
  .footer-orb,
  .footer-bg {
    display: none !important;
  }
}
