/* ============================================================
   SarvTools — Quantum Chromatic CSS System
   Wide-Gamut Display P3 & Perceptually Uniform OKLCH Physics
   ============================================================ */

:root {
  --qc-transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                   background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                   border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Wide-Gamut Hardware Boost when Display P3 is supported */
@supports (color: color(display-p3 1 1 1)) {
  :root[data-gamut-p3="true"] {
    --accent: var(--qc-accent, color(display-p3 0.22 0.74 0.97));
    --accent-hover: var(--qc-accent, color(display-p3 0.15 0.78 1));
    --accent-soft: var(--qc-accent-soft, color(display-p3 0.22 0.74 0.97 / 0.16));
  }
}

/* Quantum Studio Modal & Overlay */
.quantum-studio-modal {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: rgba(4, 6, 12, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: qmFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qmFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.quantum-studio-card {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: var(--surface, #0d111a);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 40px var(--qc-accent-soft, rgba(56, 189, 248, 0.2));
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.quantum-studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.qsh-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qsh-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
}

.qsh-title h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.qsh-title p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.quantum-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quantum-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Gamut hardware badge */
.quantum-gamut-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.quantum-gamut-badge.is-p3 {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.quantum-gamut-badge.is-srgb {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.qgb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.quantum-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Sun sync row */
.quantum-sun-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.qss-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qss-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #f1f5f9;
}

.qss-status {
  font-size: 0.8rem;
  color: #f59e0b;
}

/* Presets grid */
.quantum-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 520px) {
  .quantum-preset-grid {
    grid-template-columns: 1fr;
  }
}

.quantum-preset-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.quantum-preset-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.quantum-preset-card.is-active {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--qc-accent, #38bdf8);
  box-shadow: 0 0 16px var(--qc-accent-soft, rgba(56, 189, 248, 0.2));
}

.qpc-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.qpc-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.qpc-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: #f8fafc;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.qpc-desc {
  font-size: 0.74rem;
  color: #64748b;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.quantum-studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
}
