/* ═══════════════════════════════════════════════════════════════════
   Virowatch Style GUI — v3.0
   Right-side panel, matches sidebar.css glass aesthetic exactly
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Panel (right-side drawer, mirrors left sidebar) ──────────────── */
#styleGuiOverlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  padding: 24px 0 0;
  /* ... existing code ... */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother curve */
  will-change: transform; /* Hardware acceleration */
  z-index: 1000; /* Ensure it stays above the other sidebar */
}

#styleGuiOverlay.sg-active {
  transform: translateX(0);
}

/* ─── Modal wrapper ─────────────────────────────────────────────────── */
.sg-modal {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ─── Header ────────────────────────────────────────────────────────── */
.sg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
  flex-shrink: 0;
}

.sg-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sg-header-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.8;
}

.sg-header-title {
  font-family: 'Kanit', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.sg-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.sg-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ─── Search ────────────────────────────────────────────────────────── */
.sg-toolbar {
  padding: 0 16px 14px;
  flex-shrink: 0;
}

.sg-search-wrap {
  position: relative;
}

.sg-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.sg-search {
  width: 100%;
  padding: 10px 12px 10px 34px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.95);
  font-family: 'Kanit', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  outline: none;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.sg-search::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.sg-search:focus {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

/* No tags/filters */
.sg-filters { display: none; }

/* ─── Scrollable style list ─────────────────────────────────────────── */
.sg-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sg-grid::-webkit-scrollbar { width: 4px; }
.sg-grid::-webkit-scrollbar-track { background: transparent; }
.sg-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.sg-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Empty state */
.sg-empty {
  padding: 40px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-family: 'Kanit', sans-serif;
  font-size: 0.82rem;
  font-weight: 300;
}

/* ─── Card — clean row, no image ───────────────────────────────────── */
.sg-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: default;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.sg-card:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.sg-card--active {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

/* Hide thumbnail entirely */
.sg-card-thumb { display: none; }
.sg-hover-hint { display: none; }
.sg-active-pill { display: none; }

/* Card body */
.sg-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sg-card-name {
  font-family: 'Kanit', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* "Active" label inline with name */
.sg-card--active .sg-card-name::after {
  content: 'Active';
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.sg-card-desc {
  font-family: 'Kanit', sans-serif;
  font-size: 0.74rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.4;
}

/* Hide tags */
.sg-card-tags { display: none; }

/* Action buttons */
.sg-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.sg-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.sg-btn:active { transform: scale(0.97); }

.sg-btn-apply {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

.sg-btn-apply:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.sg-btn-download {
  flex: 0 0 auto;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.4);
}

.sg-btn-download:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
}

/* ─── Footer — hidden ────────────────────────────────────────────────── */
.sg-footer { display: none; }

/* ─── Toast ──────────────────────────────────────────────────────────── */
.sg-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 20, 20, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Kanit', sans-serif;
  font-size: 0.8rem;
  font-weight: 300;
  padding: 8px 20px;
  border-radius: 99px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.sg-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sg-toast--error {
  border-color: rgba(255, 80, 80, 0.3);
  color: rgba(255, 130, 130, 0.9);
}

/* ─── Sidebar "Open Style GUI" button ───────────────────────────────── */
.app-sidebar-style-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.app-sidebar-style-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-sidebar-style-icon { font-size: 1rem; }
.app-sidebar-style-text { font-family: 'Kanit', sans-serif; font-size: 0.9rem; }

/* Hide legacy elements */
.app-sidebar-style-preview-overlay,
.app-sidebar-style-preview-panel,
.app-sidebar-style-loading { display: none !important; }
