/* ============================================
   CATEGORIES MODULE - CORPORATE STYLING
   ============================================ */

/* Color Variables (Corporate Identity) */
:root {
  --crushed-berry: #880d1eff;
  --raspberry: #dd2d4aff;
  --bubblegum-pink: #f26a8dff;
  --pink-mist: #f49cbbff;
  --light-cyan: #cbeef3ff;
  --corporate-gradient: linear-gradient(135deg, #880d1eff, #dd2d4aff, #f26a8dff);
}

/* Header Section */
.categories-header {
  background: var(--corporate-gradient);
  color: white;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(136, 13, 30, 0.2);
}

.categories-header h2 {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 700;
  margin: 0;
  font-size: 2rem;
}

.categories-header p {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 300;
  margin: 0.5rem 0 0 0;
  opacity: 0.95;
}

/* Filters Section */
.categories-filters {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.categories-filters .form-control,
.categories-filters .form-select {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-family: 'Ubuntu', sans-serif;
  transition: all 0.3s ease;
}

.categories-filters .form-control:focus,
.categories-filters .form-select:focus {
  border-color: var(--raspberry);
  box-shadow: 0 0 0 0.2rem rgba(221, 45, 74, 0.15);
}

/* Corporate Button */
.btn-corporate {
  background: var(--corporate-gradient);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(136, 13, 30, 0.2);
}

.btn-corporate:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(136, 13, 30, 0.3);
  color: white;
}

.btn-corporate i {
  margin-right: 0.5rem;
}

/* Action Button Group Styles */
.btn-action-view,
.btn-action-edit,
.btn-action-delete {
  width: 36px;
  height: 36px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  padding: 0;
}

.btn-action-view {
  background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(73, 80, 87, 0.1));
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, 0.2);
  border-radius: 8px 0 0 8px;
}

.btn-action-view:hover {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
  z-index: 1;
}

.btn-action-edit {
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 86, 179, 0.1));
  color: #007bff;
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 0;
}

.btn-action-edit:hover {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
  z-index: 1;
}

.btn-action-delete {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(200, 35, 51, 0.1));
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
  border-radius: 0 8px 8px 0;
}

.btn-action-delete:hover {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
  z-index: 1;
}

/* Bootstrap button group adjustments */
.btn-group-sm > .btn {
  border-radius: 0;
}

.btn-group-sm > .btn:first-child {
  border-radius: 8px 0 0 8px;
}

.btn-group-sm > .btn:last-child {
  border-radius: 0 8px 8px 0;
}

/* Corporate Table */
.table-corporate {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-family: 'Ubuntu', sans-serif;
}

/* DataTable Header Styles - High Specificity */
#categoriesTable thead,
.table-corporate thead {
  background: linear-gradient(135deg, #880d1eff, #dd2d4aff) !important;
  border-bottom: none !important;
  color: white;
  position: relative;
}

#categoriesTable thead tr,
.table-corporate thead tr {
  background: transparent !important;
}

#categoriesTable thead th,
.table-corporate thead th {
  font-weight: 600 !important;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  padding: 1rem !important;
  border: none !important;
  white-space: nowrap;
  color: #ffffff !important;
  background: transparent !important;
  font-family: 'Ubuntu', sans-serif;
}

/* DataTable sorting icons color */
#categoriesTable thead th.sorting::before,
#categoriesTable thead th.sorting::after,
#categoriesTable thead th.sorting_asc::before,
#categoriesTable thead th.sorting_asc::after,
#categoriesTable thead th.sorting_desc::before,
#categoriesTable thead th.sorting_desc::after {
  color: rgba(255, 255, 255, 0.7) !important;
  opacity: 0.7;
}

.table-corporate tbody tr {
  transition: all 0.2s ease;
}

.table-corporate tbody tr:hover {
  background-color: rgba(136, 13, 30, 0.05);
  transform: scale(1.01);
}

.table-corporate tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.table-corporate tbody td strong {
  color: var(--crushed-berry);
  font-weight: 500;
}

/* Status Badges */
.badge-active {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.85rem;
  font-family: 'Ubuntu', sans-serif;
  box-shadow: 0 2px 5px rgba(40, 167, 69, 0.2);
}

.badge-inactive {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.85rem;
  font-family: 'Ubuntu', sans-serif;
  box-shadow: 0 2px 5px rgba(108, 117, 125, 0.2);
}

/* Button Groups */
.btn-group-sm .btn {
  margin: 0 2px;
}

.btn-group-sm .btn i {
  font-size: 0.9rem;
}

/* Modal Corporate Styling */
.modal-corporate .modal-header {
  background: var(--corporate-gradient);
  color: white;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 1.5rem;
}

.modal-corporate .modal-title {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
}

.modal-corporate .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.modal-corporate .btn-close:hover {
  opacity: 1;
}

.modal-corporate .modal-body {
  padding: 2rem;
}

.modal-corporate .modal-footer {
  border-top: 2px solid #f0f0f0;
  padding: 1.5rem;
}

/* Form Controls */
.modal-corporate .form-label {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  color: var(--crushed-berry);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.modal-corporate .form-label .text-danger {
  color: var(--raspberry) !important;
  margin-left: 2px;
}

.modal-corporate .form-control,
.modal-corporate .form-select,
.modal-corporate textarea {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 0.7rem 1rem;
  font-family: 'Ubuntu', sans-serif;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.modal-corporate .form-control:focus,
.modal-corporate .form-select:focus,
.modal-corporate textarea:focus {
  border-color: var(--raspberry);
  box-shadow: 0 0 0 0.2rem rgba(221, 45, 74, 0.15);
  outline: none;
}

.modal-corporate textarea {
  resize: vertical;
  min-height: 100px;
}

/* Form Check (Checkbox) */
.modal-corporate .form-check {
  padding: 1rem;
  background: rgba(136, 13, 30, 0.05);
  border-radius: 6px;
  border: 2px solid rgba(136, 13, 30, 0.1);
}

.modal-corporate .form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid var(--raspberry);
  cursor: pointer;
}

.modal-corporate .form-check-input:checked {
  background-color: var(--raspberry);
  border-color: var(--raspberry);
}

.modal-corporate .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(221, 45, 74, 0.15);
}

.modal-corporate .form-check-label {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  color: var(--crushed-berry);
  cursor: pointer;
  margin-left: 0.5rem;
}

/* Secondary Button */
.btn-secondary {
  background: #6c757d;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

/* DataTables Customization */
.dataTables_wrapper {
  font-family: 'Ubuntu', sans-serif;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-family: 'Ubuntu', sans-serif;
  margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--raspberry);
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(221, 45, 74, 0.15);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--corporate-gradient) !important;
  color: white !important;
  border: none !important;
  border-radius: 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--raspberry) !important;
  color: white !important;
  border: none !important;
  border-radius: 6px;
}

.dataTables_wrapper .dataTables_info {
  font-family: 'Ubuntu', sans-serif;
  color: #6c757d;
  padding-top: 1rem;
}

/* Force thead solid color - Override DataTables defaults */
#categoriesTable_wrapper table.table-corporate thead,
#categoriesTable_wrapper #categoriesTable thead,
table.dataTable.table-corporate thead {
  background: linear-gradient(135deg, #880d1eff, #dd2d4aff) !important;
  border-bottom: none !important;
}

#categoriesTable_wrapper table.table-corporate thead th,
#categoriesTable_wrapper #categoriesTable thead th,
table.dataTable.table-corporate thead th {
  color: #ffffff !important;
  background-color: transparent !important;
  background-image: none !important;
}

/* Override any Bootstrap or DataTables default thead styles */
table.dataTable thead > tr > th,
table.dataTable thead > tr > td {
  color: #ffffff !important;
  background: transparent !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .categories-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-corporate {
    min-width: 700px;
  }
}

@media (max-width: 991px) {
  .categories-header {
    padding: 1.25rem 1.5rem;
  }
  
  .btn-add-category {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .filters-row {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .categories-header h2 {
    font-size: 1.5rem;
  }

  .categories-header p {
    font-size: 0.9rem;
  }

  .categories-filters {
    padding: 1rem;
  }

  .table-corporate {
    font-size: 0.85rem;
  }

  .btn-corporate,
  .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .modal-corporate .modal-body {
    padding: 1rem;
  }
  
  .table-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .btn-action {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .categories-header h2 {
    font-size: 1.25rem;
  }
  
  .categories-header {
    padding: 1rem;
  }
  
  .categories-table-container {
    padding: 0.75rem;
  }
  
  .table-corporate {
    font-size: 0.75rem;
  }
  
  .table-corporate th,
  .table-corporate td {
    padding: 0.5rem 0.25rem;
  }
  
  .btn-corporate,
  .btn-secondary {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .modal-header h5 {
    font-size: 1rem;
  }
}


/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: var(--pink-mist);
}

.empty-state h4 {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 300;
}

/* Character Counter */
.character-counter {
  font-family: 'Ubuntu', sans-serif;
  font-size: 0.85rem;
  color: #6c757d;
  text-align: right;
  margin-top: 0.25rem;
}

.character-counter.warning {
  color: #ffc107;
}

.character-counter.danger {
  color: #dc3545;
}
