@use "../../../styles/abstracts/variables";
@use "../../../styles/abstracts/mixins";

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap");

/* ========================================= */
/* LAYOUT */
/* ========================================= */

.layout {
  min-height: 100vh;

  display: grid;
  grid-template-columns: 300px 1fr;

  position: relative;

  font-family: variables.$font;

  background: var(--background);

  overflow-y: auto;

  transition:
    background-color 0.25s ease,
    color 0.25s ease;

  @media only screen and (max-width: 1000px) {
    grid-template-columns: 1fr;
  }

  &__bottombar {
    display: none;

    @media only screen and (max-width: 1000px) {
      display: block;
    }
  }

  /* ========================================= */
  /* SIDEBAR */
  /* ========================================= */

  &__sidebar {
    position: fixed;

    width: 300px;

    z-index: 2;

    @media only screen and (max-width: 1000px) {
      width: 70%;

      top: 5.4rem;

      z-index: 888;

      display: none;
    }
  }

  /* ========================================= */
  /* CONTENT */
  /* ========================================= */

  &__content {
    position: absolute;
    right: 0;

    width: calc(100% - 300px);

    overflow-x: hidden;

    @media only screen and (max-width: 1000px) {
      width: 100%;
      left: 0;
    }

    /* ========================================= */
    /* NAVBAR */
    /* ========================================= */

    &__navbar {
      position: fixed;

      top: 0;
      right: 0;

      width: calc(100% - 280px);

      z-index: 100;

      background: var(--panel);

      border-bottom: 1px solid var(--border);

      transition:
        background-color 0.25s ease,
        border-color 0.25s ease;

      @media only screen and (max-width: 1000px) {
        width: 100%;
      }
    }

    /* ========================================= */
    /* MAIN CONTENT */
    /* ========================================= */

    &--children {
      min-width: 0;
      overflow-x: hidden;
      display: grid;

      grid-template-columns: 1fr 290px;

      gap: 12px;

      padding: 2rem;
      padding-left: 0.75rem !important;

      padding-top: 5rem;
      padding-bottom: 5rem;

      position: relative;

      background: var(--background);

      transition:
        background-color 0.25s ease,
        color 0.25s ease;

      @media only screen and (max-width: 1000px) {
        display: flex;
        flex-direction: column;

        width: 100%;
        max-width: 100%;

        padding: 2rem 1.2rem !important;
        padding-top: 5rem !important;
        padding-bottom: 5rem;

        margin-bottom: 4rem;
      }

      /* ========================================= */
      /* RIGHT SIDEBAR */
      /* ========================================= */

      &--rightbar {
        position: fixed;

        width: 280px;

        right: 1.5rem;
        top: 6rem;

        @media only screen and (max-width: 1000px) {
          display: none !important;
        }
      }
    }
  }
}

/* ========================================= */
/* SCROLLBAR */
/* ========================================= */

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

/* ==========================================
   PREMIUM TRADERPLUS FLASH
========================================== */

.flash {
  position: fixed;

  top: 1rem;
  right: 1rem;

  z-index: 999999;

  width: min(400px, calc(100vw - 2rem));

  display: flex;
  align-items: center;

  gap: 0.9rem;

  padding: 0.9rem;

  border-radius: 14px;

  overflow: hidden;
  font-family: variables.$font;

  animation: flashEnter 0.3s ease;

  backdrop-filter: blur(24px);

  background: linear-gradient(
    180deg,
    rgba(26, 26, 29, 0.98),
    rgba(17, 17, 20, 0.98)
  );

  border: 1px solid rgba(255, 255, 255, 0.08);

  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.55),
    0 8px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  &::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 4px;
  }
}

/* ==========================================
   STATUS BLOCK
========================================== */

.flashIndicator {
  width: 42px;
  height: 42px;

  min-width: 42px;

  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
}

.flashDot {
  width: 9px;
  height: 9px;

  border-radius: 50%;

  animation: pulse 1.8s infinite;
}

/* ==========================================
   CONTENT
========================================== */

.flashContent {
  flex: 1;

  min-width: 0;

  h5 {
    margin: 0;

    color: #ffffff;

    font-size: 0.72rem;

    font-weight: 700;

    letter-spacing: 0.08em;

    text-transform: uppercase;
  }

  p {
    margin-top: 0.28rem;  

    color: rgba(255, 255, 255, 0.82);

    font-size: 0.76rem;

    line-height: 1.55;

    font-weight: 400;
  }
}

/* ==========================================
   SUCCESS
========================================== */

.flashSuccess {
  &::before {
    background: #22c55e;
  }

  .flashIndicator {
    background: rgba(34, 197, 94, 0.12);

    border: 1px solid rgba(34, 197, 94, 0.18);
  }

  .flashDot {
    background: #22c55e;

    box-shadow:
      0 0 0 5px rgba(34, 197, 94, 0.12),
      0 0 18px rgba(34, 197, 94, 0.4);
  }
}

/* ==========================================
   ERROR
========================================== */

.flashError {
  &::before {
    background: #ef4444;
  }

  .flashIndicator {
    background: rgba(239, 68, 68, 0.12);

    border: 1px solid rgba(239, 68, 68, 0.18);
  }

  .flashDot {
    background: #ef4444;

    box-shadow:
      0 0 0 5px rgba(239, 68, 68, 0.12),
      0 0 18px rgba(239, 68, 68, 0.4);
  }
}

/* ==========================================
   WARNING
========================================== */

.flashWarning {
  &::before {
    background: #f59e0b;
  }

  .flashIndicator {
    background: rgba(245, 158, 11, 0.12);

    border: 1px solid rgba(245, 158, 11, 0.18);
  }

  .flashDot {
    background: #f59e0b;

    box-shadow:
      0 0 0 5px rgba(245, 158, 11, 0.12),
      0 0 18px rgba(245, 158, 11, 0.35);
  }
}

/* ==========================================
   INFO
========================================== */

.flashInfo {
  &::before {
    background: #3b82f6;
  }

  .flashIndicator {
    background: rgba(59, 130, 246, 0.12);

    border: 1px solid rgba(59, 130, 246, 0.18);
  }

  .flashDot {
    background: #3b82f6;

    box-shadow:
      0 0 0 5px rgba(59, 130, 246, 0.12),
      0 0 18px rgba(59, 130, 246, 0.4);
  }
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 768px) {
  .flash {
    top: 0.75rem;

    left: 0.75rem;
    right: 0.75rem;

    width: auto;

    padding: 0.85rem;
  }

  .flashIndicator {
    width: 38px;
    height: 38px;

    min-width: 38px;
  }

  .flashContent {
    h5 {
      font-size: 0.68rem;
    }

    p {
      font-size: 0.72rem;
    }
  }
}

/* ==========================================
   ANIMATIONS
========================================== */

@keyframes flashEnter {
  from {
    opacity: 0;

    transform:
      translateY(-14px)
      scale(0.97);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

.flash,
.flash * {
  font-family: inherit;
}