/* Hero preview — mirrors real HyperX Tweaks Home screen */
.app-preview {
  --hx-scale: 1.2;
  --hx-primary: #e2e5ec;
  --hx-glow: rgba(226, 229, 236, 0.35);
  --hx-border: rgba(255, 255, 255, 0.08);
  --hx-line: rgba(255, 255, 255, 0.06);
  --hx-green: #22c55e;
  --hx-card: linear-gradient(155deg, rgba(26, 28, 32, 0.98), rgba(14, 16, 19, 0.98));
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(460px * var(--hx-scale));
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #101215 0%, #090b0e 58%, #111316 100%);
  border: 1px solid rgba(226, 229, 236, 0.1);
  pointer-events: none;
  user-select: none;
  color: #fff;
  text-align: left;
  font-family: "Inter", system-ui, sans-serif;
  font-size: calc(11px * var(--hx-scale));
}

.app-preview-shell {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
  z-index: 2;
}

/* Sidebar (app navigation) */
.app-preview-sidebar {
  width: calc(132px * var(--hx-scale));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: calc(12px * var(--hx-scale)) 0 calc(10px * var(--hx-scale));
  border-right: 1px solid var(--hx-border);
  background: linear-gradient(180deg, rgba(17, 20, 24, 0.98), rgba(9, 11, 14, 0.98));
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
}

.app-preview-logo-wrap {
  padding: 4px 12px 12px;
}

.app-preview-logo {
  width: calc(48px * var(--hx-scale));
  height: auto;
  display: block;
  margin-left: 4px;
  filter: drop-shadow(0 0 10px var(--hx-glow));
}

.app-preview-logo-tag {
  display: block;
  margin: 6px 0 0 5px;
  font-size: calc(6px * var(--hx-scale));
  font-weight: 700;
  letter-spacing: 1.4px;
  color: rgba(226, 229, 236, 0.42);
}

.app-preview-nav-section {
  flex: 1;
  padding: 0 8px;
  overflow: hidden;
}

.app-preview-nav-group {
  margin-bottom: 12px;
}

.app-preview-nav-group-title {
  padding: 0 6px 5px;
  font-size: calc(6.5px * var(--hx-scale));
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(226, 229, 236, 0.38);
}

.app-preview-nav-item {
  display: flex;
  align-items: center;
  gap: calc(7px * var(--hx-scale));
  min-height: calc(32px * var(--hx-scale));
  margin: 3px 0;
  padding: 0 calc(9px * var(--hx-scale));
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: calc(8px * var(--hx-scale));
  font-weight: 600;
  color: rgba(226, 229, 236, 0.58);
  position: relative;
}

.app-preview-nav-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.app-preview-nav-item.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(226, 229, 236, 0.14), rgba(226, 229, 236, 0.05));
  border-color: rgba(226, 229, 236, 0.1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.app-preview-nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 0 3px 3px 0;
  background: var(--hx-primary);
  box-shadow: 0 0 8px var(--hx-glow);
}

.app-preview-nav-item.active .app-preview-nav-icon {
  color: var(--hx-primary);
}

.app-preview-user {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 6px 8px 0;
  padding: 7px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(226, 229, 236, 0.045);
}

.app-preview-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--hx-primary);
  color: #101215;
  font-size: calc(10px * var(--hx-scale));
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-preview-user-name {
  font-size: calc(8px * var(--hx-scale));
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main column */
.app-preview-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-preview-titlebar {
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  border-bottom: 1px solid var(--hx-line);
  background: rgba(11, 13, 16, 0.78);
}

.app-preview-titlebar-controls {
  display: flex;
  gap: 5px;
}

.app-preview-titlebar-btn {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(12px * var(--hx-scale));
  color: #666;
  background: transparent;
}

.app-preview-titlebar-btn.close {
  color: #888;
}

.app-preview-content {
  flex: 1;
  padding: calc(12px * var(--hx-scale)) calc(16px * var(--hx-scale)) calc(14px * var(--hx-scale));
  overflow: hidden;
}

/* Home grid — matches in-app layout */
.app-preview-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 0.48fr);
  grid-template-rows: auto auto auto;
  gap: calc(11px * var(--hx-scale));
  align-items: stretch;
}

.app-preview-welcome {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  padding: calc(8px * var(--hx-scale)) 0 calc(6px * var(--hx-scale)) calc(12px * var(--hx-scale));
  border-left: 2px solid rgba(226, 229, 236, 0.55);
  min-height: calc(88px * var(--hx-scale));
}

.app-preview-welcome::before {
  content: "PERFORMANCE CONSOLE  /  HYPERX SERIES";
  display: block;
  margin-bottom: 6px;
  font-size: calc(6px * var(--hx-scale));
  font-weight: 750;
  letter-spacing: 1.2px;
  color: rgba(226, 229, 236, 0.5);
}

.app-preview-welcome::after {
  content: "HX";
  position: absolute;
  z-index: 0;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: calc(58px * var(--hx-scale));
  font-weight: 800;
  letter-spacing: -0.12em;
  line-height: 0.8;
  color: rgba(226, 229, 236, 0.05);
  pointer-events: none;
}

.app-preview-welcome-title {
  position: relative;
  z-index: 1;
  font-size: calc(15px * var(--hx-scale));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.4px;
  margin: 0;
}

.app-preview-welcome-title .premium {
  color: #fff;
  text-shadow: 0 0 16px rgba(226, 229, 236, 0.22);
}

.app-preview-welcome-sub {
  position: relative;
  z-index: 1;
  margin: 4px 0 0;
  font-size: calc(8px * var(--hx-scale));
  color: rgba(226, 229, 236, 0.58);
  line-height: 1.4;
}

.app-preview-current-profile {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  font-size: calc(7.5px * var(--hx-scale));
  color: rgba(226, 229, 236, 0.52);
}

.app-preview-current-profile strong {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: calc(7px * var(--hx-scale));
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #101215;
  background: var(--hx-primary);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.app-preview-profile-card {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  padding: calc(12px * var(--hx-scale));
  border-radius: calc(12px * var(--hx-scale));
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(150deg, rgba(25, 27, 31, 0.98), rgba(12, 14, 17, 0.98));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.035);
}

.app-preview-profile-card-title {
  font-size: calc(9px * var(--hx-scale));
  font-weight: 700;
  margin-bottom: 4px;
}

.app-preview-profile-card-desc {
  margin: 0 0 6px;
  font-size: calc(6.5px * var(--hx-scale));
  line-height: 1.45;
  color: rgba(226, 229, 236, 0.45);
}

.app-preview-profile-hw {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
  font-size: calc(7px * var(--hx-scale));
  border-top: 1px solid var(--hx-line);
}

.app-preview-profile-hw span:first-child {
  color: rgba(226, 229, 236, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: calc(6px * var(--hx-scale));
}

.app-preview-profile-setup {
  display: block;
  margin-top: 7px;
  padding: 5px;
  border-radius: 6px;
  text-align: center;
  font-size: calc(7px * var(--hx-scale));
  font-weight: 700;
  color: #101215;
  background: var(--hx-primary);
}

.app-preview-info-grid {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(10px * var(--hx-scale));
}

.app-preview-info-card {
  position: relative;
  padding: calc(11px * var(--hx-scale)) calc(12px * var(--hx-scale));
  border-radius: calc(11px * var(--hx-scale));
  border: 1px solid var(--hx-border);
  background: var(--hx-card);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14), inset 0 1px rgba(255, 255, 255, 0.03);
  min-height: calc(102px * var(--hx-scale));
}

.app-preview-info-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  width: 22px;
  height: 2px;
  background: rgba(226, 229, 236, 0.75);
  box-shadow: 0 0 8px rgba(226, 229, 236, 0.25);
}

.app-preview-info-title {
  margin-bottom: 8px;
  font-size: calc(7px * var(--hx-scale));
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(226, 229, 236, 0.62);
}

.app-preview-protection {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.app-preview-restore-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: calc(7.5px * var(--hx-scale));
  font-weight: 600;
  color: var(--hx-green);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.15);
}

.app-preview-restore-create .plus {
  font-size: calc(11px * var(--hx-scale));
  font-weight: 700;
}

.app-preview-restore-view {
  display: block;
  text-align: center;
  padding: 5px;
  border-radius: 6px;
  font-size: calc(7px * var(--hx-scale));
  font-weight: 500;
  color: var(--hx-primary);
  background: rgba(226, 229, 236, 0.08);
  border: 1px solid rgba(226, 229, 236, 0.2);
}

.app-preview-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 3px;
}

.app-preview-health-grid span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: calc(7px * var(--hx-scale));
  color: rgba(255, 255, 255, 0.72);
}

.app-preview-health-grid .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  font-style: normal;
}

.app-preview-health-grid .dot.green {
  background: var(--hx-green);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.55);
}

.app-preview-health-stats {
  display: flex;
  gap: 4px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.app-preview-health-stats div {
  flex: 1;
  text-align: center;
  padding: 4px 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.app-preview-health-stats b {
  display: block;
  font-size: calc(11px * var(--hx-scale));
  font-weight: 700;
  color: var(--hx-primary);
  letter-spacing: -0.3px;
}

.app-preview-health-stats small {
  font-size: calc(5.5px * var(--hx-scale));
  font-weight: 700;
  letter-spacing: 0.6px;
  color: rgba(226, 229, 236, 0.42);
}

.app-preview-spec {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: calc(7px * var(--hx-scale));
}

.app-preview-spec:last-child {
  border-bottom: 0;
}

.app-preview-spec span:first-child {
  color: rgba(226, 229, 236, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: calc(6px * var(--hx-scale));
}

.app-preview-spec span:last-child {
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
}

.app-preview-bottom {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: calc(10px * var(--hx-scale));
}

.app-preview-chart-section,
.app-preview-checklist {
  position: relative;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--hx-border);
  background: var(--hx-card);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14), inset 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.app-preview-chart-section::before,
.app-preview-checklist::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--hx-primary);
  box-shadow: 0 0 8px var(--hx-glow);
  opacity: 0.85;
}

.app-preview-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.app-preview-chart-name {
  font-size: calc(8px * var(--hx-scale));
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.app-preview-chart-tabs {
  display: flex;
  gap: 3px;
}

.app-preview-chart-tabs span {
  font-size: calc(6.5px * var(--hx-scale));
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  color: rgba(226, 229, 236, 0.35);
}

.app-preview-chart-tabs span.active {
  color: var(--hx-primary);
  background: rgba(226, 229, 236, 0.1);
}

.app-preview-chart-wrap {
  display: flex;
  gap: 5px;
  align-items: stretch;
}

.app-preview-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: calc(5.5px * var(--hx-scale));
  color: rgba(226, 229, 236, 0.28);
  padding: 2px 0;
}

.app-preview-chart-wrap canvas {
  flex: 1;
  width: 100% !important;
  height: calc(68px * var(--hx-scale)) !important;
  border-radius: 4px;
}

.app-preview-check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.app-preview-check-item span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-preview-check-item b {
  font-size: calc(7.5px * var(--hx-scale));
  font-weight: 600;
}

.app-preview-check-item small {
  font-size: calc(6px * var(--hx-scale));
  color: rgba(226, 229, 236, 0.38);
}

.app-preview-check-box {
  width: 12px;
  height: 13px;
  flex-shrink: 0;
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-preview-check-item.done .app-preview-check-box {
  border: none;
  background: var(--hx-green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}

.app-preview-check-item.done .app-preview-check-box::after {
  content: "✓";
  font-size: calc(8px * var(--hx-scale));
  font-weight: 700;
  color: #fff;
}

.app-preview-check-item.done b {
  text-decoration: line-through;
  color: rgba(226, 229, 236, 0.45);
}

.app-preview-check-progress {
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.app-preview-check-progress span {
  display: block;
  height: 100%;
  background: var(--hx-primary);
  box-shadow: 0 0 6px var(--hx-glow);
  border-radius: 2px;
}

.app-preview-check-status {
  margin-top: 4px;
  text-align: center;
  font-size: calc(6.5px * var(--hx-scale));
  color: rgba(226, 229, 236, 0.4);
}

.app-preview-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(226, 229, 236, 0.03) 50%,
    transparent 62%
  );
  animation: appPreviewShine 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes appPreviewShine {
  0% {
    transform: translateX(-35%);
  }
  100% {
    transform: translateX(35%);
  }
}

@media (max-width: 960px) {
  .app-preview {
    --hx-scale: 1;
    min-height: 380px;
  }

  .hero-home .container {
    width: min(var(--max), calc(100% - 40px));
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .app-preview-sidebar {
    width: 52px;
  }

  .app-preview-logo-tag,
  .app-preview-nav-group-title,
  .app-preview-nav-item,
  .app-preview-user-name {
    display: none;
  }

  .app-preview-nav-item.active {
    justify-content: center;
    padding: 6px;
  }

  .app-preview-home {
    grid-template-columns: 1fr;
  }

  .app-preview-profile-card {
    grid-column: 1;
    grid-row: 2;
  }

  .app-preview-info-grid {
    grid-row: 3;
  }

  .app-preview-bottom {
    grid-row: 4;
    grid-template-columns: 1fr;
  }
}
