/* Global CRM Table Styles - Drop-in replacement for common.css */

/* Remove width constraints from main content containers */
.main-content {
    margin: 0 auto; /* Center the container */
    padding: 1rem; /* Add some padding for mobile */
}

/* Base table container */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
}

/* Main table styling with responsive width constraints */
table, .table {
  min-width: 25%;
  max-width: 85%;
  width: auto; /* Self-expanding based on content */
  border-collapse: collapse;
  border-spacing: 0;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 0 auto; /* Center the table */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Table headers */
table th, .table th {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #495057;
  white-space: nowrap; /* Prevents header text wrapping */
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Table cells */
table td, .table td {
  border: 1px solid #dee2e6;
  padding: 0.75rem;
  vertical-align: top;
  word-wrap: break-word;
}

/* Auto-sizing columns based on content */
table th, table td {
  width: auto;
  min-width: fit-content;
}

/* Responsive behavior */
@media screen and (max-width: 768px) {
  table, .table {
    min-width: 100%;
    max-width: 100%;
    font-size: 0.875rem;
  }
  
  table th, .table th,
  table td, .table td {
    padding: 0.5rem;
  }
}

@media screen and (min-width: 1400px) {
  table, .table {
    max-width: 90%; /* Allow slightly wider on very large screens */
  }
}

/* Hover effects for better UX */
table tbody tr:hover, .table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Form input styling - fancy fonts and colors */
input[type="text"], 
input[type="email"], 
input[type="url"], 
input[type="date"], 
input[type="number"], 
input[type="password"],
textarea, 
select {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: bold;
  color: #2c5530;
  font-size: 14px;
  border: 2px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  background-color: #fafafa;
}

/* Focus state for inputs */
input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="url"]:focus, 
input[type="date"]:focus, 
input[type="number"]:focus, 
input[type="password"]:focus,
textarea:focus, 
select:focus {
  outline: none;
  border-color: #4a6741;
  background-color: #f8fff8;
  box-shadow: 0 0 5px rgba(74, 103, 65, 0.3);
}
/* Pagination styling */
.pagination a {
    padding: 8px 12px;
    margin: 0 2px;
    text-decoration: none;
    border: 1px solid #ccc;
    color: #333;
    display: inline-block;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination strong {
    padding: 8px 12px;
    margin: 0 2px;
    background-color: #007cba;
    color: white;
    border: 1px solid #007cba;
    display: inline-block;
}

/* Hide pagination and buttons when printing */
@media print {
    .pagination, 
    button {
        display: none !important;
    }
}