/* ============================================================
   SCO Similar Posts — Drawer Tab Design
   ============================================================ */

/* ---- Arrow Tab ---- */
#sco-drawer-tab {
  position: fixed;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 56px;
  background: #1e293b;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border: none;
  outline: none;
  opacity: 0;
  transition: opacity .3s ease, background .2s ease, transform .2s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Right side */
#sco-drawer-tab.sco-tab--right {
  right: 0;
  border-radius: 8px 0 0 8px;
}

/* Left side */
#sco-drawer-tab.sco-tab--left {
  left: 0;
  border-radius: 0 8px 8px 0;
}

#sco-drawer-tab.sco-tab--visible {
  opacity: 1;
}

#sco-drawer-tab:hover {
  background: #334155;
  width: 34px;
}

/* ---- Drawer Panel ---- */
#sco-drawer {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99999;
  width: 280px;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity .25s ease, transform .25s ease;
  opacity: 0;
  pointer-events: none;
}

/* Right side — starts off-screen right */
#sco-drawer.sco-drawer--right {
  right: 36px; /* just past the tab */
  transform: translateY(-50%) translateX(20px);
}

/* Left side — starts off-screen left */
#sco-drawer.sco-drawer--left {
  left: 36px;
  transform: translateY(-50%) translateX(-20px);
}

/* Open state */
#sco-drawer.sco-drawer--open {
  opacity: 1;
  pointer-events: all;
}
#sco-drawer.sco-drawer--right.sco-drawer--open {
  transform: translateY(-50%) translateX(0);
}
#sco-drawer.sco-drawer--left.sco-drawer--open {
  transform: translateY(-50%) translateX(0);
}

/* ---- Header ---- */
.sco-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  flex-shrink: 0;
}

.sco-drawer-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #475569;
}

.sco-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.sco-drawer-close:hover {
  color: #334155;
  background: #e2e8f0;
}

/* ---- Body ---- */
.sco-drawer-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

/* ---- Loading ---- */
.sco-drawer-loading {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.sco-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: sco-spin .7s linear infinite;
}

@keyframes sco-spin {
  to { transform: rotate(360deg); }
}

/* ---- Post List ---- */
.sco-drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sco-drawer-item {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #f1f5f9;
}
.sco-drawer-item:last-child { border-bottom: none; }

.sco-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: #1e293b;
  transition: background .15s;
}
.sco-drawer-link:hover {
  background: #f8fafc;
  color: #4f46e5;
}

.sco-drawer-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}

.sco-drawer-thumb--placeholder {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.sco-drawer-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  #sco-drawer {
    width: 240px;
  }
  #sco-drawer-tab {
    width: 24px;
    height: 48px;
    font-size: 13px;
  }
  .sco-drawer-thumb {
    width: 44px;
    height: 44px;
  }
  .sco-drawer-title {
    font-size: 12px;
  }
}
