/**
 * Sidebar theme aligned with v1 landing (marham-home tokens).
 * Scoped to aside.sidebar-v1 — load after Frontend/custom CSS.
 */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

/* --- v1 tokens (local; :root may not define these on non-v1 routes) --- */
.aside-order.sidebar-v1 {
  --sv1-primary: #00507a;
  --sv1-primary-dark: #003a5c;
  --sv1-primary-light: #e6f4f9;
  --sv1-accent: #72cbd6;
  --sv1-white: #ffffff;
  --sv1-gray-50: #f8fafc;
  --sv1-gray-100: #f1f5f9;
  --sv1-gray-200: #e2e8f0;
  --sv1-gray-400: #94a3b8;
  --sv1-gray-600: #475569;
  --sv1-gray-800: #1e293b;
  --sv1-gray-900: #0f172a;
  --sv1-radius-lg: 16px;
  --sv1-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --sv1-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
}

/* Former inline sidebar block: only when this sidebar is on the page */
body:has(aside.sidebar-v1) .wrapper {
  background: none !important;
  padding: 10px;
  margin-top: 50px;
}

@media (max-height: 760px) {
  .aside-order.sidebar-v1 {
    order: -1;
  }
}

/* --- Profile card shell --- */
.aside-order.sidebar-v1 .full-width {
  border-radius: var(--sv1-radius-lg) !important;
  box-shadow: var(--sv1-shadow) !important;
  border: 1px solid var(--sv1-gray-200) !important;
  background-color: var(--sv1-white) !important;
  overflow: hidden;
}

.aside-order.sidebar-v1 .sidebar-v1__stack {
  margin-top: -15px;
}

.aside-order.sidebar-v1 .username-dt {
  padding-top: 44px;
}

.aside-order.sidebar-v1 .dpbg-1 {
  background-image: linear-gradient(
    135deg,
    var(--sv1-primary) 0%,
    var(--sv1-primary-dark) 100%
  ) !important;
  border-top-left-radius: var(--sv1-radius-lg);
  border-top-right-radius: var(--sv1-radius-lg);
}

.aside-order.sidebar-v1 .usr-pic {
  margin-bottom: -38px;
}

.aside-order.sidebar-v1 .usr-pic > img {
  border: 3px solid var(--sv1-white) !important;
  box-shadow: 0 4px 14px rgba(0, 80, 122, 0.22) !important;
}

.aside-order.sidebar-v1 .rating_total {
  color: #f59e0b;
  font-weight: 600;
}

.aside-order.sidebar-v1 .username-main-dt {
  padding: 58px 18px 14px;
}

.aside-order.sidebar-v1 .username-main-dt h4 {
  margin-bottom: 6px;
}

.aside-order.sidebar-v1 .username-main-dt h4 a {
  color: var(--sv1-gray-900) !important;
  font-weight: 700 !important;
  text-decoration: none;
  transition: color 0.15s ease;
}

.aside-order.sidebar-v1 .username-main-dt h4 a:hover {
  color: var(--sv1-primary) !important;
}

.aside-order.sidebar-v1 .sidebar-v1__meta-tight {
  margin-top: -25px;
}

.aside-order.sidebar-v1 hr {
  border: 0;
  border-top: 1px solid var(--sv1-gray-200);
  margin: 12px 16px;
  opacity: 1;
}

/* --- Stats / links list --- */
.aside-order.sidebar-v1 .info__sections {
  padding: 8px 14px 18px !important;
}

.aside-order.sidebar-v1 .info__sections li {
  margin-bottom: 4px;
}

.aside-order.sidebar-v1 .all-info__sections {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  float: none !important;
}

.aside-order.sidebar-v1 .all-info__sections a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  text-decoration: none !important;
  padding: 8px 6px;
  border-radius: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.aside-order.sidebar-v1 .all-info__sections a:hover {
  background-color: var(--sv1-primary-light);
}

.aside-order.sidebar-v1 .all-info__left {
  float: none !important;
  color: var(--sv1-gray-800) !important;
  font-weight: 500;
}

.aside-order.sidebar-v1 .all-info__sections a span.all-info__left {
  flex: 1;
  min-width: 0;
}

.aside-order.sidebar-v1 .all-info__right {
  float: none !important;
  color: var(--sv1-primary) !important;
  font-weight: 600;
  flex-shrink: 0;
}

.aside-order.sidebar-v1 .all-info__left i {
  color: var(--sv1-primary) !important;
}

.aside-order.sidebar-v1 a.all-info__left {
  color: var(--sv1-gray-800) !important;
  font-weight: 500;
}

.aside-order.sidebar-v1 a.all-info__left:hover {
  color: var(--sv1-primary) !important;
}

.aside-order.sidebar-v1 .hash-color {
  color: var(--sv1-primary) !important;
}

/* --- CTA --- */
.aside-order.sidebar-v1 .profile-link {
  padding: 4px 16px 16px;
}

.aside-order.sidebar-v1 .profile-link a {
  float: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  margin: 0 auto;
  padding: 10px 22px;
  border-radius: 9999px;
  font-weight: 600 !important;
  color: var(--sv1-primary) !important;
  border: 1px solid var(--sv1-primary);
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.aside-order.sidebar-v1 .profile-link a:hover {
  background: var(--sv1-primary-light) !important;
  color: var(--sv1-primary-dark) !important;
  box-shadow: 0 2px 10px rgba(0, 80, 122, 0.12);
}

/* --- Explore panel --- */
.aside-order.sidebar-v1 .explore-heading {
  background: linear-gradient(
    135deg,
    var(--sv1-primary) 0%,
    var(--sv1-primary-dark) 100%
  ) !important;
  border-bottom: none !important;
  padding: 14px 18px !important;
}

.aside-order.sidebar-v1 .explore-heading h4 {
  color: var(--sv1-white) !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

.aside-order.sidebar-v1 .explore-dt {
  padding: 16px 18px 0;
}

.aside-order.sidebar-v1 .explore-dt h6 {
  color: var(--sv1-primary) !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.08em;
  margin-bottom: 8px !important;
}

.aside-order.sidebar-v1 .add-btn.request-btn,
.aside-order.sidebar-v1 .add-btn {
  border-radius: 10px !important;
  border: 1px solid var(--sv1-gray-200) !important;
  background: var(--sv1-gray-50) !important;
  color: var(--sv1-primary) !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.aside-order.sidebar-v1 .request-btn:hover,
.aside-order.sidebar-v1 .add-btn:hover {
  background: var(--sv1-primary-light) !important;
  border-color: var(--sv1-primary) !important;
  color: var(--sv1-primary-dark) !important;
}

/* --- Modal inside sidebar --- */
.aside-order.sidebar-v1 .modal-header.username-dt.dpbg-1 {
  border-radius: 0;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

.aside-order.sidebar-v1 .modal-header .btn-close {
  filter: brightness(0) invert(1);
}

/* --- Desktop: left sidebar scrolls independently without trapping page scroll --- */
@media (min-width: 1200px) {
  .aside-order.sidebar-v1 {
    position: sticky;
    top: 80px;
    align-self: flex-start;
    height: auto !important;
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--sv1-gray-200) transparent;
  }

  .aside-order.sidebar-v1::-webkit-scrollbar {
    width: 4px;
  }

  .aside-order.sidebar-v1::-webkit-scrollbar-track {
    background: transparent;
  }

  .aside-order.sidebar-v1::-webkit-scrollbar-thumb {
    background: var(--sv1-gray-200);
    border-radius: 4px;
  }

  body:has(aside.sidebar-v1) .container > .row > main:not(.center_section_123) {
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  body:has(aside.sidebar-v1)
    .container
    > .row
    > main:not(.center_section_123)::-webkit-scrollbar {
    width: 6px;
  }

  body:has(aside.sidebar-v1)
    .container
    > .row
    > main:not(.center_section_123)::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
  }
}

/* --- Progress / skill helpers (moved from former inline block) --- */
.aside-order.sidebar-v1 .skill {
  margin-bottom: 35px;
  position: relative;
  overflow-x: hidden;
}

.aside-order.sidebar-v1 .skill > p {
  font-size: 18px;
  font-weight: 700;
  color: var(--sv1-gray-900);
  margin: 0;
}

.aside-order.sidebar-v1 .skill::before {
  width: 100%;
  height: 5px;
  content: "";
  display: block;
  position: absolute;
  background: var(--sv1-gray-200);
  bottom: 0;
}

.aside-order.sidebar-v1 .skill-bar {
  width: 100%;
  height: 5px;
  background: var(--sv1-primary);
  display: block;
  position: relative;
}

.aside-order.sidebar-v1 .skill-bar span {
  position: absolute;
  border-top: 5px solid var(--sv1-primary);
  top: -30px;
  padding: 3px 0;
  font-size: 18px;
  font-weight: 500;
}

.aside-order.sidebar-v1 .skill2 .skill-count2 {
  right: 0;
}

/* --- Night mode --- */
.night-mode .aside-order.sidebar-v1 .full-width {
  background-color: #2a2f38 !important;
  border-color: #3d4654 !important;
}

.night-mode .aside-order.sidebar-v1 .username-main-dt h4 a,
.night-mode .aside-order.sidebar-v1 .all-info__left,
.night-mode .aside-order.sidebar-v1 a.all-info__left {
  color: #e2e8f0 !important;
}

.night-mode .aside-order.sidebar-v1 .all-info__right {
  color: var(--sv1-accent) !important;
}

.night-mode .aside-order.sidebar-v1 .all-info__sections a:hover {
  background-color: rgba(0, 80, 122, 0.35);
}

.night-mode .aside-order.sidebar-v1 .profile-link a {
  border-color: var(--sv1-accent);
  color: var(--sv1-accent) !important;
}

.night-mode .aside-order.sidebar-v1 hr {
  border-top-color: #3d4654;
}

.night-mode .aside-order.sidebar-v1 .add-btn,
.night-mode .aside-order.sidebar-v1 .add-btn.request-btn {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: var(--sv1-accent) !important;
}

@media (min-width: 1200px) {
  .night-mode body:has(aside.sidebar-v1) .container > .row > main:not(.center_section_123) {
    scrollbar-color: #64748b #1e293b;
  }

  .night-mode
    body:has(aside.sidebar-v1)
    .container
    > .row
    > main:not(.center_section_123)::-webkit-scrollbar-thumb {
    background: #64748b;
  }
}
