@charset "utf-8";

$green: #2D9334;

:root {
  --hw-primary-color: #{$green};
  --hw-secondary-color: #{darken($green, 10%)};
  --hw-light-color: #{lighten($green, 80%)};
}

@mixin scrollbars(
  $size: 11px,
  $foreground-color: #b2b2b2,
  $background-color: transparent
) {
  &::-webkit-scrollbar {
    width: $size;
  }
  &::-webkit-scrollbar-thumb {
    background-color: $foreground-color;
    border-radius: 6px;
  }
  &::-webkit-scrollbar-track {
    background: $background-color;
  }

  scrollbar-color: $foreground-color $background-color;
  scrollbar-width: thin;
}

.hw-content {
  position: fixed;
  z-index: 9000;
  bottom: 60px;
  right: min(20px, 5%);
  flex: 1;
  min-height: 300px;
  width: min(350px, 90%);
  max-height: 80%;
  box-sizing: border-box;
  border-radius: 15px;
  border-bottom-right-radius: 5px;
  border: 1px solid var(--hw-primary-color);
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 5px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 14px;
  transition: transform .5s ease-in-out, opacity .5s ease-in-out;
  transform: scale(1);
  transform-origin: bottom right;
  opacity: 1;
  animation: grow .5s ease-in-out;

  &.hw-expanded {
    width: auto;
    max-width: 80%;
  }

  & img {
    max-width: 100%;
    max-height: 250px;
  }

  & video {
    max-width: 100%;
    max-height: 250px;
  }
}

.hw-head {
  background: var(--hw-primary-color);
  display: flex;
  align-items: center;
  padding: 10px 20px; /* Optional padding for spacing */
  width: 100%;
  box-sizing: border-box;
}

.hw-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 10px;
  overflow-y: hidden;
  background: #e2e2e2;

  & .hw-inner-body {
    position: relative;
    width: 100%;
    flex: 1;
    box-sizing: border-box;
    overflow-y: auto;
    background: #fff;
    padding: 10px;
    border: 10px solid white;
    border-radius: 10px;
    box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1);
    @include scrollbars();
  }
}

.hw-image {
  cursor: pointer;
}

.hw-article-list {
  & ul {
    list-style: none outside;
    padding: 0;

     & li {
       width: 100%;
       padding: 0;

       &:not(:last-child) {
         border-bottom: 1px solid var(--hw-light-color)
       }

       &:hover a,
       & a:focus {
         color: var(--hw-secondary-color);
         background-color: var(--hw-light-color);
       }

       & a {
         display: block;
         cursor: pointer;
         padding: 10px;
         text-decoration: none;
         color: var(--hw-primary-color);
       }
     }
  }
}

.hw-article-title {
  font-weight: bold;
  font-size: 23px;
  word-wrap:break-word;
  color: var(--hw-text-color);

  flex: 1; /* Makes the title take up the remaining space */
  margin: 0;
  text-align: left; /* Centers the title text */
  overflow-wrap: break-word; /* Allows wrapping of long words */
  word-break: break-word; /* Ensures long words break to the next line */
}

.hw-article-body {
  word-wrap:break-word;
}

.hw-button {
  position: fixed;
  z-index: 9000;
  bottom: 20px;
  right: min(20px, 5%);
  background: var(--hw-primary-color);
  color: var(--hw-text-color);
  border: 1px solid #fff;
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1);
  padding: 10px 15px;
  font-weight: bold;
  font-size: 14px;
  border-radius: 30px;
  border-top-right-radius: 10px;
  cursor: pointer;
  transition: background .3s ease-in-out;
  -webkit-appearance: none;
  -moz-appearance: none;

  &:hover,
  &:focus {
    background: var(--hw-secondary-color);
  }
}

.hw-back,
.hw-expand,
.hw-collapse,
.hw-close {
  background: transparent;
  border: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: flex;
  justify-content: center;

  width: 50px;
  height: 50px;
  max-width: 50px;
  max-height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;

  &:hover,
  &:focus {
    background: var(--hw-secondary-color);
  }
}

.fa {
  &.text-color {
    color: var(--hw-text-color);
  }
}

.hw-expand,
.hw-collapse {
  margin-right: 10px;
}

.hw-icon {
  width: 16px;
}

.hw-hidden {
  transition: transform .3s ease-in-out, opacity .3s ease-in-out;
  transform: scale(0);
  transform-origin: bottom right;
  opacity: 0;
  animation: shrink .3s ease-in-out;
}

.hw-display-none {
  display: none;
}

@keyframes grow {
  0% {
    display: none;
    opacity: 0;
  }
  1% {
    display: block;
    opacity: 0;
    transform: scale(0);
    transform-origin: bottom right;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    transform-origin: bottom right;
  }
}

@keyframes shrink {
  0% {
    display: block;
    opacity: 1;
    transform: scale(1);
    transform-origin: bottom right;
  }
  99% {
    opacity: 0;
    transform: scale(0);
    transform-origin: bottom right;
  }
  100% {
    display: none;
    opacity: 0;
    transform: scale(0);
    transform-origin: bottom right;
  }
}