/* Navigation and User Experience Enhancements */

/* Sticky Navigation */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

/* Scroll-triggered navigation style change */
.nav-scrolled {
  background-color: rgba(0, 51, 102, 0.95);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  padding: 5px 0;
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
  position: absolute;
  right: 20px;
  top: 15px;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  background-color: var(--primary-blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary-gold);
  color: var(--primary-blue);
  transform: translateY(-3px);
}

/* Section Scroll Padding for Fixed Header */
section {
  scroll-margin-top: 80px;
}

/* Breadcrumbs for Better Navigation */
.breadcrumbs {
  background-color: rgba(0, 0, 0, 0.02);
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
}

.breadcrumbs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin: 0 10px;
  color: var(--medium-gray);
}

.breadcrumbs a {
  color: var(--medium-gray);
}

.breadcrumbs a:hover {
  color: var(--secondary-gold);
}

.breadcrumbs .active {
  color: var(--primary-blue);
}

/* Enhanced Focus States for Accessibility */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--secondary-gold);
  outline-offset: 2px;
}

/* Skip to Content Link for Accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-blue);
  color: var(--white);
  padding: 8px 15px;
  z-index: 1001;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
}

/* Enhanced Mobile Navigation */
@media (max-width: 991px) {
  .mobile-nav-toggle {
    display: block;
  }

  nav .container {
    flex-direction: column;
    align-items: flex-start;
  }

  nav .nav-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: var(--primary-blue);
    padding-top: 80px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1000;
  }

  nav .nav-menu.active {
    right: 0;
  }

  nav a {
    display: block;
    width: 100%;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  nav a:after {
    display: none;
  }
}

/* Preloader for Better User Experience */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader .spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(0, 51, 102, 0.1);
  border-top-color: var(--secondary-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Improved Form Validation Feedback */
.form-group {
  position: relative;
}

.form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Tooltip for Additional Information */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: var(--dark-gray);
  color: var(--white);
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark-gray) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Accordion for FAQ Section */
.accordion {
  margin-bottom: 20px;
}

.accordion-item {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-header {
  background-color: var(--white);
  padding: 0;
  margin: 0;
}

.accordion-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 20px;
  background-color: transparent;
  border: none;
  text-align: left;
  font-weight: 600;
  color: var(--primary-blue);
  cursor: pointer;
  transition: all 0.3s ease;
}

.accordion-button:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.accordion-button::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.accordion-button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.accordion-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-collapse.show {
  max-height: 500px;
}

.accordion-body {
  padding: 15px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
