/**
 * Finixcore – Left-Side Quote Preview Drawer
 * Slides in from the left with a branded header.
 */

/* =====================================================
   DRAWER TOGGLE BUTTON (fixed, left side)
   ===================================================== */

.fc-drawer-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 16px;
  background: var(--qc-color-primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--qc-radius-md) var(--qc-radius-md) 0;
  cursor: pointer;
  box-shadow: 4px 0 20px rgba(0,0,0,.18);
  transition: var(--qc-transition);
  writing-mode: vertical-rl;
  min-width: 40px;
}

.fc-drawer-toggle:hover {
  background: var(--qc-color-dark);
  padding-left: 14px;
}

.fc-drawer-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: horizontal-tb;
  margin-bottom: 4px;
}

.fc-drawer-toggle__label {
  font-family: var(--qc-font-heading);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fc-drawer-toggle__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  background: #fff;
  color: var(--qc-color-primary);
  border-radius: var(--qc-radius-full);
  font-family: var(--qc-font-heading);
  font-size: 0.6875rem;
  font-weight: 800;
  writing-mode: horizontal-tb;
  transition: var(--qc-transition);
  margin-top: 6px;
}

.fc-drawer-toggle:hover .fc-drawer-toggle__badge {
  background: var(--qc-color-secondary);
  color: var(--qc-color-dark);
}

/* Hide toggle when drawer is open */
.fc-drawer-open .fc-drawer-toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-100%);
}

/* =====================================================
   BACKDROP
   ===================================================== */

.fc-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1199;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fc-drawer-open .fc-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* =====================================================
   DRAWER PANEL
   ===================================================== */

.fc-drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 99999;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 6px 0 40px rgba(0, 0, 0, 0.22);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.fc-drawer-open .fc-drawer {
  transform: translateX(0);
}

/* ─── Header ────────────────────────────────────────── */

.fc-drawer__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  background: var(--qc-color-dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Decorative radial glow behind logo */
.fc-drawer__header::before {
  content: '';
  position: absolute;
  left: -30px;
  top: -30px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, color-mix(in srgb, var(--qc-color-primary) 30%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.fc-drawer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.fc-drawer__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  /* Remove the black background — use mix-blend-mode or filter */
  filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(10deg);
  /* This turns it orange-on-transparent */
}

.fc-drawer__brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fc-drawer__brand-name {
  font-family: var(--qc-font-heading);
  font-size: 1.0625rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: 0.02em;
}

.fc-drawer__brand-name span {
  color: var(--qc-color-primary);
}

.fc-drawer__brand-sub {
  font-size: 0.6875rem;
  color: rgba(255,255,255,.5);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fc-drawer__header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.fc-drawer__count-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--qc-color-primary);
  color: #fff;
  border-radius: var(--qc-radius-full);
  font-family: var(--qc-font-heading);
  font-size: 0.75rem;
  font-weight: 800;
}

.fc-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: var(--qc-radius-sm);
  color: #fff;
  cursor: pointer;
  transition: var(--qc-transition);
  flex-shrink: 0;
}

.fc-drawer__close:hover {
  background: rgba(255,255,255,.22);
  transform: rotate(90deg);
}

/* ─── Sub-header: action bar ────────────────────────── */

.fc-drawer__subheader {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--qc-color-neutral);
  border-bottom: 1px solid var(--qc-color-border);
  font-size: 0.8125rem;
}

.fc-drawer__subheader-label {
  color: var(--qc-color-text-light);
  font-weight: 600;
}

.fc-drawer__subheader-label strong {
  color: var(--qc-color-dark);
}

.fc-drawer__clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  color: #e53e3e;
  padding: 3px 8px;
  border-radius: var(--qc-radius-xs);
  transition: var(--qc-transition);
  font-family: var(--qc-font-heading);
}

.fc-drawer__clear-btn:hover {
  background: #fff5f5;
}

/* ─── Items List ─────────────────────────────────────── */

.fc-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.fc-drawer__items::-webkit-scrollbar {
  width: 4px;
}
.fc-drawer__items::-webkit-scrollbar-track {
  background: var(--qc-color-neutral);
}
.fc-drawer__items::-webkit-scrollbar-thumb {
  background: var(--qc-color-border);
  border-radius: 4px;
}
.fc-drawer__items::-webkit-scrollbar-thumb:hover {
  background: var(--qc-color-primary);
}

/* ─── Single Item Row ────────────────────────────────── */

.fc-drawer__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--qc-color-neutral);
  transition: background 0.15s;
  animation: fc-item-in 0.25s ease forwards;
}

@keyframes fc-item-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0);     }
}

.fc-drawer__item:hover {
  background: var(--qc-color-neutral);
}

.fc-drawer__item-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--qc-color-neutral);
  border-radius: var(--qc-radius-full);
  font-family: var(--qc-font-heading);
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--qc-color-text-light);
}

.fc-drawer__item-img {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--qc-radius-sm);
  overflow: hidden;
  background: var(--qc-color-neutral);
  border: 1px solid var(--qc-color-border);
}

.fc-drawer__item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fc-drawer__item-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--qc-color-border);
}

.fc-drawer__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fc-drawer__item-title {
  font-family: var(--qc-font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--qc-color-dark);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-drawer__item-cat {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--qc-color-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fc-drawer__item-remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: none;
  border: 1.5px solid transparent;
  border-radius: var(--qc-radius-sm);
  color: var(--qc-color-text-light);
  cursor: pointer;
  transition: var(--qc-transition);
}

.fc-drawer__item-remove:hover {
  border-color: #fca5a5;
  background: #fff5f5;
  color: #e53e3e;
}

/* ─── Empty State ─────────────────────────────────────── */

.fc-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  gap: 16px;
  height: 100%;
  min-height: 200px;
}

.fc-drawer__empty-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  opacity: 0.15;
  filter: grayscale(1);
}

.fc-drawer__empty-title {
  font-family: var(--qc-font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--qc-color-text-light);
}

.fc-drawer__empty-body {
  font-size: 0.875rem;
  color: var(--qc-color-text-light);
  line-height: 1.6;
  max-width: 240px;
}

/* ─── Footer ──────────────────────────────────────────── */

.fc-drawer__footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--qc-color-border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-drawer__footer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--qc-color-text-light);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--qc-color-neutral);
}

.fc-drawer__footer-summary strong {
  color: var(--qc-color-dark);
  font-family: var(--qc-font-heading);
}

.fc-drawer__cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  font-family: var(--qc-font-heading);
  font-size: 0.9375rem;
  font-weight: 800;
  color: #fff;
  background: var(--qc-color-primary);
  border: none;
  border-radius: var(--qc-radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--qc-transition);
  letter-spacing: 0.01em;
}

.fc-drawer__cta-btn:hover {
  background: var(--qc-color-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--qc-shadow-md);
}

.fc-drawer__browse-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--qc-font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--qc-color-primary);
  text-decoration: none;
  padding: 8px;
  border-radius: var(--qc-radius-sm);
  transition: var(--qc-transition);
  text-align: center;
}

.fc-drawer__browse-link:hover {
  background: var(--qc-color-neutral);
  color: var(--qc-color-dark);
}

/* ─── Powered-by strip ───────────────────────────────── */

.fc-drawer__powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  font-size: 0.6875rem;
  color: rgba(0,0,0,.3);
  letter-spacing: 0.04em;
}

.fc-drawer__powered img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.35;
}

/* =====================================================
   BODY SHIFT (push content right when drawer opens)
   ===================================================== */

body {
  transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optional: uncomment to push page content
.fc-drawer-open body {
  margin-left: min(400px, 92vw);
}
*/

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 480px) {
  .fc-drawer {
    width: 100vw;
    border-radius: 0;
  }

  .fc-drawer-toggle {
    padding: 10px 8px 12px;
    min-width: 34px;
  }

  .fc-drawer-toggle__label {
    font-size: 0.625rem;
  }
}

/* =====================================================
   PRINT – hide drawer entirely
   ===================================================== */

@media print {
  .fc-drawer,
  .fc-drawer-toggle,
  .fc-drawer-backdrop {
    display: none !important;
  }
}

/* =====================================================
   RIGHT-SIDE DRAWER VARIANT
   body.fc-drawer-right .fc-* overrides left-side defaults
   ===================================================== */

/* Toggle tab — right side */
body.fc-drawer-right .fc-drawer-toggle {
  left:  auto;
  right: 0;
  border-radius: var(--qc-radius-md) 0 0 var(--qc-radius-md);
  box-shadow: -4px 0 20px rgba(0,0,0,.18);
}
body.fc-drawer-right .fc-drawer-toggle:hover {
  padding-left:  10px;
  padding-right: 14px;
}

/* Drawer panel — slides from right */
body.fc-drawer-right .fc-drawer {
  left:      auto;
  right:     0;
  transform: translateX(100%);
  box-shadow: -6px 0 40px rgba(0,0,0,.22);
}
body.fc-drawer-right.fc-drawer-open .fc-drawer {
  transform: translateX(0);
}

/* Header glow moves to right side */
body.fc-drawer-right .fc-drawer__header::before {
  left:  auto;
  right: -30px;
}

/* Hide toggle when open — right variant */
body.fc-drawer-right.fc-drawer-open .fc-drawer-toggle {
  transform: translateY(-50%) translateX(100%);
}
