/**
 * VSR Premium Sidebar
 * Fixed right-side panel with collapsible tab
 */

/* ── Host wrapper ─────────────────────────────────────────────────── */
.vsr-psb {
  position: fixed;
  right: 0;
  top: 0;        /* overridden by JS to sit below WP admin bar */
  height: 100vh; /* overridden by JS */
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  pointer-events: none;
}

/* ── Shared transition ────────────────────────────────────────────── */
.vsr-psb:not(.vsr-psb--instant) .vsr-psb-tab,
.vsr-psb:not(.vsr-psb--instant) .vsr-psb-panel {
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity  0.28s ease;
}

/* ── Collapsed TAB ────────────────────────────────────────────────── */
.vsr-psb-tab {
  pointer-events: auto;
  position: absolute;
  right: 0;
  top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 12px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #fff;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  box-shadow: -2px 2px 12px rgba(217, 119, 6, 0.35);
  user-select: none;
  transform: translateX(0);
  opacity: 1;
}

.vsr-psb-tab:hover {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  box-shadow: -3px 3px 16px rgba(217, 119, 6, 0.45);
}

.vsr-psb-tab svg {
  flex-shrink: 0;
  opacity: 0.95;
}

.vsr-psb-tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
}

/* When panel is open → hide the tab */
.vsr-psb:not(.vsr-psb--collapsed) .vsr-psb-tab {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

/* ── PANEL ────────────────────────────────────────────────────────── */
.vsr-psb-panel {
  pointer-events: auto;
  position: relative;
  width: 248px;
  height: 100%;
  max-height: 100%;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.09);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(0);
  opacity: 1;
}

/* Collapsed → slide fully off screen */
.vsr-psb--collapsed .vsr-psb-panel {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

/* ── Panel header ─────────────────────────────────────────────────── */
.vsr-psb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #fffdf7, #fff);
  border-bottom: 1px solid #fde68a;
  flex-shrink: 0;
}

.vsr-psb-head-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
}

.vsr-psb-head-brand svg {
  color: #d97706;
  flex-shrink: 0;
}

.vsr-psb-head-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.vsr-psb-head-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* ── Intro (eyebrow + headline) ───────────────────────────────────── */
.vsr-psb-intro {
  padding: 14px 14px 10px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  border-bottom: 1px solid #fef3c7;
}

.vsr-psb-eyebrow {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.vsr-psb-headline {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  color: #111827;
}

/* ── Feature list ─────────────────────────────────────────────────── */
.vsr-psb-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.vsr-psb-list::-webkit-scrollbar { width: 4px; }
.vsr-psb-list::-webkit-scrollbar-track { background: transparent; }
.vsr-psb-list::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

/* Each feature row */
.vsr-psb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.vsr-psb-item:hover {
  background: #fffbeb;
}

.vsr-psb-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
}

.vsr-psb-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.vsr-psb-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vsr-psb-item-sub {
  font-size: 10.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vsr-psb-item-lock {
  flex-shrink: 0;
  color: #d1d5db;
}

.vsr-psb-item:hover .vsr-psb-item-lock {
  color: #f59e0b;
}

/* ── "More features" link ─────────────────────────────────────────── */
.vsr-psb-more-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-top: 1px dashed #e5e7eb;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}

.vsr-psb-more-link:hover {
  color: #d97706;
  background: #fffbeb;
}

/* ── CTA area ─────────────────────────────────────────────────────── */
.vsr-psb-cta-area {
  padding: 12px 14px 14px;
  border-top: 1px solid #f3f4f6;
  background: #fafaf8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.vsr-psb-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3),
              inset 0 1px 0 rgba(255,255,255,0.2);
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.vsr-psb-cta-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.38),
              inset 0 1px 0 rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
}

.vsr-psb-cta-details {
  display: block;
  width: 100%;
  padding: 6px;
  border: none;
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  text-align: center;
  transition: color 0.12s;
}

.vsr-psb-cta-details:hover {
  color: #d97706;
}

.vsr-psb-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  font-size: 10.5px;
  color: #9ca3af;
}

.vsr-psb-guarantee svg {
  flex-shrink: 0;
  color: #10b981;
}

/* ── Body margin transition ───────────────────────────────────────────
   Smoothly pushes the entire page content left when the sidebar opens.
   The JS sets body margin-right; transition handles animation.
   ──────────────────────────────────────────────────────────────────── */
body {
  transition: margin-right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── WP admin bar offset ─────────────────────────────────────────────
   When the WP admin bar is shown (body has class admin-bar) the bar
   is 32px tall (46px on mobile). The JS already reads the nav's
   getBoundingClientRect so this is only needed if JS is slow / fails.
   ──────────────────────────────────────────────────────────────────── */
@media screen and (max-width: 782px) {
  .vsr-psb-panel {
    width: 220px;
  }
}

/* ── Narrow screens: hide sidebar entirely below 600px ───────────── */
@media screen and (max-width: 600px) {
  .vsr-psb {
    display: none;
  }
}
