/* Navigation Bar Styles - Glass-like Light Grey Gradient */
.navbar-custom {
  background: linear-gradient(
    135deg,
    rgba(248, 249, 250, 0.85) 0%,
    rgba(233, 236, 239, 0.9) 50%,
    rgba(220, 220, 220, 0.8) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(200, 200, 200, 0.3);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.navbar-custom .navbar-brand img {
  height: 40px;
  width: auto;
}

.navbar-custom .nav-link {
  color: #212529 !important;
  font-weight: 500;
  margin: 0 10px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-custom .nav-link:hover {
  color: #dc3545 !important;
}

.navbar-custom .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: #dc3545;
  transition: width 0.3s ease;
}

.navbar-custom .nav-link:hover::after {
  width: 100%;
}

.navbar-custom .navbar-toggler {
  border-color: #6c757d;
}

.navbar-custom .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28108, 117, 125, 1%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-custom.navbar-hidden {
  transform: translateY(-100%);
}

.navbar-custom.navbar-hidden .toggle-nav-btn {
  position: fixed;
  top: 5px;
  right: 5px;
}

.toggle-nav-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(200, 200, 200, 0.5);
  border: 1px solid rgba(180, 180, 180, 0.6);
  color: #495057;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-nav-btn i {
  font-size: 14px;
}

.toggle-nav-btn:hover {
  background-color: rgba(180, 180, 180, 0.7);
  transform: scale(1.1);
}

.toggle-nav-btn.hidden {
  display: none;
}

.nav-item.dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  margin-top: 0; /* Prevents gaps that break the hover connection */
}

.nav-item.dropdown .dropdown-menu {
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

/* 2. Custom hover colors for options (#dc3545 background & white text) */
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background-color: #dc3545 !important;
  color: #ffffff !important;
}

.custom-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 1.25rem;
}

.custom-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
  margin-bottom: 1.75rem;
  color: #212529;
}

.custom-card-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #dc3545;
  border-radius: 2px;
}

.text-justify-custom {
  text-align: justify;
  text-justify: inter-word;
  color: #1a1d20;
  font-size: 1.1rem;
  font-weight: 450;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.interactive-image-container {
  position: relative;
  width: 100%;
  max-width: 1600px;
  height: auto;
  margin: 0 auto;
  aspect-ratio: 1600 / 1140;

  background-image: url("../media/service-background.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 8px;
  overflow: hidden;
}

.interactive-image-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.interactive-image-grid-panel {
  display: block;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.interactive-image-grid-panel:hover {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.3);
  border: 1px solid #dc3545;
  border-radius: 8px;
}

.partner-image-link-wrapper {
  text-decoration: none;
  opacity: 0.6;
  transition:
    opacity 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}

.partner-image-link-wrapper:hover {
  opacity: 1;
}

.partner-image-link-wrapper:active,
.partner-image-link-wrapper:focus {
  opacity: 1 !important;
  transform: scale(0.98);
  outline: none;
}

.partner-image-link-wrapper img {
  max-height: 150px;
  width: auto;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.damage-custom-interactive-card {
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.1s ease;
  border: 1px solid transparent; /* Keeps border transparent by default */
  border-radius: 8px;
  overflow: hidden;
}

/* Ensure Logo Container and Images remain uniform */
.damage-logo-container {
  height: 160px; /* Set a standard baseline height for the top half */
}

.damage-logo-image {
  max-height: 160px;
  width: auto;
  object-fit: contain;
}

/* 1. Hover Effect: Grows slightly and increases shadow */
.damage-custom-interactive-card:hover {
  transform: translateY(-5px); /* Grows/lifts upward */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); /* Smooth deep shadow */
  border-color: transparent; /* Maintains transparency on hover */
}

/* 2. Click State: Solid thin red border (#dc3545) */
.damage-custom-interactive-card:active {
  border-color: #dc3545 !important;
  box-shadow: 0 2px 5px rgba(220, 53, 69, 0.2); /* Soft red shadow feedback */
  transform: translateY(-2px); /* Slightly depresses back down when clicked */
}

/* Card title customized sizing and specified color */
.custom-hover-card-title {
  color: #dc3545;
  font-size: 1.35rem; /* Makes it slightly larger than the body text */
}

/* Smooth transition setup for hover animations */
.custom-hover-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* Hover effects: slight scale up and elevated Bootstrap-level shadow */
.custom-hover-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; /* Replicates Bootstrap's .shadow-lg */
}

.custom-title-underline {
  border-bottom: 2px solid #dc3545;
}

.target-card {
  border: 1px solid transparent;
  transition:
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

/* 2. Defining the Highlight Animation */
@keyframes target-glow {
  0% {
    box-shadow: 0 0 0 0px rgba(220, 53, 69, 0);
    background-color: transparent;
  }
  15% {
    /* Soft crimson wash and a crisp border ring */
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.15);
    background-color: rgba(220, 53, 69, 0.04);
  }
  85% {
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.15);
    background-color: rgba(220, 53, 69, 0.04);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(220, 53, 69, 0);
    background-color: transparent;
  }
}

.target-scroll-offset {
  scroll-margin-top: 7rem;
}

#opr-prog-ubezp:target .target-card {
  animation: target-glow 2.5s ease-in-out forwards;
  border-color: #dc3545 !important;
}

#wdr-obs-prog:target .target-card {
  animation: target-glow 2.5s ease-in-out forwards;
  border-color: #dc3545 !important;
}

#wsp-proc-za-ryz:target .target-card {
  animation: target-glow 2.5s ease-in-out forwards;
  border-color: #dc3545 !important;
}

#usl-kom:target .target-card {
  animation: target-glow 2.5s ease-in-out forwards;
  border-color: #dc3545 !important;
}

#szkol-prac:target .target-card {
  animation: target-glow 2.5s ease-in-out forwards;
  border-color: #dc3545 !important;
}

@media (max-width: 767.98px) {
  .navbar-custom .navbar-collapse {
    position: absolute;
    top: 100%;
    right: 0;
    background: linear-gradient(
      135deg,
      rgba(248, 249, 250, 0.95) 0%,
      rgba(233, 236, 239, 0.9) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 0 0 0 10px;
    padding: 15px;
    min-width: 200px;
    box-shadow: -2px 4px 15px rgba(0, 0, 0, 0.1);
  }

  .navbar-custom .navbar-nav {
    flex-direction: column;
    align-items: flex-end;
  }

  .navbar-custom .nav-link {
    margin: 5px 0;
  }

  .navbar-custom .navbar-toggler {
    margin-left: auto;
  }

  #toggleNavBtn {
    top: 50px !important;
    top: 12px;
    right: 60px;
  }

  .nav-item.dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0; /* Prevents a physical gap that could close the menu when moving the cursor */
  }
}

.navbar-custom {
  z-index: 1030;
}
