/* These styles are generated from project.scss. */

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

/* Custom Primary Button */
.btn-primary-custom {
    background-color: var(--color-primary);
    color: white;
    padding-top: 0.5rem;      /* py-2 */
    padding-bottom: 0.5rem;   /* py-2 */
    padding-left: 1rem;       /* px-4 */
    padding-right: 1rem;      /* px-4 */
    font-weight: 700;         /* font-bold */
    border-radius: 0.375rem;  /* rounded-md (Tailwind default for -md) */
    text-decoration: none;
    display: inline-flex; /* To allow icon alignment if needed */
    align-items: center;  /* To allow icon alignment if needed */
}

.btn-primary-custom:hover {
    background-color: var(--color-primary-dark);
}

/* Custom Secondary Button */
.btn-secondary-custom {
    background-color: var(--color-secondary);
    color: white;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    font-weight: 700;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-secondary-custom:hover {
    background-color: var(--color-secondary-dark);
}

/* Custom Tertiary Button */
.btn-tertiary-custom {
    background-color: var(--color-tertiary); /* Amber/Yellow, assumed #FFC107 */
    color: #343a40; /* Dark grey for text */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    font-weight: 700;
    border-radius: 0.375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-tertiary-custom:hover {
    background-color: #e0a800; /* Darker Amber/Yellow */
    color: #343a40; /* Keep text dark grey */
}

/* Custom Primary Link */
.link-primary-custom {
    color: var(--color-text); 
    text-decoration: none; 
}

.link-primary-custom:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

/* Custom styles for Emerald project */

/* Make active dropdown items use the secondary color */
.dropdown-item:active,
.dropdown-item.active {
  background-color: var(--bs-secondary);
  color: var(--bs-white); /* Assuming --bs-white is #fff, which is standard */
}

/* If you want to more directly override the Bootstrap CSS variables globally for dropdowns:
:root {
  --bs-dropdown-link-active-bg: var(--bs-secondary);
  --bs-dropdown-link-active-color: var(--bs-white);
}
*/

/* Phase 5: UI/UX Cleanup & Core Fixes */

/* Reduced vertical whitespace for page headers */
.page-header {
  margin-bottom: 1rem !important; /* Reduced from default Bootstrap margin */
}

h1.mb-4 {
  margin-bottom: 1rem !important; /* Override Bootstrap mb-4 (1.5rem) to mb-3 equivalent */
}

h1.mb-3 {
  margin-bottom: 1rem !important; /* Keep consistent spacing */
}

h1.mb-2 {
  margin-bottom: 0.75rem !important; /* Even more compact */
}

/* Improved responsive breakpoints */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container {
    max-width: 720px; /* Prevent premature shrinking on medium screens */
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .container {
    max-width: 960px; /* Better utilization of large screens */
  }
}

/* Dashboard card improvements with dynamic font sizing */
.dashboard-card .card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dashboard-card .card-text {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0;
}

/* Dynamic font size adjustment for large numbers */
.dashboard-card .card-text.large-number {
  font-size: 1.75rem; /* Slightly smaller for long numbers */
}

.dashboard-card .card-text.extra-large-number {
  font-size: 1.5rem; /* Even smaller for very long numbers */
}

/* Responsive text sizing for dashboard cards */
@media (max-width: 576px) {
  .dashboard-card .card-text {
    font-size: 1.5rem;
  }
  
  .dashboard-card .card-text.large-number {
    font-size: 1.25rem;
  }
  
  .dashboard-card .card-text.extra-large-number {
    font-size: 1.1rem;
  }
}

/* Search results styling */
.search-result {
  transition: box-shadow 0.15s ease-in-out;
}

.search-result:hover {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Improved form validation styling */
.form-control.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

/* Enhanced navigation styling */
.navbar-nav .nav-link {
  padding: 0.5rem 0.75rem; /* Slightly more compact */
}

.navbar-search {
  min-width: 200px;
}

@media (max-width: 767.98px) {
  .navbar-search {
    min-width: 150px;
    margin-bottom: 0.5rem;
  }
}

/* Consistent card spacing */
.card {
  margin-bottom: 1.5rem;
}

.card:last-child {
  margin-bottom: 0;
}

/* Table improvements */
.table th {
  border-top: none;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
}

.table-responsive {
  border-radius: 0.375rem;
}

/* Button group improvements */
.btn-group-sm > .btn,
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Alert improvements */
.alert {
  border: none;
  border-radius: 0.5rem;
}

/* Emerald Custom Table Striping and Hover */
.table-striped tbody tr:nth-of-type(even) {
    background-color: #f9fafb; /* Tailwind's gray-50 */
}
.table-hover tbody tr:hover {
    background-color: #f1f5f9; /* Tailwind's gray-100 */
}
.table th, .table td {
    border-top: 1px solid #e5e7eb; /* Tailwind's gray-200 */
    padding: 0.75rem 1rem;
    vertical-align: middle;
}
.table {
    width: 100%;
    background-color: white;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Dropdown menu styles for Tailwind-only projects */
.dropdown { position: relative; }
.dropdown-menu {
  display: none !important;
  position: absolute;
  min-width: 12rem;
  background: #222;
  color: #fff;
  border-radius: 0.375rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  right: 0;
}
.dropdown-menu.show { display: block !important; }
.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: #374151;
  color: #fff;
}
.dropdown-divider {
  height: 1px;
  margin: 0.5rem 0;
  background: #374151;
  border: none;
}
