/* CSS Variables for Branding - Default values */
:root {
  --brand-primary-color: #97C1B9;
  --brand-secondary-color: #D9C59B;
  --brand-background-color: #ffffff;
}

/* Apply brand colors to common elements */
a {
  color: var(--brand-primary-color, #97C1B9);
}

a:hover {
  color: var(--brand-secondary-color, #D9C59B);
}

.btn-primary {
  background-color: var(--brand-primary-color, #97C1B9);
  border-color: var(--brand-primary-color, #97C1B9);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--brand-secondary-color, #D9C59B);
  border-color: var(--brand-secondary-color, #D9C59B);
}

.btn-outline-primary {
  color: var(--brand-primary-color, #97C1B9);
  border-color: var(--brand-primary-color, #97C1B9);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--brand-primary-color, #97C1B9);
  border-color: var(--brand-primary-color, #97C1B9);
  color: #ffffff;
}

.nav-link:hover {
  color: var(--brand-primary-color, #97C1B9);
}

.badge.bg-primary {
  background-color: var(--brand-primary-color, #97C1B9) !important;
}

.text-primary {
  color: var(--brand-primary-color, #97C1B9) !important;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--brand-primary-color, #97C1B9);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: var(--brand-background-color, #ffffff);
}

/* Mobile-specific responsive styles */
@media (max-width: 767.98px) {
  /* Improve heading sizes on mobile */
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  /* Ensure cards have proper spacing on mobile */
  .card {
    margin-bottom: 1rem;
  }
  
  /* Make tables more mobile-friendly */
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .table-responsive table {
    min-width: 100%;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
  }
  
  /* Improve alert spacing on mobile */
  .alert {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  
  /* Make navbar brand logo smaller on mobile */
  .navbar-brand img {
    max-height: 30px !important;
  }
  
  /* Reduce container padding on mobile */
  .container,
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Page header mobile layout */
@media (max-width: 767.98px) {
  /* Apply to page headers that use d-flex with specific pattern */
  .mb-4 > .d-flex.justify-content-between.align-items-center:first-child {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  .mb-4 > .d-flex.justify-content-between.align-items-center:first-child h1 {
    margin-bottom: 1rem;
  }
  
  .mb-4 > .d-flex.justify-content-between.align-items-center:first-child .btn {
    width: 100%;
  }
}

/* Dropdown menu styling */
.navbar .dropdown-menu {
  border-radius: 0.25rem;
  border-color: #dee2e6;
  min-width: 200px;
}

.navbar .dropdown-item {
  color: rgba(0, 0, 0, 0.55);
  transition: all 0.2s ease;
  padding: 0.75rem 1rem;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  color: var(--brand-primary-color, #97C1B9);
  background-color: #f8f9fa;
}

.navbar .dropdown-item i {
  margin-right: 0.5rem;
  width: 1.25rem;
  text-align: center;
  color: var(--brand-primary-color, #97C1B9);
}

.navbar .dropdown-toggle::after {
  margin-left: 0.25rem;
}

/* On mobile, make dropdown items appear as regular nav links in collapsed menu */
@media (max-width: 575.98px) {
  .navbar-collapse .nav-item.dropdown {
    position: static;
  }
  
  .navbar-collapse .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    background-color: transparent;
    border: 0;
    box-shadow: none;
    display: block !important;
  }
  
  .navbar-collapse .dropdown-item {
    padding: 0.5rem 1rem;
    color: rgba(0, 0, 0, 0.55) !important;
    display: block;
    width: 100%;
    clear: both;
    font-weight: 400;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent !important;
    border: 0;
    padding-left: 2.5rem;
  }
  
  .navbar-collapse .dropdown-item:hover,
  .navbar-collapse .dropdown-item:focus {
    color: var(--brand-primary-color, #97C1B9) !important;
    background-color: transparent !important;
  }
  
  .navbar-collapse .dropdown-item i {
    margin-right: 0.5rem;
  }
  
  .navbar-collapse .dropdown-toggle {
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .navbar-collapse .dropdown-toggle::after {
    display: inline-block;
    margin-left: auto;
  }
  
  .navbar-collapse .dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(0, 0, 0, 0.1);
  }
}

/* Ensure touch targets are large enough (minimum 44x44px) */
@media (max-width: 767.98px) {
  .btn,
  .nav-link,
  .form-control,
  .form-select,
  .btn-close {
    min-height: 44px;
  }
  
  .btn-sm {
    min-height: 38px;
  }
}