/* ==========================================================================
   Stefan Buchholz Modern - Omnipresent Tester Feedback (Orange Theme)
   Featuring Borat Toggle & Instant Viewport Snapshot Capture
   ========================================================================== */

:root {
  --sb-tester-orange: #ff6b00;
  --sb-tester-orange-glow: rgba(255, 107, 0, 0.45);
  --sb-tester-orange-light: #ff8533;
  --sb-tester-orange-dark: #cc5500;
  --sb-tester-bg: rgba(18, 18, 22, 0.94);
  --sb-tester-border: rgba(255, 107, 0, 0.35);
  --sb-tester-text: #ffffff;
  --sb-tester-text-dim: #9ca3af;
}

/* Floating Omnipresent Toggle Container */
.sb-tester-widget-wrap {
  position: fixed;
  top: clamp(130px, 36vh, 380px);
  bottom: auto;
  right: 22px;
  z-index: 9995;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.sb-tester-widget-wrap * {
  box-sizing: border-box;
}

/* Toggle Trigger Button */
.sb-tester-toggle-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--sb-tester-bg);
  border: 1.5px solid var(--sb-tester-border);
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 16px var(--sb-tester-orange-glow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.sb-tester-toggle-btn:hover {
  border-color: var(--sb-tester-orange);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 24px rgba(255, 107, 0, 0.65);
}

.sb-tester-toggle-btn:active {
  transform: translateY(0) scale(0.98);
}

.sb-tester-widget-wrap.is-expanded .sb-tester-toggle-btn {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

/* Borat Toggle Avatar Frame */
.sb-tester-avatar-frame {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--sb-tester-orange);
  background: #000;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--sb-tester-orange-glow);
}

.sb-tester-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  transition: transform 0.22s ease;
}

.sb-tester-avatar-frame .img-collapsed {
  opacity: 1;
  transform: scale(1);
}

.sb-tester-toggle-btn:hover .sb-tester-avatar-frame img {
  transform: scale(1.08);
}

/* Label & Status Pill */
.sb-tester-toggle-meta {
  display: flex;
  align-items: center;
  text-align: left;
}

.sb-tester-toggle-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.sb-tester-pulsing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sb-tester-orange);
  box-shadow: 0 0 8px var(--sb-tester-orange);
  animation: sbTesterPulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes sbTesterPulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.sb-tester-toggle-sub {
  display: none !important;
}

/* Expandable Drawer Panel */
.sb-tester-panel {
  pointer-events: auto;
  position: fixed;
  top: 50%;
  right: 22px;
  bottom: auto;
  width: 410px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--sb-tester-bg);
  border: 1.5px solid var(--sb-tester-border);
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 32px rgba(255, 107, 0, 0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 20px;
  color: var(--sb-tester-text);
  display: none;
  opacity: 0;
  transform: translateY(-50%) scale(0.97);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sb-tester-widget-wrap.is-expanded .sb-tester-panel {
  display: block;
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Custom Scrollbar for Panel */
.sb-tester-panel::-webkit-scrollbar {
  width: 6px;
}
.sb-tester-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 0, 0.4);
  border-radius: 3px;
}

/* Panel Header */
.sb-tester-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-tester-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-tester-header-img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--sb-tester-orange);
  box-shadow: 0 0 10px var(--sb-tester-orange-glow);
}

.sb-tester-header-text h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  text-transform: uppercase;
}

.sb-tester-header-text p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: var(--sb-tester-orange-light);
  font-weight: 600;
}

.sb-tester-btn-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #bbb;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s ease;
}

.sb-tester-btn-close:hover {
  background: rgba(255, 107, 0, 0.2);
  color: #fff;
  border-color: var(--sb-tester-orange);
}

/* Category Pills Selector */
.sb-tester-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--sb-tester-text-dim);
  margin-bottom: 7px;
}

.sb-tester-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.sb-tester-cat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ddd;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sb-tester-cat-pill:hover {
  border-color: var(--sb-tester-orange);
  color: #fff;
}

.sb-tester-cat-pill.active {
  background: rgba(255, 107, 0, 0.2);
  border-color: var(--sb-tester-orange);
  color: #ff9d42;
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
}

/* Feedback Textarea */
.sb-tester-textarea {
  width: 100%;
  min-height: 84px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}

.sb-tester-textarea:focus {
  border-color: var(--sb-tester-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.2);
}

/* Snapshot Preview Box */
.sb-tester-snapshot-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 107, 0, 0.4);
  border-radius: 12px;
  padding: 14px 12px 12px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.sb-tester-thumb-wrap {
  width: 138px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #0d1117;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sb-tester-thumb-wrap:hover {
  transform: scale(1.05);
  border-color: var(--sb-tester-orange);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 14px var(--sb-tester-orange-glow);
}

.sb-tester-thumb-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sb-tester-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sb-tester-orange);
  font-size: 22px;
  background: rgba(255, 107, 0, 0.08);
}

.sb-tester-snapshot-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sb-tester-snapshot-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.sb-tester-snapshot-sub {
  font-size: 10.5px;
  color: var(--sb-tester-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  text-align: center;
}

/* Hide header on success screen */
.sb-tester-panel.is-success .sb-tester-header {
  display: none;
}

.sb-tester-panel.is-fading-out {
  opacity: 0 !important;
  transform: translateY(-50%) scale(0.92) !important;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Submit Action Button */
.sb-tester-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--sb-tester-orange-light);
  background: linear-gradient(135deg, #ff6b00 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.sb-tester-submit-btn:hover {
  background: linear-gradient(135deg, #ff7a1a 0%, #f97316 100%);
  box-shadow: 0 6px 22px rgba(255, 107, 0, 0.55);
  transform: translateY(-1px);
}

.sb-tester-submit-btn:active {
  transform: translateY(1px);
}

.sb-tester-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Success Card */
.sb-tester-success-view {
  display: none;
  text-align: center;
  padding: 30px 15px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sb-tester-success-view.show {
  display: flex;
}

.sb-tester-success-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sb-tester-orange);
  box-shadow: 0 0 20px var(--sb-tester-orange-glow);
  margin-bottom: 12px;
}

.sb-tester-success-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px 0;
  letter-spacing: 0.5px;
}

.sb-tester-success-sub {
  font-size: 12.5px;
  color: var(--sb-tester-text-dim);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

/* Lightbox Modal for Snapshot Inspection */
.sb-tester-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sb-tester-lightbox.active {
  display: flex;
}

.sb-tester-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 107, 0, 0.3);
  border: 1px solid var(--sb-tester-orange);
}

.sb-tester-lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.sb-tester-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sb-tester-lightbox-close:hover {
  background: var(--sb-tester-orange);
  border-color: #fff;
}

/* Responsive adjustments for mobile & small screens */
@media (max-width: 768px) {
  .sb-tester-widget-wrap {
    top: clamp(100px, 30vh, 260px);
    right: 14px;
  }
  .sb-tester-panel {
    right: 16px;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    padding: 16px;
  }
}

