/*
 * Cabinet IQ Admin Panel Overrides
 * Applies Cabinet IQ brand colors to the Bootstrap-based admin interface
 */

/* Override Bootstrap primary color with CIQ Black/Garden Grey */
:root {
  --bs-primary: #000000;
  --bs-primary-rgb: 0, 0, 0;
  --bs-blue: #000000;
  
  /* Update success to CIQ Garden Grey */
  --bs-success: #898f7a;
  --bs-success-rgb: 137, 143, 122;
  --bs-green: #898f7a;
  
  /* Keep standard alert colors but adjust to harmonize */
  --bs-info: #0dcaf0;
  --bs-warning: #ffc107;
  --bs-danger: #dc3545;
  
  /* Update link color */
  --bs-link-color: #000000;
  --bs-link-hover-color: #898f7a;
}

/* Sidebar and Navigation */
.sb-sidenav {
  background-color: #000000 !important;
}

.sb-sidenav-dark {
  background-color: #1a1a1a !important;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link:hover {
  color: #cac6b7;
  background-color: rgba(137, 143, 122, 0.1);
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link.active {
  color: #898f7a;
  background-color: rgba(137, 143, 122, 0.15);
}

.sb-sidenav-dark .sb-sidenav-footer {
  background-color: #000000 !important;
}

/* Top Navigation Bar */
.sb-topnav {
  background-color: #000000 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-dark .navbar-brand {
  color: #fff !important;
  font-weight: 600;
}

/* Fix navbar dropdown overflow - allow dropdowns to extend beyond navbar */
.navbar,
.navbar-collapse,
.navbar-nav,
.navbar-nav-scroll,
.nav-item,
.nav-item.dropdown,
.navbar > .container-fluid {
  overflow: visible !important;
}

.navbar .dropdown-menu {
  position: absolute !important;
  z-index: 1050 !important;
}

/* Ensure dropdowns are not clipped by any parent */
.navbar-expand-lg .navbar-nav .dropdown-menu {
  position: absolute !important;
}

/* Remove max-height constraint from navbar scroll */
.navbar-nav-scroll {
  max-height: none !important;
}

/* Ensure dropdown menu displays properly */
.dropdown-menu.show {
  display: block !important;
  position: absolute !important;
  overflow: visible !important;
}

/* Primary Buttons */
.btn-primary {
  background-color: #898f7a !important;
  border-color: #898f7a !important;
  color: #fff !important;
  font-weight: 500;
  border-radius: 12px;
  padding: 0.5rem 1.25rem;
  transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
  background-color: #6b7062 !important;
  border-color: #6b7062 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(107, 112, 98, 0.3);
}

.btn-primary:focus,
.btn-primary.focus {
  background-color: #6b7062 !important;
  border-color: #6b7062 !important;
  box-shadow: 0 0 0 0.2rem rgba(137, 143, 122, 0.5) !important;
}

.btn-primary:active,
.btn-primary.active {
  background-color: #6b7062 !important;
  border-color: #6b7062 !important;
}

/* Secondary Buttons */
.btn-secondary {
  background-color: #000000 !important;
  border-color: #000000 !important;
  border-radius: 12px;
}

.btn-secondary:hover {
  background-color: #333333 !important;
  border-color: #333333 !important;
}

/* Outline Buttons */
.btn-outline-primary {
  color: #000000 !important;
  border-color: #000000 !important;
  border-radius: 12px;
}

.btn-outline-primary:hover {
  background-color: #000000 !important;
  border-color: #000000 !important;
  color: #fff !important;
}

/* Success Elements */
.btn-success {
  background-color: #898f7a !important;
  border-color: #898f7a !important;
  border-radius: 12px;
}

.btn-success:hover {
  background-color: #6b7062 !important;
  border-color: #6b7062 !important;
}

.alert-success {
  background-color: #cac6b7 !important;
  border-color: #898f7a !important;
  color: #000000 !important;
}

.badge-success,
.badge.bg-success {
  background-color: #898f7a !important;
}

/* Links */
a {
  color: #000000;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: #898f7a;
}

/* Cards */
.card {
  border-radius: 16px;
  border: 1px solid #cac6b7;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
  background-color: #f6f6f3;
  border-bottom: 1px solid #cac6b7;
  color: #000000;
  font-weight: 600;
  border-radius: 16px 16px 0 0 !important;
}

/* Forms */
.form-control:focus {
  border-color: #898f7a !important;
  box-shadow: 0 0 0 0.2rem rgba(137, 143, 122, 0.25) !important;
}

.form-select:focus {
  border-color: #898f7a !important;
  box-shadow: 0 0 0 0.2rem rgba(137, 143, 122, 0.25) !important;
}

/* Form Labels */
.form-label {
  color: #000000;
  font-weight: 500;
}

/* Tables */
.table-primary {
  --bs-table-bg: #cac6b7;
  --bs-table-border-color: #898f7a;
}

.table thead th {
  background-color: #f6f6f3;
  color: #000000;
  font-weight: 600;
  border-bottom: 2px solid #cac6b7;
}

.table-hover tbody tr:hover {
  background-color: #f6f6f3;
}

/* DataTables Integration */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #000000 !important;
  border-color: #000000 !important;
  color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #cac6b7 !important;
  border-color: #898f7a !important;
  color: #000000 !important;
}

/* Breadcrumbs */
.breadcrumb-item.active {
  color: #000000;
}

.breadcrumb-item a {
  color: #898f7a;
}

.breadcrumb-item a:hover {
  color: #6b7062;
}

/* Progress Bars */
.progress-bar {
  background-color: #898f7a !important;
}

/* Badges */
.badge {
  border-radius: 8px;
  padding: 0.35em 0.65em;
  font-weight: 500;
}

.badge-primary,
.badge.bg-primary {
  background-color: #000000 !important;
}

/* Pagination */
.pagination .page-link {
  color: #000000;
  border-radius: 8px;
  margin: 0 2px;
}

.pagination .page-link:hover {
  background-color: #cac6b7;
  border-color: #898f7a;
  color: #000000;
}

.pagination .page-item.active .page-link {
  background-color: #000000;
  border-color: #000000;
}

/* Modals */
.modal-header {
  background-color: #f6f6f3;
  border-bottom: 2px solid #cac6b7;
}

.modal-title {
  color: #000000;
  font-weight: 600;
}

/* Alerts */
.alert-primary {
  background-color: #cac6b7;
  border-color: #898f7a;
  color: #000000;
}

.alert-info {
  background-color: #E0F7FA;
  border-color: #80DEEA;
  color: #00838F;
}

/* Dropdowns */
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #cac6b7;
  color: #000000;
}

.dropdown-item.active {
  background-color: #000000;
  color: #fff;
}

/* Custom Scrollbar (webkit browsers) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f6f6f3;
}

::-webkit-scrollbar-thumb {
  background: #cac6b7;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #898f7a;
}

/* Loading Spinner */
.spinner-border-primary {
  color: #000000 !important;
}

/* Text Colors */
.text-primary {
  color: #000000 !important;
}

.text-success {
  color: #898f7a !important;
}

/* Background Colors */
.bg-primary {
  background-color: #000000 !important;
}

.bg-success {
  background-color: #898f7a !important;
}

.bg-light {
  background-color: #f6f6f3 !important;
}

/* Focus States for Accessibility */
*:focus {
  outline: 2px solid #898f7a;
  outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #898f7a;
  outline-offset: 2px;
}

/* Custom Cabinet IQ Elements */
.ciq-card-accent {
  border-top: 4px solid #898f7a;
}

.ciq-section-header {
  color: #000000;
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #cac6b7;
}

.ciq-stat-card {
  background: linear-gradient(135deg, #898f7a 0%, #6b7062 100%);
  color: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(137, 143, 122, 0.2);
}

.ciq-stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
}

.ciq-stat-card .stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Status Indicators */
.status-active {
  color: #898f7a;
  font-weight: 600;
}

.status-inactive {
  color: #6c757d;
}

.status-pending {
  color: #ffc107;
  font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}
