/* ==========================================================================
   imgeditr — Unified Dark Studio Stylesheet
   Shared across Homepage (index.php), Image Editor (image-editor.php),
   Site Layout CAD (cad.php), Privacy Policy (privacy.html) & Terms (terms.html)
   ========================================================================== */

:root {
  --bg-canvas: #0e1013;
  --bg-viewport: #14161a;
  --bg-panel: #181a1f;
  --bg-surface: #21242b;
  --border-color: #2c3038;
  --border-hover: #3f4552;
  --brand: #3b82f6;
  --brand-hover: #2563eb;
  --brand-glow: rgba(59, 130, 246, 0.25);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.22);
  --text-primary: #f4f4f5;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== WORKSPACE & STAGE PATTERNS ==================== */

/* Dark Transparent Checkerboard Pattern */
.checkerboard {
  background-color: #121418;
  background-image:
    linear-gradient(45deg, #1b1e24 25%, transparent 25%),
    linear-gradient(-45deg, #1b1e24 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1b1e24 75%),
    linear-gradient(-45deg, transparent 75%, #1b1e24 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Ambient workspace dot grid */
.workspace-bg {
  background-color: var(--bg-canvas);
  background-image: radial-gradient(#232730 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Technical CAD blueprint micro-grid */
.cad-grid-bg {
  background-color: #11141a;
  background-image:
    linear-gradient(to right, rgba(45, 50, 60, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(45, 50, 60, 0.35) 1px, transparent 1px),
    linear-gradient(to right, rgba(59, 130, 246, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 130, 246, 0.08) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
}

/* Rule of thirds crop grid */
.crop-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.28) 1px, transparent 1px);
  background-size: 33.3333% 33.3333%;
}

/* ==================== CUSTOM RANGE SLIDERS ==================== */
input[type="range"].editor-slider,
input[type="range"].cad-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

input[type="range"].editor-slider::-webkit-slider-thumb,
input[type="range"].cad-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2.5px solid var(--brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

input[type="range"].editor-slider::-webkit-slider-thumb:hover,
input[type="range"].cad-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #ffffff;
}

input[type="range"].editor-slider::-moz-range-thumb,
input[type="range"].cad-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2.5px solid var(--brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.12s ease;
}

/* ==================== CUSTOM DARK SCROLLBARS ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ==================== TOOLTIPS ==================== */
.has-tooltip {
  position: relative !important;
}

.has-tooltip > .tooltip,
.has-tooltip .tooltip {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  position: absolute !important;
  z-index: 100 !important;
  background: #111317;
  color: #f4f4f5;
  border: 1px solid #2c3038;
  padding: 5px 9px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap !important;
  pointer-events: none !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

.has-tooltip:hover > .tooltip,
.has-tooltip:hover .tooltip {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.tooltip-right {
  left: calc(100% + 10px) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.tooltip-bottom {
  top: calc(100% + 8px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* ==================== HOMEPAGE & MARKETING STUDIO CARDS ==================== */
.hero-radial-glow {
  background:
    radial-gradient(650px circle at 22% 18%, rgba(59, 130, 246, 0.13), transparent 65%),
    radial-gradient(600px circle at 78% 22%, rgba(16, 185, 129, 0.10), transparent 65%);
}

.studio-card {
  background: linear-gradient(180deg, rgba(33, 36, 43, 0.72) 0%, rgba(24, 26, 31, 0.92) 100%);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 18px 40px -15px rgba(0, 0, 0, 0.65);
}

.studio-card-blue:hover {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 20px 44px -15px rgba(59, 130, 246, 0.18);
}

.studio-card-emerald:hover {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 20px 44px -15px rgba(16, 185, 129, 0.18);
}

/* ==================== LEGAL PAGES (PRIVACY & TERMS) ==================== */
.legal-prose h2 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.legal-prose h3 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(44, 48, 56, 0.65);
  scroll-margin-top: 5.5rem;
}

.legal-prose p,
.legal-prose li {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.7;
}

.legal-prose ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.legal-prose li + li {
  margin-top: 0.35rem;
}

/* Print Rules for CAD */
@media print {
  header, aside, footer, #floatingHudControls, #inspectorPanel {
    display: none !important;
  }
  body, main {
    background: #ffffff !important;
  }
}

