/* vr-tray.css — layout only; all colour/theme rules live in site.css */

/* Hidden attribute always wins */
.vr-tray[hidden],
.vr-tray-backdrop[hidden] { display: none !important; }


/* =========================================================
   BACKDROP
   ========================================================= */
.vr-tray-backdrop {
  position: fixed;
  inset: 0;
  background: var(--vr-overlay, rgba(0,0,0,0.45));
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 9998;
}

.vr-tray-backdrop.is-open { opacity: 1; }


/* =========================================================
   TRAY SHELL
   ========================================================= */
.vr-tray {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 92vw);
  background: var(--vr-tray-bg);
  border-left: 1px solid var(--vr-border);
  box-shadow: var(--vr-shadow-lg);
  transform: translateX(105%);
  transition: transform 220ms ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  color: var(--vr-text);
}

.vr-tray.is-open { transform: translateX(0); }


/* =========================================================
   TRAY HEADER
   ========================================================= */
.vr-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--vr-border);
  flex-shrink: 0;
}

.vr-tray-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.vr-tray-close {
  border: 1px solid var(--vr-border);
  border-radius: 12px;
  padding: 8px 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--vr-shadow-xs);
}

.vr-tray-close:hover {
  border-color: var(--vr-border-strong);
  background: var(--vr-surface-subtle-hover);
}


/* =========================================================
   TRAY BODY
   ========================================================= */
.vr-tray-body {
  padding: 16px;
  overflow: auto;
  flex: 1 1 auto;
}

.vr-tray-body .vr-card { margin: 0; }


/* =========================================================
   TRAY INPUTS
   ========================================================= */
.vr-tray .vr-input,
.vr-tray input[type="text"],
.vr-tray input[type="email"],
.vr-tray input[type="number"],
.vr-tray textarea,
.vr-tray select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--vr-control-border, var(--vr-border));
  background: var(--vr-control-bg, var(--vr-surface-subtle));
  color: var(--vr-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vr-tray input:focus,
.vr-tray textarea:focus,
.vr-tray select:focus {
  border-color: var(--vr-control-border-focus, rgba(108,99,255,0.70));
  box-shadow: 0 0 0 3px rgba(108,99,255,0.16);
  outline: none;
}

.vr-tray textarea { min-height: 96px; resize: vertical; }
.vr-tray .hint,
.vr-tray .help,
.vr-tray small { opacity: 0.85; }


/* =========================================================
   TRAY CARD GRID
   ========================================================= */
.vr-tray-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

@media (max-width: 980px) {
  .vr-tray-card-grid { grid-template-columns: 1fr; }
}

.vr-tray-card {
  text-align: left;
  border: 1px solid var(--vr-border);
  border-radius: 18px;
  padding: 18px;
  background: var(--vr-surface-subtle);
  backdrop-filter: blur(8px);
  cursor: pointer;
  color: inherit;
  box-shadow: var(--vr-shadow-xs);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vr-tray-card:hover {
  border-color: var(--vr-border-strong);
  background: var(--vr-surface-subtle-hover);
  box-shadow: var(--vr-shadow-sm);
}

html[data-theme="light"] .vr-tray-card {
  background: #ffffff;
  border-color: var(--vr-border);
  box-shadow: var(--vr-shadow-xs);
}

html[data-theme="light"] .vr-tray-card:hover {
  border-color: rgba(108,99,255,0.25);
  background: #f8f7ff;
  box-shadow: var(--vr-shadow-sm);
}

.vr-tray-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.vr-tray-card-subtitle {
  margin-top: 6px;
  opacity: 0.85;
  font-size: 0.95rem;
}

.vr-tray-card-cta {
  margin-top: 14px;
  display: inline-block;
  font-weight: 700;
  opacity: 0.9;
}

.vr-tray-hint { margin-top: 6px; }


/* =========================================================
   TRAY PANEL PARKING (off-screen when closed)
   ========================================================= */
.vr-tray-panels {
  position: absolute;
  left: -99999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* =========================================================
   LONG VALUE WRAPPING
   ========================================================= */
.vr-data-value,
.vr-data-key {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

#vrTrayBody pre,
#vrTrayBody code,
#vrTrayBody .vr-data-key,
#vrTrayBody .vr-data-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#vrTrayBody .vr-data-row { max-width: 100%; }
