@use "sass:color";

@use "./styles/buttons";
@use "./styles/tables";
@use "./styles/inputs";
@use "./styles/toasts";
@use "./styles/uploader";
@use "./styles/downloader";
@use "./styles/footer";

@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  /* link colors */
  --link-color: rgb(57, 115, 144);
  --link-color-hover: rgb(27, 162, 230);
  --link-color-active: rgb(70, 154, 196);
  --link-color-disabled: rgba(190, 190, 190, 0.566);

  /* Button Colors */
  --primary-button-background-color: rgb(138, 208, 242);
  --primary-button-text-color: rgb(37, 37, 37);

  --primary-button-background-color-hover: rgb(70, 154, 196);
  --primary-button-text-color-hover: white;

  --primary-button-background-color-disabled: rgba(100, 100, 100, 0.566);
  --primary-button-text-color-disabled: rgba(255, 255, 255, 0.579);

  --secondary-button-background-color: rgb(255, 255, 255);
  --secondary-button-text-color: rgb(34, 34, 34);

  --secondary-button-background-color-hover: rgb(238, 238, 238);
  --secondary-button-text-color-hover: rgb(34, 34, 34);

  --secondary-button-background-color-disabled: rgba(100, 100, 100, 0.566);
  --secondary-button-text-color-disabled: rgba(255, 255, 255, 0.579);

  /* Uploader Colors */
  --uploader-background-color: rgba(240, 240, 240, 0.769);
  --uploader-text-color: rgb(71, 71, 71);

  --uploader-header-background-color: rgba(245, 245, 245, 0.5);
  --uploader-header-text-color: rgb(39, 39, 39);

  --uploader-item-background-color: rgba(255, 255, 255, 0.8);
  --uploader-item-text-color: rgb(39, 39, 39);

  /* Panel Colors */
  --panel-background-color: rgb(235, 235, 235);
  --panel-text-color: rgb(34, 34, 34);

  --panel-item-background-color: rgb(215, 215, 215);
  --panel-item-text-color: rgb(34, 34, 34);
  --panel-item-background-color-hover: rgb(238, 238, 238);
  --panel-item-text-color-hover: rgb(34, 34, 34);

  --panel-item-action-hover-background-color-from: rgba(238, 238, 238, 0.42);
  --panel-item-action-hover-background-color-to: rgb(238, 238, 238);

  --panel-header-background-color: rgba(80, 175, 223, 0.8);
  --panel-header-text-color: rgb(34, 34, 34);
  --panel-text-color-alt: rgb(126, 126, 126);

  --panel-subheader-background-color: linear-gradient(to bottom, rgb(236, 236, 236) 0%, rgb(241, 241, 241) 100%);
  --panel-subheader-text-color: rgb(34, 34, 34);

  --tabs-bar-background-color: rgb(221, 221, 221);

  --tabs-tab-background-color: rgb(211, 211, 211);
  --tabs-tab-text-color: rgb(53, 53, 53);

  --tabs-tab-background-color-hover: rgba(80, 175, 223, 0.8);
  --tabs-tab-text-color-hover: rgb(244, 244, 244);

  --tabs-tab-background-color-active: rgba(80, 175, 223, 0.8);
  --tabs-tab-text-color-active: rgb(244, 244, 244);

  --panel-nav-item-background-color: rgb(223, 223, 223);
  --panel-nav-item-text-color: rgb(53, 53, 53);

  --panel-nav-item-background-color-hover: rgba(80, 175, 223, 0.8);
  --panel-nav-item-text-color-hover: rgb(244, 244, 244);

  --panel-section-background-color: rgb(225, 225, 225);
  --panel-section-text-color: rgb(53, 53, 53);

  --panel-section-background-color-alt: rgb(218, 218, 218);
  --panel-section-text-color-alt: rgb(53, 53, 53);

  /* table colors */
  --table-background-color: rgb(221, 221, 221);
  --table-text-color: rgb(34, 34, 34);

  --table-header-background-color: rgba(80, 175, 223, 1);
  --table-header-text-color: rgb(255, 255, 255);

  --table-row-background-color: rgb(238, 238, 238);
  --table-row-text-color: rgb(34, 34, 34);

  --table-row-background-color-alt: rgb(241, 241, 241);
  --table-row-text-color-alt: rgb(34, 34, 34);

  /* input colors */
  --input-background-color: rgb(236, 236, 236);
  --input-text-color: rgb(34, 34, 34);
  --input-border-color: rgb(222, 222, 222);
  --input-border-color-hover: rgb(205, 205, 205);
  --input-border-color-focus: rgb(80, 175, 223);
  --input-placeholder-color: rgb(164, 164, 164);

  --checkbox-background-color: rgb(236, 236, 236);

  --checkbox-checked-background-color: rgb(80, 175, 223);
  --checkbox-checked-check-color: rgb(255, 255, 255);

  --label-text-color: rgb(34, 34, 34);

  --progress-bar-background-color: rgb(211, 211, 211);
  --progress-bar-fill-color: rgb(80, 175, 223);
  --progress-bar-text-color: rgb(34, 34, 34);

  /* Scrollbar Colors */
  --scrollbar-track-color: rgba(113, 113, 113, 0.119);
  --scrollbar-thumb-color: rgba(118, 118, 118, 0.495);
  --scrollbar-thumb-hover-color: rgba(81, 81, 81, 0.434);
  --scrollbar-width: 8px;
  --scrollbar-border-radius: 4px;

  /* Overlay */

  --overlay-background-color: rgba(255, 255, 255, 0.2);

  /* Button dimensions */
  --button-height: 50px;
  --button-width: 100%;
  --icon-only-button-width: 50px;

  /* Button border radius */
  --button-border-radius: 10px;

  /* Panel border radius */
  --panel-border-radius: 10px;

  /* Tabs border radius */
  --tabs-border-radius: 5px 5px 0 0;

  /* Settings dimensions */
  --settings-width: 100vw;
  --settings-height: 100vh;

  --danger-color: rgb(239, 68, 68);
}

body {
  font-family: "Inter", sans-serif;
  background: var(--panel-background-color);
  color: var(--panel-text-color);

  a {
    color: var(--link-color);
    text-decoration: none;
    &:hover {
      color: var(--link-color-hover);
    }
  }
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  @media (min-width: 900px) {
    padding: 20px;
  }
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  overflow: hidden;
  width: min(500px, 100%);
  margin-bottom: 20px;
  @media (min-width: 900px) {
    margin-bottom: -60px;
  }
}

.logo-container {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;

  @media (max-width: 900px) {
    justify-content: center;
    padding-top: 10px;
  }

  #logo {
    z-index: 200;
    padding-bottom: 20px;
    padding-top: 10px;
  }
}

.backgrounds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -100;

  .backgrounds-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    .backgrounds-item-credit {
      position: fixed;
      top: 20px;
      right: 0px;
      background: var(--accent-color-light);
      backdrop-filter: blur(10px);
      padding: 10px;
      border-radius: 5px 0 0 5px;
      color: var(--secondary-color);
      font-size: 0.6rem;
      z-index: 199;
      a {
        color: var(--secondary-color);
        text-decoration: none;
      }
    }
    &.active {
      opacity: 1;
    }
  }
}

.thank-guest-for-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel-background-color);
  backdrop-filter: blur(10px);
  opacity: 0.9;
  padding: 40px;
  border-radius: var(--panel-border-radius);
  width: 100%;
  height: 100%;

  svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    stroke: url(#gradient);
  }
  h1 {
    color: var(--panel-text-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
  }
  p {
    color: var(--panel-text-color);
    font-size: 0.8rem;
    margin-bottom: 10px;
    text-align: center;

    &.success-message {
      font-size: 2rem;
      margin-top: 20px;
      margin-bottom: 20px;
      font-weight: bold;
      background: linear-gradient(to right, var(--link-color), var(--link-color-hover));
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }

  #gradientDefs {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
  }
}

.sharePanel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-background-color);
  backdrop-filter: blur(10px);
  z-index: 101;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  .sharePanel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-background-color);
    padding: 20px;
    border-radius: 10px;
    width: calc(100% - 10px);
    @media (min-width: 768px) {
      width: 500px;
    }
    .sharePanel-title {
      color: var(--panel-text-color);
      font-size: 1.2rem;
      font-weight: bold;
      margin-bottom: 10px;
    }
    .sharePanel-url {
      color: var(--input-text-color);
      font-size: 0.8rem;
      padding: 10px;
      padding-right: 0;
      border-radius: 5px;
      background: var(--input-background-color);
      width: 100%;
      height: 50px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .sharePanel-close {
      position: absolute;
      top: 10px;
      right: 10px;
      cursor: pointer;
      color: var(--panel-text-color);
      padding: 0;
      svg {
        width: 20px;
        height: 20px;
        margin: 0 !important;
      }
    }
  }
  &.visible {
    opacity: 1;
    pointer-events: all;
  }
}

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

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel-background-color);
  backdrop-filter: blur(10px);
  z-index: 101;
  padding: 20px;
  border-radius: 10px;
  width: 400px;
  .auth-container-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;

    h1 {
      margin-bottom: 20px;
      font-size: 1.7rem;
    }
  }
}

.button-bar {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.setting-group {
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  height: 100%;
  background: var(--panel-section-background-color);
  border-radius: 5px 0 0 5px;

  .setting-group-header {
    padding: 20px 10px;
    border-radius: 8px 8px 0 0;
    color: var(--panel-section-text-color);
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: -20px;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
    width: calc(100% + 40px);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    border-radius: 5px 0 0 0;
    h3 {
      font-size: 1.2rem;
      font-weight: bold;
      margin: 0;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: flex-start;
      gap: 10px;
      svg {
        width: 20px;
        height: 20px;
      }
    }
    p {
      font-size: 0.8rem;
      margin: 0;
    }
  }
  .settings-group-info {
    font-size: 0.8rem;
    margin-top: 4px;
  }

  .setting-group-body {
    width: 100%;

    .setting-group-body-item {
      width: 100%;
      label {
        // display: block;
        margin-bottom: 5px;
      }
    }

    input,
    select,
    .background-image,
    .file-input {
      width: 100%;
    }

    h6,
    label {
      font-weight: bold;
      font-size: 1rem;
      margin: 0;
      margin-bottom: 10px;
      color: var(--label-text-color);
      small {
        font-weight: normal;
        font-size: 0.7rem;
        color: color-mix(in srgb, var(--panel-section-text-color) 60%, transparent 40%);
      }
    }
  }
}

.setting-group-body-item {
  .background-images {
    .background-image {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 5px;
      padding-right: 10px;
      border-radius: 5px;
      border: 1px solid var(--input-border-color);
      background: var(--input-background-color);
      margin-bottom: 5px;
      img {
        width: 50px;
        height: 50px;
        object-fit: cover;
        border-radius: 10px 50%;
      }
      .name {
        font-size: 0.8rem;
        color: var(--input-text-color);
      }
      button {
        width: 40px;
        height: 40px;
        padding: 0px;
        display: flex;
        align-items: center;
        justify-content: center;
        svg {
          width: 20px;
          height: 20px;
          margin-right: 0px;
          margin-top: 0px;
        }
      }
    }
  }
}

.section-help {
  height: 100%;
  margin-top: 0px;
  background: var(--panel-section-background-color-alt);
  color: var(--panel-section-text-color);
  padding: 20px;
  border-radius: 0 5px 5px 0;
  h5 {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    margin-bottom: 10px;
  }
  h6 {
    font-size: 1rem;

    margin-bottom: 10px;
    margin-top: 10px;
    font-weight: bold;
  }
}

.hu-color-picker {
  box-shadow: none !important;
  width: 220px !important;
}

.Vue-Toastification__container {
  z-index: 500 !important;
}

.share-not-ready {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  .share-status-inner {
    background: var(--secondary-color);
    color: var(--accent-color-light);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    h1 {
      color: var(--panel-text-color);
      font-size: 2rem;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 10px;
      svg {
        width: 24px;
        height: 24px;
        margin-right: 10px;
        margin-top: -1px;
        animation: spin 5s linear infinite;
      }
    }
    p {
      color: var(--panel-text-color);
      font-size: 1rem;
    }
  }
}

.slide-text {
  max-width: 250px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  &.has-slide {
    &:before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(90deg, var(--accent-color-light) 0%, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0) 90%, var(--accent-color-light) 100%);
      pointer-events: none;
      z-index: 150;
    }
  }
  .content {
    display: inline-block;
    &.needs-slide {
      transition: all 0.3s ease-in-out;
      transform: translateX(5px);
      &:hover {
        animation: slide-text var(--animation-time) ease-in-out infinite;
      }
    }
  }
}

@keyframes slide-text {
  0% {
    transform: translateX(5px);
  }
  50% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(5px);
  }
}

.help-tip {
  position: fixed;
  z-index: 150;
  padding: 0px;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--panel-text-color);
  width: 300px;
  backdrop-filter: blur(20px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s ease-in-out;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.1);
  transform: skewX(-2deg);
  filter: blur(10px);
  &.no-transition {
    transition: none;
  }
  &.shifted-up {
    transform: translateY(-15px);
    filter: blur(0px);
  }
  &.visible {
    opacity: 1;
    pointer-events: all;
  }
  .help-tip-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--panel-section-background-color-alt);
    h6 {
      font-size: 1rem;
      font-weight: bold;
      color: var(--panel-section-text-color);
      margin: 0;
    }
    .help-tip-close {
      cursor: pointer;
      width: 20px;
      height: 20px;
      margin-top: 0px;
      color: var(--panel-section-text-color);
    }
  }
  .help-tip-content {
    padding: 10px 20px;
    background: var(--panel-section-background-color-alt);
    color: var(--panel-section-text-color);
  }
}

.settings-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  position: sticky;
  top: 0px;
  li {
    a {
      display: block;
      padding: 10px 20px;
      background: var(--panel-nav-item-background-color);
      color: var(--panel-nav-item-text-color);
      text-decoration: none;
      font-size: 1rem;
      font-weight: bold;
      border-radius: 5px;
      margin-bottom: 5px;
      &:hover {
        background: var(--panel-nav-item-background-color-hover);
        color: var(--panel-nav-item-text-color-hover);
      }
      svg {
        width: 20px;
        height: 20px;
        margin-right: 10px;
        margin-top: -1px;
      }
    }
  }
}

.text-danger {
  color: #ee7354 !important;
}

.tg-dev-tools {
  z-index: 9999999 !important; /* Use a value higher than your highest z-index */
  position: fixed !important;
}

.nowrap {
  white-space: nowrap;
}

//set scrollbar styles
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track-color);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-color);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover-color);
}

* {
  transition:
    scrollbar-color 0.1s ease-in-out,
    -webkit-scrollbar-color 0.1s ease-in-out,
    -webkit-scrollbar-track 0.1s ease-in-out;
}

//hide scrollbar when the mouse is not over the scrollable element
:not(:hover) {
  scrollbar-color: transparent transparent;
  &::-webkit-scrollbar-thumb {
    background: transparent;
  }
  &::-webkit-scrollbar-track {
    background: transparent;
  }
}

.error-message {
  pointer-events: none;
}
