/* Tablet */
@media (max-width: 1200px) {
  #options-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  #options-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Phones */
@media (max-width: 768px) {
  /* Order History Modal - Full Screen */
  #orderHistoryModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100vh;
  }
  
  #orderHistoryModal .modal-content {
    height: 100vh;
    border-radius: 0;
  }
  
  /* Order History Table - Card Layout */
  #ordersTable {
    display: block;
    font-size: 0.85rem;
  }
  
  #ordersTable thead {
    display: none; /* Hide table headers */
  }
  
  #ordersTable tbody {
    display: block;
  }
  
  #ordersTable tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  #ordersTable tbody td {
    display: block;
    text-align: left !important;
    padding: 0.5rem 0;
    border: none;
  }
  
  /* Add labels before each cell */
  #ordersTable tbody td:nth-child(1)::before {
    content: "Order #: ";
    font-weight: bold;
    color: #6c757d;
  }
  
  #ordersTable tbody td:nth-child(2)::before {
    content: "Recipient: ";
    font-weight: bold;
    color: #6c757d;
  }
  
  #ordersTable tbody td:nth-child(3)::before {
    content: "Delivery: ";
    font-weight: bold;
    color: #6c757d;
  }
  
  #ordersTable tbody td:nth-child(4)::before {
    content: "Status: ";
    font-weight: bold;
    color: #6c757d;
    display: block;
    margin-bottom: 0.25rem;
  }
  
  #ordersTable tbody td:nth-child(5)::before {
    content: "Actions";
    font-weight: bold;
    color: #6c757d;
    display: block;
    margin-bottom: 0.5rem;
  }
  
  /* Stack action buttons vertically */
  #ordersTable tbody td:nth-child(5) > div {
    min-width: auto !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  #ordersTable tbody td:nth-child(5) button,
  #ordersTable tbody td:nth-child(5) > div > div {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Filter controls */
  .mb-3.d-flex {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  #orderStatusFilter,
  #refreshOrders {
    width: 100%;
  }
  
  /* Account Settings Modal */
  #accountSettingsModal .modal-dialog {
    margin: 0;
    max-width: 100%;
  }
  
  #accountSettingsModal .row.g-0 {
    flex-direction: column;
  }
  
  #accountSettingsModal .col-md-4 {
    border-right: none !important;
    border-bottom: 1px solid #dee2e6;
  }
  
  /* User Files Modal */
  #userFilesModal .list-group-item .d-flex {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  #userFilesModal .list-group-item .d-flex > div:last-child {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  #userFilesModal button,
  #userFilesModal a {
    width: 100% !important;
  }
  
  /* Edit Order Modal */
  #editOrderModal .row.g-3 {
    margin: 0;
  }
  
  #editOrderModal .row.g-3 > div {
    padding: 0;
    margin-bottom: 1rem;
  }
  
  /* Payment Modal */
  #paymentModal .modal-dialog {
    margin: 0.5rem;
  }
  
  #qrContainer img {
    max-height: 280px !important;
  }
  
  /* Modal footers - full width buttons */
  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  
  .modal-footer button,
  .modal-footer a {
    width: 100%;
    margin: 0 !important;
  }
}

@media (max-width: 600px) {
  #options-container {
    grid-template-columns: 1fr;
  }
  
  /* Hero section */
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 1.75rem !important;
  }
  
  .hero .lead {
    font-size: 1rem;
  }
  
  .hero-card {
    margin-top: 2rem;
  }
  
  /* Navbar */
  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar-brand img {
    height: 35px;
  }
  
  /* Services and Pricing */
  #services-grid > div,
  #pricing-grid > div {
    max-width: 100%;
  }
  
  /* Dropzone */
  .dropzone {
    min-height: 150px;
    padding: 1.5rem;
  }
  
  /* File list */
  #file-list .card {
    font-size: 0.875rem;
  }
  
  /* Printing options */
  .printing-option {
    padding: 1rem;
  }
  
  /* Contact section */
  #contact p {
    font-size: 0.9rem;
  }
  
  /* Footer */
  .site-footer {
    font-size: 0.875rem;
  }
}

/* Very small phones */
@media (max-width: 375px) {
  .hero h1 {
    font-size: 1.5rem !important;
  }
  
  .navbar-brand span {
    font-size: 0.875rem;
  }
  
  #ordersTable {
    font-size: 0.8rem;
  }
  
  #ordersTable tbody tr {
    padding: 0.75rem;
  }
  
  #ordersTable tbody td {
    padding: 0.4rem 0;
  }
}
