/* 
 * PriceBookClub Main CSS
 * Provides consistent styling across all application templates
 */

/* Base Styles */
/* body {
  background-color: #F5F5F5;
} */

/* Container spacing */
.content-container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* Card Styles */
.card {
  border: none;
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-shadow:hover {
  transform: translateY(-4px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0,0,0,.125);
  padding: 1rem 1.25rem;
}

.card-footer {
  background-color: #fff;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(0,0,0,.125);
}

/* Form Styles */
.form-container {
  max-width: 800px;
  margin: 0 auto;
}

.form-actions {
  margin-top: 1.5rem;
}

/* Button Styles */
.btn {
  font-weight: 500;
}

.btn-sm {
  padding: .25rem .5rem;
}

.btn-group .btn {
  margin-right: 0.25rem;
}

/* Action buttons in header */
.page-actions .btn {
  margin-left: 0.5rem;
  padding: 0.375rem 0.75rem;
}

.page-actions .btn:first-child {
  margin-left: 0;
}

/* Table action buttons */
td .btn-group {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping to keep buttons on one line */
  gap: 0.25rem;      /* Use gap for consistent spacing */
}

td .btn-group .btn {
  flex: 1 0 auto;    /* Equal-width buttons that don't shrink */
  width: 33%;        /* Each button takes roughly 1/3 of the space */
  min-width: 70px;   /* Minimum width */
  text-align: center;
  margin: 0;         /* Remove default margins */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Form action buttons */
.form-actions .btn {
  margin-left: 0.5rem;
}

/* Button Colors and Icons */
.btn-view, .btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-edit, .btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

.btn-delete, .btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-add, .btn-success {
  background-color: #198754;
  border-color: #198754;
}

/* Table Styles */
.table-container {
  margin-bottom: 1.5rem;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: #f8f9fa;
  border-top: none;
}

.table-actions {
  min-width: 240px;  /* Enough space for three equal-sized buttons */
  width: 240px;      /* Fixed width to ensure consistency */
  max-width: 240px;  /* Prevent growing too large */
  padding: 0.5rem 0.75rem !important;
  white-space: nowrap;
}

/* Page Header */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0;
}

/* Pagination */
.pagination-info {
  font-size: 0.9rem;
  color: #6c757d;
}

.pagination {
  margin-bottom: 0;
}

/* Filter Section */
.filter-section {
  margin-bottom: 1.5rem;
}

/* Loading Indicator */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: block;
}

.htmx-request.htmx-indicator {
  display: block;
}

.loading-indicator {
  text-align: center;
  padding: 1.5rem 0;
}

/* Form layout consistency */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  /* Header button groups */
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
  }
  
  .page-actions .btn {
    margin: 0;
    flex: 1 1 auto;
  }
  
  /* Table action buttons - maintain horizontal layout */
  .table-actions {
    padding: 0.25rem !important;
    min-width: 220px;
  }
  
  td .btn-group {
    gap: 0.15rem;
  }
  
  td .btn-group .btn {
    padding: 0.25rem;
    font-size: 0.8rem;
  }
}

/* Back buttons */
.back-link {
  margin-bottom: 1rem;
}
