/* Bootstrap theme overrides and variables*/
:root {
  --bs-danger: #aa0000;
  --capanda-red: #aa0000;
  --capanda-yellow: #ffc107;
  --capanda-blue: #1976d2;
  --capanda-grey: #6c757d;
  --capanda-light: #fafaf7;
  --capanda-dark: #1e2730;
  --bg-color: var(--capanda-light);
  --text-color: #000000;
  --nav-color: #f8f9fa;
  --bg-duration: 400ms;
  --content-duration: 250ms;
  --content-delay: 250ms;
  --content-stagger: 80ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: var(--capanda-dark);
    --text-color: #ffffff;
    --nav-color: #1a1a1c;
  }
}

.btn-danger {
  background-color: var(--bs-danger) !important;
}
.text-danger,
.alert-danger {
  color: var(--bs-danger) !important;
}

/* General styling */
body {
  transition:
    background-color var(--bg-duration) cubic-bezier(0.4, 0, 0.2, 1),
    opacity var(--bg-duration) cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  font-size: 1.2rem;
  background-color: var(--bg-color);
}

#mantra,
#companyname {
  font-weight: 300;
  margin-bottom: 8px;
}

#companyname {
  font-weight: 400;
  letter-spacing: -6px;
}

.top-panel {
  min-height: 100dvh;
  position: relative;
  display: flex;
  align-items: center;
  z-index: 1;
  padding-block-start: 82px;
  background: url("https://ik.imagekit.io/capanda/tr:w-1920,q-85/capanda.ca/server-room")
    center / cover no-repeat;
  transition:
    background-color var(--bg-duration) cubic-bezier(0.4, 0, 0.2, 1),
    opacity var(--bg-duration) cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  text-shadow: 0 0 15px black;
}

.btn-capanda {
  display: inline-block;
  background-color: var(--button-color);
  padding: 8px 16px;
  font-size: 1rem;
  text-align: center;
  font-weight: 600;
  border: 2px solid color-mix(in srgb, var(--button-color) 85%, black 15%);
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.btn-capanda-large {
  padding: 12px 24px;
  font-size: 1.2rem;
}

.btn-capanda-red {
  color: white;
  --button-color: var(--capanda-red);
}

.btn-capanda-yellow {
  color: black;
  --button-color: var(--capanda-yellow);
}

.btn-capanda-blue {
  color: white;
  --button-color: var(--capanda-blue);
}

.btn-capanda-grey {
  color: white;
  --button-color: var(--capanda-grey);
}

.btn-capanda:hover,
.btn-capanda:focus {
  background-color: color-mix(in srgb, var(--button-color) 75%, black 25%);
  border: 2px solid color-mix(in srgb, var(--button-color) 75%, black 25%);
}

.btn-capanda:focus:not(:hover) {
  background-color: var(--button-color);
  border: 2px solid color-mix(in srgb, var(--button-color) 85%, black 15%);
}

.btn-flex-content {
  display: flex;
  align-items: center;
  gap: 5px;
}

nav,
footer {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
  background-color: var(--nav-color);
  color: var(--text-color);
}

.nav-link,
.nav-link:focus {
  color: var(--text-color);
}

.nav-link:hover {
  color: #808080;
}

.nav-link-highlighted {
  color: var(--capanda-red) !important ;
  text-shadow:
    -0.05ex 0 currentColor,
    0.05ex 0 currentColor;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  display: flex;
  justify-content: center;
  position: relative;
}

.panel:not(.top-panel) {
  z-index: 0;
  opacity: 0;
  position: absolute;
  transition:
    background-color var(--bg-duration) cubic-bezier(0.4, 0, 0.2, 1),
    opacity var(--bg-duration) cubic-bezier(0.4, 0, 0.2, 1);
  align-content: center;
}

.panel.active-panel {
  opacity: 1;
  z-index: 1;
}

.panel-txt {
  text-align: justify;
}

.panel:nth-child(even) h2 {
  padding-inline-start: 1rem;
}

.panel:nth-child(odd) h2 {
  text-align: right;
  padding-inline-end: 1rem;
}

/* Slide text into place on screens wide enough for two-columns */
@media (min-width: 600px) {
  .panel {
    .panel-txt {
      opacity: 0;
      transition: opacity var(--content-duration) ease-out var(--content-delay);

      h2 {
        opacity: 0;
        transition: opacity var(--content-duration) ease-out
          calc(var(--content-delay) + var(--content-stagger) * 2);
      }
    }

    .panel-img {
      opacity: 0;
      transition: opacity var(--content-duration) ease-out
        calc(var(--content-delay) + var(--content-stagger));
    }

    &.active-panel:nth-child(odd) {
      .panel-txt {
        opacity: 1;
        animation: slide-in-left var(--content-duration)
          cubic-bezier(0.25, 1, 0.5, 1) var(--content-delay) both;

        h2 {
          opacity: 1;
          animation: slide-in-left var(--content-duration)
            cubic-bezier(0.25, 1, 0.5, 1)
            calc(var(--content-delay) + var(--content-stagger) * 2) both;
        }
      }

      .panel-img {
        opacity: 1;
        animation: slide-in-right var(--content-duration)
          cubic-bezier(0.25, 1, 0.5, 1)
          calc(var(--content-delay) + var(--content-stagger)) both;
      }
    }

    &.active-panel:nth-child(even) {
      .panel-txt {
        opacity: 1;
        animation: slide-in-right var(--content-duration)
          cubic-bezier(0.25, 1, 0.5, 1) var(--content-delay) both;

        h2 {
          opacity: 1;
          animation: slide-in-right var(--content-duration)
            cubic-bezier(0.25, 1, 0.5, 1)
            calc(var(--content-delay) + var(--content-stagger) * 2) both;
        }
      }

      .panel-img {
        opacity: 1;
        animation: slide-in-left var(--content-duration)
          cubic-bezier(0.25, 1, 0.5, 1)
          calc(var(--content-delay) + var(--content-stagger)) both;
      }
    }
  }

  @keyframes slide-in-right {
    from {
      transform: translateX(22px);
    }
    to {
      transform: none;
    }
  }

  @keyframes slide-in-left {
    from {
      transform: translateX(-22px);
    }
    to {
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel .panel-txt,
  .panel .panel-txt h2,
  .panel .panel-img {
    animation: none !important;
    transition: opacity 10ms linear !important;
  }
}

footer {
  position: absolute;
  margin-block-start: 200px;
  width: 100%;
  text-align: center;
}

.panel-row p,
.panel-row h1 {
  margin-block-end: 1.2rem;
}

#message-alert {
  display: none;
}

#phoneandemail a {
  text-decoration: none;
}

#value,
#leadership,
#dedication,
#focus {
  display: inline-block;
}

.contact-info {
  border: 2px solid black;
  text-decoration: none;
  border-radius: 0.2rem;
  padding: 0.375rem 0.75rem;
  gap: 6px;

  img {
    height: 1.5rem;
    width: 1.5rem;
  }
}

#openingpara {
  margin-block-end: 8px;
  line-height: 1.2;
}

.contactBtnIcons {
  display: none;
}

.panel-img {
  text-align: center;
}

#logo img,
.panel-img img {
  max-inline-size: 100%;
  block-size: auto;
}

.panel-img img {
  filter: drop-shadow(0px 12px 16px rgba(0, 0, 0, 0.45));
}

div:has(> .contact-info) {
  display: none;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 2.8rem;
  font-weight: 500;
}

.modal-content,
.modal-content a,
.form-control,
.form-control:focus {
  background-color: var(--bg-color);
  color: var(--text-color);
  border-color: var(--text-color);
}

.form-control::placeholder {
  color: #808080;
}

.modal-header {
  justify-content: space-between;
}

.close-button {
  position: relative;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  cursor: pointer;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 30px;
  background-color: var(--text-color);
  transform-origin: center;
  transition: background-color 0.2s ease-in-out;
}

.close-button:hover::before,
.close-button:hover::after {
  background-color: #808080;
}

.close-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.form-group {
  margin-bottom: 2rem;

  label {
    margin-bottom: 0.4rem;
    margin-left: 0.4rem;
    font-size: 1rem;
    font-weight: 700;
  }
}

/* Loading icon */
.lds-ring,
.lds-ring div {
  box-sizing: border-box;
}
.lds-ring {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 64px;
  height: 64px;
  margin: 8px;
  border: 8px solid currentColor;
  border-radius: 50%;
  animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: currentColor transparent transparent transparent;
}
.lds-ring div:nth-child(1) {
  animation-delay: -0.45s;
}
.lds-ring div:nth-child(2) {
  animation-delay: -0.3s;
}
.lds-ring div:nth-child(3) {
  animation-delay: -0.15s;
}

#line {
  position: fixed; /* Ensures the line remains fixed in the viewport */
  top: calc(
    50% + 86px
  ); /* Places the line in the middle of the viewport vertically */
  left: 0; /* Aligns the line to the left edge of the viewport */
  width: 100%; /* Spans the entire width of the viewport */
  height: 2px; /* Adjust thickness of the line */
  background-color: yellow; /* Color of the line */
  transform: translateY(-50%); /* Adjusts for exact center alignment */
  z-index: 1000; /* Ensures the line is above other content */
  display: none;
}

@keyframes lds-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* #### Media Queries ##### */

/* Top panel text and image adjustments */
@media (max-width: 1200px) {
  #mantra,
  #companyname {
    font-size: 3.7rem !important;
  }
  #companyname {
    letter-spacing: -5px;
  }
}

@media (max-width: 900px), (max-height: 550px) {
  #mantra,
  #companyname {
    font-size: 3.4rem !important;
  }
  #companyname {
    letter-spacing: -4px;
  }
}

@media (max-width: 800px) {
  #mantra,
  #companyname {
    font-size: 3rem !important;
  }
  #companyname {
    letter-spacing: -3.5px;
  }
  #openingpara {
    font-size: 1.1rem;
  }
}

@media (max-width: 700px) {
  #mantra,
  #companyname {
    font-size: 2.5rem !important;
  }
  #companyname {
    letter-spacing: -3px;
  }
  #openingpara {
    font-size: 1rem;
  }
}

@media (max-width: 481px) {
  #mantra {
    font-size: 1.8rem !important;
  }
}

@media (max-width: 438px) {
  #mantra {
    font-size: 1.6rem !important;
  }
}
@media (max-width: 370px) {
  #mantra {
    font-size: 1.4rem !important;
  }
}

@media (orientation: portrait) {
  .top-panel {
    background-position: left;
  }
}

/* Single column layout and additional adjustments for screens up to 600px wide */
@media (max-width: 600px) {
  #mantra,
  #companyname {
    font-size: 2rem !important;
  }
  #companyname {
    letter-spacing: -2.5px;
  }
  #phoneandemail {
    display: none !important;
  }
  #openingpara {
    font-size: 0.95rem;
  }
  .panel-row {
    flex-direction: column;
  }
  .panel-img {
    display: flex;
    justify-content: center;
  }
  .px-5 {
    padding: 1rem !important;
  }
  .panel3 .panel-row,
  .panel5 .panel-row {
    flex-direction: column-reverse;
  }
  .panel:nth-child(odd) h2,
  .panel:nth-child(even) h2 {
    text-align: left;
    padding-inline: 0;
  }
}

/* Contact modal adjustments */
@media (max-width: 600px) {
  div:has(> .contact-info) {
    display: flex;
  }
}

@media (max-width: 500px) {
  div:has(> .contact-info) {
    gap: 0.5rem;
  }
  .contact-info {
    font-size: 1rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (max-width: 400px) {
  div:has(> .contact-info) {
    gap: 0.2rem;
  }
  .contact-info {
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    gap: 3px;

    img {
      height: 1.25rem;
      width: 1.25rem;
    }
  }
}

@media (max-width: 350px) {
  .contact-info img {
    display: none;
  }
}

/* Hide button in top panel for small screen sizes */
@media (max-height: 550px) {
  .top-panel button {
    display: none;
  }
}

/* Remove padding on the top panel for very small screens */
@media (max-width: 394px) {
  .top-panel .container-lg {
    padding: 0;
  }
}

/* Responsive image sizes and contact us button styling */

@media (max-width: 1000px) {
  .panel-img img {
    inline-size: 430px;
  }
}

@media (max-width: 900px) {
  .panel-img img {
    inline-size: 380px;
  }
}

@media (max-width: 800px) {
  .panel-img img {
    inline-size: 330px;
  }
}

@media (max-width: 700px) {
  .panel-img img {
    inline-size: 280px;
  }
}

@media (max-width: 450px), (max-height: 530px) {
  #logo img {
    inline-size: 180px;
  }
}

@media (max-width: 350px) {
  .contactBtnText {
    display: none;
  }

  .contactBtnIcons {
    display: flex;
    gap: 5px;
  }

  #logo img {
    inline-size: 163px;
  }
}
