/**
 * 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&family=Playfair+Display:wght@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 (mock-aligned) --- */
.aside-order.sidebar-v1 .sv1-card {
  position: relative;
  border-radius: 18px !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08) !important;
  border: 1px solid #e8edf2 !important;
  background: var(--sv1-white) !important;
  overflow: hidden;
  padding: 0 !important;
}

.aside-order.sidebar-v1 .sv1-card__hero {
  height: 92px;
  background-color: #0a0e14;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='120' viewBox='0 0 360 120' fill='none'%3E%3Cpath d='M-10 95 L95 8 L185 72 L290 5 L370 58' stroke='%235f86ad' stroke-width='0.8' opacity='0.32'/%3E%3Cpath d='M0 115 L115 35 L220 98 L360 22' stroke='%237a4f58' stroke-width='0.7' opacity='0.22'/%3E%3Cpath d='M145 0 L210 120' stroke='%234b6f94' stroke-width='0.65' opacity='0.2'/%3E%3Cpath d='M255 0 L180 120' stroke='%234b6f94' stroke-width='0.65' opacity='0.16'/%3E%3Ccircle cx='292' cy='26' r='46' stroke='%233b82f6' stroke-width='0.75' opacity='0.16'/%3E%3Ccircle cx='292' cy='26' r='24' stroke='%233b82f6' stroke-width='0.55' opacity='0.12'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 95% 85% at 8% 92%, rgba(107, 36, 48, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 80% 70% at 92% 8%, rgba(15, 23, 42, 0.55) 0%, transparent 52%),
    linear-gradient(
      128deg,
      #080b10 0%,
      #101620 24%,
      #162636 48%,
      #1d3d5c 72%,
      #255f86 100%
    );
  background-size: cover, cover, cover, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
}

.aside-order.sidebar-v1 .sv1-card__body {
  padding: 0 18px 20px;
  text-align: center;
}

.aside-order.sidebar-v1 .sv1-card__avatar-wrap {
  width: 92px;
  height: 92px;
  margin: -46px auto 14px;
  border-radius: 50%;
  border: 4px solid var(--sv1-white);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  background: linear-gradient(180deg, #3b82c4 0%, #8b4d45 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aside-order.sidebar-v1 .sv1-card__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aside-order.sidebar-v1 .sv1-card__avatar-initials {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1;
}

.aside-order.sidebar-v1 .sv1-card__name {
  margin: 0 0 6px;
  font-family: 'Fraunces', serif !important; 
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.aside-order.sidebar-v1 .sv1-card__name a {
  color: #111827 !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
  font-family: 'Fraunces', serif !important; 
}

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

.aside-order.sidebar-v1 .sv1-card__subtitle {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.45;
}

.aside-order.sidebar-v1 .sv1-card__location {
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #6b7280;
}

.aside-order.sidebar-v1 .sv1-card__location i {
  font-size: 0.72rem;
  color: #9ca3af;
}

.aside-order.sidebar-v1 .sv1-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #eceff3;
  border-bottom: 1px solid #eceff3;
  margin: 0 -18px 6px;
  padding: 14px 0;
}

.aside-order.sidebar-v1 .sv1-card__stat {
  position: relative;
  padding: 0 8px;
}

.aside-order.sidebar-v1 .sv1-card__stat:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: #eceff3;
}

.aside-order.sidebar-v1 .sv1-card__stat-value {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}

.aside-order.sidebar-v1 .sv1-card__stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

.aside-order.sidebar-v1 .sv1-card__nav {
  text-align: left;
  padding-top: 8px;
}

.aside-order.sidebar-v1 .sv1-card__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aside-order.sidebar-v1 .sv1-card__nav-list li + li {
  margin-top: 2px;
}

.aside-order.sidebar-v1 .sv1-card__nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-radius: 10px;
  color: #374151 !important;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.aside-order.sidebar-v1 .sv1-card__nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: #9ca3af;
  flex-shrink: 0;
}

.aside-order.sidebar-v1 .sv1-card__nav-link span:not(.sv1-card__nav-badge) {
  flex: 1;
  min-width: 0;
}

.aside-order.sidebar-v1 .sv1-card__nav-link:hover {
  background: #f3f8fc;
  color: var(--sv1-primary) !important;
}

.aside-order.sidebar-v1 .sv1-card__nav-link:hover i {
  color: var(--sv1-primary);
}

.aside-order.sidebar-v1 .sv1-card__nav-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aside-order.sidebar-v1 .sv1-card__cta {
  padding: 16px 4px 4px;
}

.aside-order.sidebar-v1 .sv1-card__cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b82c4 0%, #2f6fad 100%);
  color: #fff !important;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 6px 18px rgba(47, 111, 173, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.aside-order.sidebar-v1 .sv1-card__cta-btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 8px 22px rgba(47, 111, 173, 0.34);
  transform: translateY(-1px);
  color: #fff !important;
}

/* --- Profile card shell (legacy explore panel) --- */
.aside-order.sidebar-v1 .full-width:not(.sv1-card) {
  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(210vh - 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(200vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    padding: 10px 10px;
  }

  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:not(.sv1-card) {
  background-color: #2a2f38 !important;
  border-color: #3d4654 !important;
}

.night-mode .aside-order.sidebar-v1 .sv1-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

.night-mode .aside-order.sidebar-v1 .sv1-card__name a,
.night-mode .aside-order.sidebar-v1 .sv1-card__nav-link {
  color: #e2e8f0 !important;
}

.night-mode .aside-order.sidebar-v1 .sv1-card__subtitle,
.night-mode .aside-order.sidebar-v1 .sv1-card__location,
.night-mode .aside-order.sidebar-v1 .sv1-card__stat-label {
  color: #94a3b8 !important;
}

.night-mode .aside-order.sidebar-v1 .sv1-card__stat-value {
  color: #f8fafc !important;
}

.night-mode .aside-order.sidebar-v1 .sv1-card__stats {
  border-color: #334155;
}

.night-mode .aside-order.sidebar-v1 .sv1-card__stat:not(:last-child)::after {
  background: #334155;
}

.night-mode .aside-order.sidebar-v1 .sv1-card__nav-link:hover {
  background: rgba(59, 130, 246, 0.12);
}

.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;
  }
}
