/* Mobile Responsive Styles */

/* Authentication page specific styles */
@media (max-width: 768px) {
  /* Login page mobile optimization */
  .login-container {
    min-height: 100vh !important;
    padding: 0 !important;
  }

  .login-form-container {
    padding: 16px !important;
    max-width: 100% !important;
  }

  .login-background {
    min-height: 200px !important;
    background-size: cover !important;
  }

  .login-logo {
    height: 40px !important;
    margin-bottom: 16px !important;
  }

  .login-title {
    font-size: 20px !important;
    margin-bottom: 8px !important;
  }

  .login-subtitle {
    font-size: 14px !important;
    margin-bottom: 24px !important;
  }

  /* Login form mobile optimization */
  .ant-input,
  .ant-input-password .ant-input {
    font-size: 16px !important;
    padding: 12px 16px !important;
  }
}

/* Base responsive utilities */
@media (max-width: 640px) {
  /* Layout adjustments */
  .ant-layout-sider {
    position: fixed !important;
    z-index: 1000 !important;
    height: 100vh !important;
  }
  
  /* Table responsive */
  .ant-table-wrapper {
    overflow-x: auto !important;
  }
  
  .ant-table {
    min-width: 600px !important;
  }
  
  .ant-table-thead > tr > th {
    padding: 8px 4px !important;
    font-size: 12px !important;
  }
  
  .ant-table-tbody > tr > td {
    padding: 8px 4px !important;
    font-size: 12px !important;
  }
  
  /* Modal responsive */
  .ant-modal {
    margin: 8px !important;
    max-width: calc(100vw - 16px) !important;
    width: 95vw !important;
  }

  .ant-modal-content {
    border-radius: 12px !important;
    max-height: 95vh !important;
    overflow: hidden !important;
  }

  .ant-modal-header {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }

  .ant-modal-title {
    font-size: 16px !important;
    font-weight: 600 !important;
  }

  .ant-modal-body {
    padding: 16px !important;
    max-height: calc(95vh - 120px) !important;
    overflow-y: auto !important;
  }

  .ant-modal-close {
    top: 8px !important;
    right: 8px !important;
    width: 44px !important;
    height: 44px !important;
  }

  .ant-modal-close-x {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 18px !important;
  }
  
  /* Form responsive */
  .ant-form-item-label {
    padding-bottom: 4px !important;
  }
  
  .ant-input,
  .ant-input-password,
  .ant-select-selector {
    height: 40px !important;
  }
  
  .ant-btn {
    height: 40px !important;
    padding: 0 16px !important;
  }
  
  /* Pagination responsive */
  .ant-pagination {
    text-align: center !important;
  }
  
  .ant-pagination-item,
  .ant-pagination-prev,
  .ant-pagination-next {
    min-width: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
  }
  
  /* Card responsive */
  .ant-card {
    margin-bottom: 16px !important;
  }
  
  .ant-card-head {
    padding: 0 16px !important;
    min-height: 48px !important;
  }
  
  .ant-card-body {
    padding: 16px !important;
  }
  
  /* Typography responsive */
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
  h4 { font-size: 16px !important; }
  h5 { font-size: 14px !important; }
  h6 { font-size: 12px !important; }

  /* Dashboard specific responsive */
  .dashboard-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .dashboard-card {
    min-height: 95px !important;
    padding: 12px !important;
  }

  .dashboard-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

/* Tablet responsive */
@media (min-width: 641px) and (max-width: 1024px) {
  .ant-table-thead > tr > th {
    padding: 12px 8px !important;
    font-size: 13px !important;
  }
  
  .ant-table-tbody > tr > td {
    padding: 12px 8px !important;
    font-size: 13px !important;
  }
  
  .ant-modal {
    margin: 24px !important;
  }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  .ant-btn,
  button {
    min-height: 48px !important;
    min-width: 48px !important;
    padding: 12px 16px !important;
  }

  .ant-input,
  .ant-input-password {
    min-height: 48px !important;
    /*padding: 12px 16px !important;*/
    font-size: 16px !important; /* Prevents zoom on iOS */
  }

  .ant-table-tbody > tr {
    cursor: pointer;
  }

  .ant-table-tbody > tr:hover {
    background-color: #f5f5f5 !important;
  }

  /* Touch targets for links and buttons */
  a, button, [role="button"] {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Custom responsive utilities */
.mobile-stack {
  @media (max-width: 640px) {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

.mobile-center {
  @media (max-width: 640px) {
    text-align: center !important;
    justify-content: center !important;
  }
}

.mobile-full {
  @media (max-width: 640px) {
    width: 100% !important;
  }
}

.mobile-hidden {
  @media (max-width: 640px) {
    display: none !important;
  }
}

.desktop-hidden {
  @media (min-width: 641px) {
    display: none !important;
  }
}

/* Scrollbar styling for mobile */
@media (max-width: 640px) {
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
  
  ::-webkit-scrollbar-track {
    background: #f1f1f1;
  }
  
  ::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
}

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
  .mobile-vh-fix {
    height: -webkit-fill-available;
  }
}

/* Print responsive */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-full-width {
    width: 100% !important;
  }
}
