:root {
  --bgdc-primary: #3562AE;
  --bgdc-dark: #343a40;
}

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(--bgdc-primary);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
}

/* Override Bootstrap primary color with BGDC blue */
.bg-primary {
  background-color: var(--bgdc-primary) !important;
}

.text-primary {
  color: var(--bgdc-primary) !important;
}

.border-primary {
  border-color: var(--bgdc-primary) !important;
}

.btn-primary {
  background-color: var(--bgdc-primary);
  border-color: var(--bgdc-primary);
}

.btn-primary:hover {
  background-color: #365a9e;
  border-color: #365a9e;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* BGDC specific styles */
.navbar-dark .navbar-nav .nav-link {
  color: white;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #cce7ff;
}

/* Footer bottom blue bar */
footer {
  position: relative;
}

footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--bgdc-primary);
}

/* Mobile-First Responsive Design */
@media (max-width: 575.98px) {
  /* Extra small devices (phones) */
  .navbar-brand {
    font-size: 1.25rem !important;
  }
  
  .dropdown-menu {
    width: 100%;
    border: none;
    box-shadow: none;
    background-color: rgba(255, 255, 255, 0.95);
  }
  
  .navbar-nav .dropdown-menu {
    position: static;
    float: none;
    width: auto;
    margin-top: 0;
    background-color: transparent;
    border: 0;
    box-shadow: none;
  }
  
  .navbar-nav .dropdown-item {
    padding: 0.5rem 1rem;
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
  }
  
  .display-3 {
    font-size: 2.5rem !important;
  }
  
  .lead {
    font-size: 1.1rem !important;
  }
  
  footer .container-fluid {
    padding: 0.75rem;
  }
  
  footer .row {
    text-align: center !important;
  }
  
  footer .col-md-6:last-child {
    text-align: center !important;
    margin-top: 0.5rem;
  }
  
  footer .col-md-6:last-child a {
    display: block;
    margin: 0.25rem 0;
  }
}

@media (max-width: 767.98px) {
  /* Small devices (landscape phones, tablets) */
  .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.5);
  }
  
  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
  }
  
  .navbar-collapse {
    margin-top: 0.5rem;
  }
  
  .navbar-nav .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
  
  /* User dropdown adjustments for mobile */
  .navbar-nav .dropdown-menu.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
    min-width: 200px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  /* Medium devices (tablets) */
  .display-3 {
    font-size: 3rem !important;
  }
  
  .navbar-brand {
    font-size: 1.5rem !important;
  }
}

@media (min-width: 992px) {
  /* Large devices (desktops) */
  .display-md-2 {
    font-size: calc(1.375rem + 2.5vw) !important;
  }
  
  .fs-md-3 {
    font-size: calc(1.3rem + 0.6vw) !important;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .nav-link {
    padding: 0.75rem 1rem;
  }
  
  .dropdown-item {
    padding: 0.75rem 1.5rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
}

/* Landscape orientation adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
  .flex-grow-1 {
    min-height: calc(100vh - 120px);
  }
  
  .display-3 {
    font-size: 2rem !important;
  }
  
  .lead {
    font-size: 1rem !important;
  }
}

/* User Avatar Styles */
.user-avatar {
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.user-avatar:hover {
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

/* Ensure avatar images are properly sized and circular */
.navbar-nav .user-avatar {
  flex-shrink: 0;
}

/* Avatar loading state */
.user-avatar[src*="placehold.co"] {
  background-color: #FFFFFF;
  border: 2px solid var(--bgdc-primary);
}

/* Mobile avatar adjustments */
@media (max-width: 767.98px) {
  .user-avatar {
    width: 28px !important;
    height: 28px !important;
  }
  
  .navbar-nav .dropdown-toggle {
    padding: 0.5rem 0.75rem;
  }
}