/* index.css */
:root {
  /* Brand Colors */
  --primary-color: #303030;
  --secondary-color: #f4442e;
  --tertiary-color: #f4442e;
  --background-color: #F5F5F5;
  --background-color-rgb: 221, 221, 221;
  --bottom-bar-bg: #f0f8ff;
  --white-color: #ffffff;

  /* Accent Colors */
  --accent-color-1: #3D74B6;

  /* Status and Alert Colors */
  --success-color: #606C5D;
  --error-color: #FA9884;
  --warning-color: #ffc107;
  --info-color: #CF0F47;

  /* Chart-Specific Colors */
  --chart-color-1: #77BEF0;
  --chart-color-2: #FFCB61;
  --chart-color-3: #FF894F;
  --chart-color-4: #EA5B6F;

  --select-color: #9ECAD6;

  /* Sentiment Colors */
  --positive-sentiment: #97B067;
  --neutral-sentiment: #FFCB61;
  --negative-sentiment: #EA5B6F;

  --hyperlink-color: #3D74B6;

  --alert-success: #4bdc3c9c;
  --alert-error: #dc3c3c94;
  --alert-info: #f6e8ea;

  --font-sm: 0.875rem;
  --font-md: 1rem;
  --font-lg: 1.25rem;
  --font-xl: 2rem;

  --font-size-h1: 2.5rem;
  --font-size-p: 1rem;
  --font-size-p1: calc(0.8 * var(--font-size-p));
  --font-size-p2: calc(0.85 * var(--font-size-p));
  --font-size-p3: calc(0.9 * var(--font-size-p));

  --font-family: "Instrument Sans", 'Noto Sans Arabic', sans-serif;
  --paragraph-font-family: "Instrument Sans", 'Noto Sans Arabic', sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--white-color);
  color: var(--primary-color);
  margin: 0;
  padding-bottom: 4rem;
}

h1 {
  color: var(--primary-color);
  text-align: left;
  text-transform: uppercase;
}

/* Desktop logo display */
.desktop-logo {
  position: fixed;
  top: 1rem;
  left: 1rem;
  /* z-index: 101; */
  margin-bottom: 2rem;
}

.logo {
  max-width: 5rem;
  height: auto;
}

.content {
  padding: 2rem 1rem;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

#sidebar {
  bottom: 0;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.5rem 0;
  /* z-index: 100; */
}

.nav-link {
  text-align: center;
  font-size: 1rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
  transition: all 0.3s ease;

  i {
    color: var(--primary-color);
    font-size: 1.2rem;
  }

  span {
    margin-top: 0.25rem;
    color: var(--primary-color);
  }

  &.active {
    transform: scale(1.1);
  }
}

.menu-item.active,
.nav-link.active {
  span {
    color: var(--secondary-color)
  }
}

.product-section p {
  font-weight: bold;
  font-size: var(--font-size-p1);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  opacity: 0.6;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.show-more-btn {
  display: inline-block;
  font-size: 0.75rem;
  margin: 0.25rem 0 0.75rem;
  cursor: pointer;
  color: var(--secondary-color);

  &:hover {
    text-decoration: underline;
  }
}

#layout-container {
  display: flex;
  flex-direction: column;
}

.more-menu {
  display: none;
  position: fixed;
  right: 1rem;
  background-color: var(--white-color);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  width: 18rem;
  padding: 1rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  color: var(--primary-color);
  z-index: 9;
  overflow: overlay;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.menu-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s;
  padding: 0.5rem 0;
  background-color: var(--white-color);

  span {
    font-size: var(--font-size-p2);
    display: block;
  }

  &:hover {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  }
}

a:hover {
  text-decoration: none;
}

.login-container {
  background-color: var(--background-color);
  height: 100%;
  overflow-y: auto;

  .login-logo img {
    max-width: 6rem;
    margin: 1rem;
  }
}

#dateTimeModal {
  .dateSelectionOtions {
    margin-bottom: 1rem;

    span {
      margin: 8px;
      cursor: pointer;

      a {
        color: var(--hyperlink-color);
        text-decoration: none;

        &:hover {
          text-decoration: underline;
        }
      }

      &.active {
        /* padding-bottom: 8px;
        border-bottom: 3px solid var(--hyperlink-color); */
        font-weight: bold;
      }
    }
  }

  .dateManualInputDiv {
    display: flex;
    align-items: center;
    flex-direction: column;

    input {
      padding: 4px 8px;
      border: none;
      box-sizing: border-box;
      box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
      border-radius: 3px;
      background-color: rgba(255, 255, 255, 0.8);
      outline: none;
    }
  }

  #fromdatecontainer,
  #todatecontainer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
  }
}

.toast {
  --bs-toast-max-width: 250px !important;
}

.custom-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
  z-index: 9999;
  pointer-events: auto;
  display: block !important;
  /* Prevent Bootstrap from hiding it */
}

.custom-toast.slide-in {
  opacity: 1;
  transform: translateX(0);
}

.custom-toast.slide-out {
  opacity: 0;
  transform: translateX(100%);
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding: 0;
  border-bottom: 1px solid var(--primary-color);
  margin-bottom: 1rem;
}

.tab-item {
  padding: 0.5rem;
  cursor: pointer;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  color: var(--primary-color);

  i {
    color: var(--tertiary-color);
  }

  &.active {
    border-bottom: 2px solid var(--primary-color);
  }
}

.action-btn-1,
.submit-btn-1 {
  background-color: var(--tertiary-color);
  border: none;
  border-radius: 15px;
  font-size: var(--font-size-p3);
  font-weight: bold;
  color: var(--white-color);

  i {
    color: var(--white-color) !important;
  }

  &:hover,
  &:active,
  &:focus-visible,
  &.active {
    background-color: var(--tertiary-color) !important;
    color: var(--white-color) !important;
    opacity: 0.8;
  }
}

.action-btn-2,
.submit-btn-2 {
  background-color: var(--tertiary-color);
  border: none;
  color: var(--white-color);

  &:hover,
  &:active {
    background-color: var(--tertiary-color) !important;
    color: var(--white-color) !important;
    opacity: 0.8;
  }

  i {
    color: var(--white-color) !important;
  }
}

p {
  font-size: var(--font-size-p);
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: calc(var(--font-size-h1) * 0.85);
}

h3 {
  font-size: calc(var(--font-size-h1) * 0.7);
}

h4 {
  font-size: calc(var(--font-size-h1) * 0.6);
}

h5 {
  font-size: calc(var(--font-size-h1) * 0.5);
}

h6 {
  font-size: calc(var(--font-size-h1) * 0.4);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
}

/* FAB + Icon Menu */
.fab-container {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;

  .fab,
  .fab-menu button {
    background-color: var(--tertiary-color);
    color: var(--white-color) !important;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .fab-menu {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 9;
  }

  &:hover .fab-menu {
    opacity: 1;
    visibility: visible;
  }
}

.scroll-to-top {
  position: fixed;
  top: 1.4rem;
  right: 0;
}

.scroll-to-top {
  background-color: var(--tertiary-color);
  color: var(--white-color) !important;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-p1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s;
}

@media (max-width: 767px) {

  #sidebar {
    position: fixed;
    width: 100%;
    left: 0;
    top: unset;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    border-top: 1px solid var(--background-color);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    background-color: var(--white-color);
  }

  .fab-container {
    bottom: 5rem;
  }

  #main-content {
    padding: 0 8px 6rem 8px;

    >div:first-child {
      margin-left: 0;
    }
  }

  .content {
    padding: 1rem 0;
  }

  .more-menu {
    bottom: 5rem;
  }
}

@media (min-width: 768px) {

  .more-menu {
    left: 2.5rem;
    top: 2rem;
  }

  body {
    padding-bottom: 0;
  }

  #layout-container {
    flex-direction: row;
  }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 7rem;
    height: 100%;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 7rem;
    border-right: 1px solid var(--background-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .nav-link {
    margin: 0.5rem 0;
    width: 100%;
    padding: 0.5rem 0;

    span {
      display: block;
      margin-top: 0.5rem;
    }
  }

  #main-content {
    width: 100%;
    outline: none;
    margin-left: 7rem;
    overflow-x: hidden;
  }
}

form {
  .form-group-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .form-group-row label {
    width: 160px;
    margin: 0;
    color: var(--primary-color);
  }

  .form-group-row .form-select,
  .form-group-row .form-control,.form-group-row div {
    flex: 1;
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  label {
    font-weight: bold;
  }

  textarea {
    resize: none;
  }
}

.dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

  .dropdown-item {
    font-size: var(--font-size-p1);
    color: var(--primary-color) !important;
    transition: background-color 0.2s;
    cursor: pointer;
    padding: 0.5rem 1rem;

    i {
      color: var(--primary-color) !important;
      margin-right: 5px;
      margin-left: 0px !important;
    }

    &:hover,
    &:active,
    &.active {
      background-color: var(--tertiary-color);
      color: var(--white-color) !important;

      i {
        color: var(--white-color) !important;
      }
    }
  }
}

.gradient-4 {
  background: linear-gradient(to right, var(--background-color), var(--white-color));
}

.btn:disabled {
  background-color: var(--tertiary-color) !important;
  color: var(--white-color);
}

.toolbar {
  .toolbar-settings {
    width: fit-content;
    background-color: var(--background-color);
    padding: 0.5rem 1rem;
  }

  .toggle-btn {
    color: var(--primary-color);
    background-color: var(--white-color);
    border: 1px solid var(--background-color);
    transition: background-color 0.2s ease;

    i {
      color: var(--tertiary-color);
    }

    &.active,
    &:active {
      border: 1px solid var(--background-color);
      background-color: var(--white-color);
      color: var(--primary-color);

      i {
        color: var(--primary-color) !important;
      }
    }
  }
}

.load-latest-btn .btn,
#loadMoreBtn,
#loadMore-btn .btn {
  color: var(--white-color);
  background-color: var(--tertiary-color);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 60%;

  &:hover {
    opacity: 0.8;
  }
}

em {
  font-style: normal;
}