/* Navigation Bar Component Styles */

.navbar-container {
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  height: 53px;
  background-color: #fff;
  border-bottom: 1px solid #E0E0E0;
  box-shadow: 0px 0px 4px 0px #00000026;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Orange "Uus tellimus" button */
.new-order-btn {
  height: 26px;
  background-color: #FFA600;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: #E69500;
  }

  .icon-box {
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    .msymbol {
      font-size: 12px;
      color: #FFA600;
      font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 24;
    }
  }

  .text {
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: "PT Sans", sans-serif;
    white-space: nowrap;
  }
}

/* Navigation items */
.nav-items {
  display: flex;
  align-items: center;
  gap: 24px;
  user-select: none;
}

.nav-item {
  color: #2F2E31;
  font-size: 14px;
  font-family: "PT Sans", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
  padding: 0 8px;
  height: 53px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  transition: border-bottom 0.2s ease, color 0.2s ease;
  position: relative;
  margin-bottom: 2.5px;

  &:hover {
    color: #FFA600;
  }

  &.active {
    color: #FFA600;
    border-bottom: 3px solid #FFA600;
  }

  .dropdown-arrow {
    font-size: 16px;
    margin-left: 4px;
    transition: transform 0.2s ease;
  }
}

.nav-item-container {
  position: relative;
  display: inline-block;

  &:hover .nav-item .dropdown-arrow {
    transform: rotate(180deg);
  }
}

/* Dropdown menu */
.nav-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
  animation: slideIn 0.2s ease;

}

.nav-dropdown-item {
  padding: 12px 16px;
  color: #2F2E31;
  font-size: 14px;
  font-family: "PT Sans", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  border-bottom: 1px solid #F5F5F5;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background-color: #F8F9FA;
    color: #FFA600;
  }

  &.active {
    background-color: #FFF3CD;
    color: #FFA600;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Right side navigation elements */

/* Nav Search component */
.nav-search-container {
  position: relative;
}

.nav-search {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #BCC7DD;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
  min-width: 180px;
  width: 250px;
  margin: 0;
  padding: 0 6px 0 12px;
  box-sizing: border-box;
  cursor: text;

  .search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 18px;
    color: #8D92A5;
    font-size: 16px;
    margin-left: 6px;
    flex-shrink: 0;
  }

  .search-form {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    flex: 1;

    .input-search {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;

      input {
        height: 18px;
        border: 0;
        outline: none;
        background: transparent;
        color: inherit;
        font: 14px "PT Sans", sans-serif;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        width: 100%;
        flex: 1;
        border-radius: 0;
      }
    }

    .full-width-input {
      width: 100%;
      max-width: none;
      min-width: 0;
    }

    .full-width-text {
      width: 100%;
    }

    .text { 
      white-space: nowrap; 
    }

    .count-chip {
      display: inline-flex;
      align-items: center;

      .chip-x {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #B0B0B0;
        cursor: pointer;
        color: white;
        font-size: 10px;

        &:hover { 
          background: #9A9A9A; 
        }
      }
    }
  }

  .search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 18px;
    color: #8D92A5;
    font-size: 16px;
  }

  mark {
    background-color: #FEF3C1;
    color: #333;
    padding: 1px 2px;
    border-radius: 2px;
  }
}

/* Search bar */
.search-container {
  position: relative;
  width: 200px;
  height: 24px;
  border-radius: 8px;
  background-color: white;
  border: 1px solid #BCC7DD;
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;

  &:focus-within {
    border-color: #FFA600;
  }

  .search-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-family: "PT Sans", sans-serif;
    font-size: 12px;
    outline: none;
    color: #2F2E31;
    flex: 1;

    &::placeholder {
      color: #8D92A5;
    }
  }

  .search-icon {
    font-size: 16px;
    color: #504639;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    margin-left: 4px;
  }
}

/* Icon buttons */
.nav-icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  padding: 6px;
  background-color: #E1E4EA;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: #D1D5DB;
  }

  .msymbol {
    font-size: 16px;
    color: #504639;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  }
}

/* Company name */
.company-name {
  font-size: 14px;
  font-family: "PT Sans", sans-serif;
  font-weight: 700;
  color: #2F2E31;
  white-space: nowrap;
}

/* User dropdown */
.user-dropdown-container {
  position: relative;
}

.user-dropdown-trigger {
  height: 24px;
  border-radius: 4px;
  padding: 0 6px 0 10px;
  background-color: #E1E4EA;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background-color 0.2s ease;
  box-sizing: border-box;

  &:hover {
    background-color: #D1D5DB;
  }

  .user-name {
    font-size: 12px;
    font-family: "PT Sans", sans-serif;
    font-weight: 700;
    color: #2F2E31;
    white-space: nowrap;
  }

  .dropdown-arrow {
    font-size: 16px;
    color: #504639;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  }
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 1000;
  overflow: hidden;
  animation: slideIn 0.2s ease;
  margin-top: 6px;

}

.user-dropdown-item {
  padding: 8px 12px;
  color: #2F2E31;
  font-size: 12px;
  font-family: "PT Sans", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #F5F5F5;
  display: flex;
  align-items: center;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background-color: #F8F9FA;
  }

  .msymbol {
    font-size: 16px;
    color: #504639;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    margin-right: 8px;
  }

  .text {
    font-size: 12px;
    font-family: "PT Sans", sans-serif;
    font-weight: 700;
    color: #2F2E31;
  }

  &.current {
    background-color: var(--pl-peach);
  }

  .more {
    font-size: 16px;
    color: #504639;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    margin-left: auto;
    cursor: pointer;
    transition: color 0.2s ease;

    &:hover {
      color: #FFA600;
    }
  }
}

/* Burger menu dropdown */
.burger-menu-container {
  position: relative;
}

.burger-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 1000;
  overflow: hidden;
  animation: slideIn 0.2s ease;
  margin-top: 6px;

}

.burger-dropdown-item {
  padding: 12px 16px;
  color: #2F2E31;
  font-size: 14px;
  font-family: "PT Sans", sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  border-bottom: 1px solid #F5F5F5;

  &:last-child {
    border-bottom: none;
  }

  &:hover {
    background-color: #F8F9FA;
    color: #FFA600;
  }
}
