/**
 * Mobile Responsive Tables
 * Makes tables look good on mobile with expandable details
 */

/* Desktop - normal table */
@media (min-width: 769px) {
  .mobile-table-card {
    display: none;
  }
}

/* Mobile - card view */
@media (max-width: 768px) {
  /* Hide regular table on mobile */
  .table-responsive table {
    display: none;
  }
  
  /* Show card view */
  .mobile-table-cards {
    display: block !important;
  }
  
  .mobile-table-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }
  
  .mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
  }
  
  .mobile-card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
  }
  
  .mobile-card-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 2px;
  }
  
  .mobile-card-body {
    display: none;
  }
  
  .mobile-card-body.expanded {
    display: block;
    animation: slideDown 0.3s ease;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      max-height: 0;
    }
    to {
      opacity: 1;
      max-height: 500px;
    }
  }
  
  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
  }
  
  .mobile-card-row:last-child {
    border-bottom: none;
  }
  
  .mobile-card-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
  }
  
  .mobile-card-value {
    font-weight: 500;
    color: #2c3e50;
    text-align: right;
    font-size: 0.9rem;
  }
  
  .mobile-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
  }
  
  .mobile-card-actions button {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
  }
  
  .mobile-view-toggle {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
  }
  
  .mobile-view-toggle:active {
    transform: scale(0.95);
  }
  
  .mobile-view-toggle i {
    font-size: 1.2rem;
    transition: transform 0.3s;
  }
  
  .mobile-view-toggle.expanded i {
    transform: rotate(180deg);
  }
  
  /* Badge styles for mobile */
  .mobile-card-value .badge {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  
  /* Search box on mobile */
  .mobile-search-box {
    position: sticky;
    top: 0;
    background: white;
    padding: 10px 0;
    margin-bottom: 15px;
    z-index: 100;
  }
  
  .mobile-search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
  }
  
  .mobile-search-box input:focus {
    border-color: #667eea;
    outline: none;
  }
}

/* Table improvements for smaller screens */
@media (max-width: 992px) and (min-width: 769px) {
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .table-responsive th,
  .table-responsive td {
    padding: 0.5rem;
  }
  
  .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }
}

