/* ==========================================================================
   Sonata Interactive UI Simulator Styles
   ========================================================================== */

:root {
  --sim-bg: rgba(11, 15, 23, 0.95);
  --sim-border: rgba(255, 255, 255, 0.12);
  --sim-card-bg: rgba(18, 24, 38, 0.72);
  --sim-card-border: rgba(255, 255, 255, 0.08);
  --sim-accent: var(--accent-purple, #c084fc);
  --sim-accent-glow: var(--accent-glow, rgba(192, 132, 252, 0.35));
  --sim-text: #f1f5f9;
  --sim-text-dim: #94a3b8;
  --sim-text-muted: #64748b;
  --sim-radius: 12px;
}

/* Modal Overlay Wrapper */
.sim-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 4, 8, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.sim-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Main Window Box */
.sim-window {
  width: 100%;
  max-width: 980px;
  height: 90vh;
  max-height: 840px;
  background: var(--sim-bg);
  border: 1px solid var(--sim-border);
  border-radius: 18px;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.85), 0 0 50px var(--sim-accent-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-modal-overlay.active .sim-window {
  transform: scale(1) translateY(0);
}

/* Window Titlebar Header */
.sim-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.4rem;
  background: rgba(8, 12, 18, 0.85);
  border-bottom: 1px solid var(--sim-border);
  user-select: none;
}

.sim-titlebar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sim-title-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
}

.sim-logo-tag {
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.sim-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #34d399;
}

.sim-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.sim-badge-theme {
  font-size: 0.72rem;
  color: var(--sim-text-dim);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-titlebar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sim-btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sim-text-dim);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.sim-btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sim-btn-close {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-btn-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Tabs Navigation Bar */
.sim-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem 0.65rem;
  background: rgba(10, 14, 22, 0.75);
  border-bottom: 1px solid var(--sim-border);
  overflow-x: auto;
  scrollbar-width: thin;
}

.sim-tabs-bar::-webkit-scrollbar {
  height: 4px;
}
.sim-tabs-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.sim-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--sim-text-dim);
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 500;
  text-transform: capitalize;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sim-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.sim-tab-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 12px var(--sim-accent-glow);
}

/* Subtabs Bar (Visible when active tab has subtabs) */
.sim-subtabs-bar {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.4rem;
  background: rgba(14, 19, 30, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sim-subtabs-bar.active {
  display: flex;
}

.sim-subtab-btn {
  background: transparent;
  border: none;
  color: var(--sim-text-muted);
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: capitalize;
  padding: 0.28rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sim-subtab-btn:hover {
  color: #ffffff;
}

.sim-subtab-btn.active {
  color: #ffffff;
  background: var(--sim-accent);
  color: #0b0f17;
  font-weight: 600;
  box-shadow: 0 0 10px var(--sim-accent-glow);
}

/* Main Viewport Body */
.sim-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 1.4rem;
  scrollbar-width: thin;
}

.sim-viewport::-webkit-scrollbar {
  width: 6px;
}
.sim-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

/* Tab Panels */
.sim-tab-panel {
  display: none;
  animation: simFade 0.22s ease;
}

.sim-tab-panel.active {
  display: block;
}

@keyframes simFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Two Column Grid */
.sim-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .sim-grid-two {
    grid-template-columns: 1fr;
  }
}

.sim-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Section Box Card */
.sim-card {
  background: var(--sim-card-bg);
  border: 1px solid var(--sim-card-border);
  border-radius: var(--sim-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sim-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.55rem;
  margin-bottom: 0.2rem;
}

.sim-card-title {
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.sim-card-subtitle {
  font-size: 0.72rem;
  color: var(--sim-text-muted);
}

/* Control Rows */
.sim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sim-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sim-text);
  white-space: nowrap;
}

.sim-label-sub {
  font-size: 0.72rem;
  color: var(--sim-text-muted);
  display: block;
}

/* Toggle Switch */
.sim-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

.sim-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sim-slider-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.14);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-slider-track:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #cbd5e1;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.sim-switch input:checked + .sim-slider-track {
  background-color: var(--sim-accent);
  box-shadow: 0 0 12px var(--sim-accent-glow);
}

.sim-switch input:checked + .sim-slider-track:before {
  transform: translateX(18px);
  background-color: #0b0f17;
}

/* Range Slider Control */
.sim-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.sim-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-value-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--sim-accent);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.sim-range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.sim-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--sim-accent);
  box-shadow: 0 0 8px var(--sim-accent-glow);
  cursor: pointer;
  transition: transform 0.1s;
}

.sim-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Keybind Button */
.sim-keybind-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--sim-text);
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-keybind-btn:hover {
  border-color: var(--sim-accent);
  color: #ffffff;
  box-shadow: 0 0 8px var(--sim-accent-glow);
}

.sim-keybind-btn.recording {
  background: var(--sim-accent);
  color: #0b0f17;
  border-color: #ffffff;
  animation: pulse-recording 0.7s infinite alternate;
}

@keyframes pulse-recording {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* Dropdown Select */
.sim-select {
  background-color: rgba(10, 14, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 1.8rem 0.35rem 0.65rem;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.sim-select:focus {
  border-color: var(--sim-accent);
}

.sim-select option {
  background-color: #0b0f19;
  color: #ffffff;
  padding: 6px 10px;
}

/* Color Picker */
.sim-color-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sim-color-picker {
  -webkit-appearance: none;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.sim-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.sim-color-picker::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

/* Multi-select Pills / Tags */
.sim-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sim-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sim-text-dim);
  font-size: 0.735rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.sim-pill:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sim-pill.active {
  background: rgba(192, 132, 252, 0.15);
  border-color: var(--sim-accent);
  color: #ffffff;
  box-shadow: 0 0 8px var(--sim-accent-glow);
}

/* Action Buttons (Load, Refresh, Join, etc.) */
.sim-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.sim-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.sim-action-btn.primary {
  background: var(--sim-accent);
  color: #0b0f17;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 0 12px var(--sim-accent-glow);
}

.sim-action-btn.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Configs and Lists */
.sim-list-box {
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sim-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sim-list-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

.sim-list-item.selected {
  background: rgba(192, 132, 252, 0.12);
  border-color: var(--sim-accent);
}

.sim-list-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: #ffffff;
}

.sim-list-meta {
  font-size: 0.7rem;
  color: var(--sim-accent);
  font-weight: 600;
}

/* Toast Notification inside Simulator */
.sim-toast {
  position: absolute;
  bottom: 1.25rem;
  right: 1.4rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--sim-accent);
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px var(--sim-accent-glow);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}

.sim-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Launch Button in Website */
.btn-launch-interactive {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.18), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(192, 132, 252, 0.4);
  padding: 0.42rem 1rem;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 18px var(--accent-glow);
  transition: all 0.25s var(--ease-smooth);
}

.btn-launch-interactive:hover {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.32), rgba(168, 85, 247, 0.2));
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5), 0 0 26px var(--accent-glow);
}

.sim-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sim-subpanel-visuals,
.sim-subpanel-world,
.sim-subpanel-misc,
.sim-subpanel-extras {
  display: none;
}

.sim-subpanel-visuals.active,
.sim-subpanel-world.active,
.sim-subpanel-misc.active,
.sim-subpanel-extras.active {
  display: block;
}

.btn-intro-interactive {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: #ffffff;
  background: rgba(192, 132, 252, 0.16);
  border: 1px solid rgba(192, 132, 252, 0.38);
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 15px var(--accent-glow);
  transition: all 0.25s var(--ease-smooth);
}

.btn-intro-interactive:hover {
  background: rgba(192, 132, 252, 0.28);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.45), 0 0 25px var(--accent-glow);
}

.nav-interactive-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  padding: 0.5rem 0.25rem;
}

.nav-interactive-btn:hover {
  color: #ffffff;
}

