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

$text-muted: #6b6b6b;

/* ================= PAGE ================= */
.page {
  @include dashPageComponent;
  background: $bg-soft;
  padding: 0;

  @media (max-width: 900px) {
    margin-top: 1.4rem;
  }
}

/* ================= HEADER ================= */
.header {
  position: relative;
  height: 180px;
  border-radius: 16px;
  overflow: visible;

  background: linear-gradient(135deg, $primary, $primary-2);
  box-shadow: 0 10px 30px rgba(122, 75, 32, 0.25);

  @media (max-width: 900px) {
    height: 140px;
  }

  &::before {
    content: "";
    position: absolute;
    width: 150%;
    height: 100%;
    top: -20%;
    left: -50%;
    transform: rotate(25deg);

    background: linear-gradient(
      120deg,
      rgba(255,255,255,0.25),
      transparent
    );
  }
}

/* ================= AVATAR ================= */
.avatar {
  position: absolute;
  left: 24px;
  bottom: -45px;

  width: 90px;
  height: 90px;

  border-radius: 50%;
  background: linear-gradient(135deg, $primary, $primary-2);

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

  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;

  border: 6px solid $bg-soft;
}

/* ================= PROFILE ================= */
.profile {
  margin-top: 90px;
  padding: 1.5rem;
  background: #fff;
  border-radius: 16px;
  border: 1px solid $border;
}

/* ================= NAME ================= */
.nameRow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;

  h1 {
    font-size: 1.4rem;
  }
}

/* ================= BADGE ================= */
.badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.primary {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;

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

  box-shadow:
    0 6px 14px rgba(34, 197, 94, 0.18),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* 🔥 NEW: WARNING BADGE */
.warning {
  background: rgba(255, 193, 7, 0.15);
  color: #b45309;
}

/* ================= META ================= */
.meta {
  margin-top: 6px;
  font-size: 0.9rem;
  color: $text-light;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.dot {
  width: 4px;
  height: 4px;
  background: $border;
  margin: 0 8px;
}

/* ================= LAYOUT ================= */
.wrapper {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* ================= SIDEBAR ================= */
.sidebar {
  background: #fff;
  padding: 1rem;
  border-radius: 14px;
  height: fit-content;
  border: 1px solid $border;
}

.tabItem {
  padding: .4rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: .3rem;

   h4 {
      color: $text-dark;
      font-size: 1rem !important;
      margin: 0;
    }

  p {
    color: $text-light;
    font-size: .9rem !important;
    font-weight: 500 !important;
  }

  &:hover {
    background: $primary-soft;
    transform: translateX(2px);
  }
}

.activeTab {
  background: $primary-soft;
  border-left: 3px solid $primary;
}

/* ================= CONTENT ================= */
.content {
  background: #fff;
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid $border;
}

/* ================= FORM ================= */
.formGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}


.fullWidth {
  grid-column: 1 / -1;
}

/* ================= INPUT ================= */
.inputGroup {
  display: flex;
  flex-direction: column;

  label {
    color: $text-dark;
    font-size: 0.8rem;
    font-weight: 600;
    padding-bottom: .5rem !important;
    @media (max-width: 768px) {
      font-size: .9rem !important;
      padding-bottom: .5rem !important;
    }
  }
}

.inputWrapper {
  display: flex;
  align-items: center;
  gap: 8px;

  border: 1px solid $border;
  padding: 0.6rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  @media (max-width: 768px) {
    height: 3rem !important;
  }

  input,
  select {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font: inherit;
    font-size: 0.9rem;
    color: $text-dark;
    @media (max-width: 768px) {
      font-size: 1rem !important;
    }
  }

  input::placeholder {
    color: $text-muted;
    opacity: 1;
  }


  select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding: 0; 
    cursor: pointer;
  }


  select.placeholder {
    color: $text-muted;
  }

  &:focus-within {
    border-color: $primary;
    box-shadow: 0 0 0 2px rgba(122, 75, 32, 0.1);
  }
}

.error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.errorText {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 4px;
}

select:disabled {
  cursor: not-allowed;
  color: $text-muted;
}

/* ================= BUTTON ================= */
.primaryBtn {
  width: 100%;
  padding: 0.7rem;
  border-radius: 10px;

  background: linear-gradient(135deg, $primary, $primary-2);
  color: #fff;

  border: none;
  font-weight: 600;
  transition: all 0.25s ease;

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(122, 75, 32, 0.2);
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

/* ================= MOBILE ================= */
@media (max-width: 600px) {
  .header {
    height: 150px;
    margin-top: 0;
  }

  .avatar {
    width: 70px;
    height: 70px;
    bottom: -35px;
    left: 4rem;
  }

  .nameRow h1 {
    font-size: 1.2rem;
  }
}

.inputWrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;

  border: 1px solid $border;
  padding: 0.6rem;
  border-radius: 8px;

  input {
    border: none;
    outline: none;
    flex: 1;
    padding-right: 2rem;
  }
}

.eye {
  position: absolute;
  right: 10px;

  background: transparent;
  border: none;

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

  cursor: pointer;
  color: $text-muted;

  &:hover {
    color: $primary;
  }
}

/* ================= MOBILE FIXES ================= */
@media (max-width: 900px) {
  .wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .formGrid {
    grid-template-columns: 1fr;
  }

  .avatar {
    left: 50%;
    transform: translateX(-50%);
  }

  .profile {
    text-align: center;
    margin-top: 3rem;
  }

  .sidebar {
    display: flex;
    flex-direction: column;

    > * {
      width: 100%;
    }
  }
}

@media (max-width: 600px) {
  .avatar {
    left: 50%;
    transform: translateX(-50%);
  }
}


/* ================= NOTIFICATIONS ================= */
.notificationSection {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* ================= CARD ================= */
.notificationCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  padding: 1.2rem;
  border-radius: 14px;

  background: linear-gradient(180deg, #ffffff, #fcfbfa);
  border: 1px solid $border;

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.03),
    0 2px 6px rgba(0, 0, 0, 0.02);

  min-width: 0; 
}

/* ================= TEXT ================= */
.notificationCard > div {
  flex: 1;
  min-width: 0; 
}

.notificationCard h4 {
  font-size: 1rem;
  color: $text-dark;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.notificationCard p {
  font-size: 0.85rem;
  color: $text-light;
  line-height: 1.5;

  /* 🔥 wrap properly */
  word-break: break-word;
}

/* ================= TOGGLE ================= */
.toggle {
  flex-shrink: 0; // 🔥 NEVER shrink
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #e5e5e5;
  position: relative;
  border: none;
  cursor: pointer;

  transition: all 0.3s ease;

  span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    left: 3px;
    top: 3px;
    transition: all 0.3s ease;
  }
}

.activeToggle {
  background: linear-gradient(135deg, $primary, $primary-2);

  span {
    left: calc(100% - 25px);
  }
}

/* ================= MOBILE ================= */
@media (max-width: 600px) {
  .notificationCard {
    flex-direction: column; 
    align-items: flex-start;
    gap: 1rem;
  }

  .toggle {
    align-self: flex-end;
  }
}


//Settings Bar 
.completeProfileNotice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;

  h3 {
    font-size: 16px;
    color: #9a3412;
    margin-bottom: 4px;
    font-weight: 500 !important;
  }

  p {
    font-size: 13px;
    color: #7c2d12;
    font-weight: 500 !important;
    opacity: .85
    ;
  }
}

.noticeBtn {
  background: #ea580c;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;

  &:hover {
    background: #c2410c;
  }
}


//Tooltip
/* ================= TOOLTIP ================= */
.tooltipWrapper {
  position: relative;
  width: 100%;

  &[data-tooltip]:hover::after,
  &[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateY(-6px);
  }

  /* 🔥 Tooltip box */
  &[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 15%;
    left: 0;

    background: #fff;
    color: $text-dark;

    border: 1px solid $border;
    border-radius: 10px;

    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;

    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);

    opacity: 0;
    pointer-events: none;

    transform: translateY(0);
    transition: all 0.2s ease;

    z-index: 20;
  }

  /* 🔥 Tooltip arrow */
  &[data-tooltip]::before {
    content: "";
    position: absolute;
    bottom: 105%;
    left: 14px;

    width: 10px;
    height: 10px;

    background: #fff;
    border-left: 1px solid $border;
    border-top: 1px solid $border;

    transform: rotate(45deg);

    opacity: 0;
    transition: all 0.2s ease;

    z-index: 19;
  }
}

select{
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}