/* ── Component: WebsitePreview side panel ──
 * Class prefix: sv-preview-
 */

/* ── Website Preview Panel ─────────────────────────────────────────────────── */

.sv-preview-panel {
  display: none;
  flex-direction: column;
  width: 45%;
  min-width: 340px;
  max-width: 800px;
  background: rgba(18, 18, 24, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sv-preview-panel.active {
  display: flex;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */

.sv-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 24, 32, 0.9);
  flex-shrink: 0;
}

.sv-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sv-preview-device-group {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 2px;
}

.sv-preview-device-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.sv-preview-device-btn:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

.sv-preview-device-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sv-preview-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sv-preview-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sv-preview-action-btn--publish {
  border-color: rgba(59, 130, 246, 0.4);
  color: rgb(96, 165, 250);
}

.sv-preview-action-btn--publish:hover {
  background: rgba(59, 130, 246, 0.15);
}

.sv-preview-action-btn--publish:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sv-preview-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-size: 16px;
  margin-left: 4px;
  transition: all 0.15s;
}

.sv-preview-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Iframe Container ─────────────────────────────────────────────────────── */

.sv-preview-iframe-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.3);
}

.sv-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  background: #fff;
  transition: width 0.3s ease;
}

.sv-preview-iframe--tablet {
  width: 768px;
  max-width: 100%;
}

.sv-preview-iframe--mobile {
  width: 375px;
  max-width: 100%;
}

/* ── Published URL Banner ────────────────────────────────────────────────── */

.sv-preview-published {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(34, 197, 94, 0.1);
  border-top: 1px solid rgba(34, 197, 94, 0.2);
  flex-shrink: 0;
}

.sv-preview-published-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.sv-preview-published-url {
  font-size: 12px;
  color: rgb(74, 222, 128);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sv-preview-published-url:hover {
  text-decoration: underline;
}

/* ── Website Card (in transcript) ─────────────────────────────────────────── */

.sv-website-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-top: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  cursor: default;
}

.sv-website-card-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.sv-website-card-info {
  flex: 1;
  min-width: 0;
}

.sv-website-card-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sv-website-card-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sv-website-card-published {
  width: 100%;
  padding: 6px 10px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.sv-website-card-published-url {
  font-size: 12px;
  color: rgb(74, 222, 128);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.sv-website-card-published-url:hover {
  text-decoration: underline;
}

.sv-website-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.sv-website-card-btn {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.sv-website-card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sv-website-card-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sv-website-card-btn--primary {
  border-color: rgba(59, 130, 246, 0.4);
  color: rgb(96, 165, 250);
}

.sv-website-card-btn--primary:hover {
  background: rgba(59, 130, 246, 0.15);
}

.sv-website-card-btn--publish {
  border-color: rgba(34, 197, 94, 0.4);
  color: rgb(74, 222, 128);
}

.sv-website-card-btn--publish:hover {
  background: rgba(34, 197, 94, 0.15);
}

/* ── Responsive: narrow screens — preview overlays full width ──────────── */

@media (max-width: 900px) {
  .sv-preview-panel.active {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    z-index: 200;
  }
}
