/**
 * Instypegram Suite — Shared Design Language
 * Single source of truth for all common styles across tools.
 */

/* ─── Design Tokens ─── */
:root {
  --bg: #0b0c10;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(255, 255, 255, 0.22);
  --text-main: #f5f6fa;
  --text-muted: #8e95a5;
  --accent: #ec4899;
  --accent-hover: #db2777;
  --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ─── Base Body ─── */
body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  position: relative;
}

/* ─── Ambient Background Glow (default red – override colors per page with body::before) ─── */
body::before {
  content: "";
  position: fixed;
  width: min(550px, 90vw);
  height: min(550px, 90vw);
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(220, 39, 67, 0.14) 0%, rgba(11, 12, 16, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

/* ─── IG Gradient Background Utility ─── */
.bg-ig-gradient {
  background: var(--ig-gradient);
}

/* ─── Gradient Text ─── */
.gradient-text {
  background: var(--ig-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── Story Ring (brand logo ring) ─── */
.story-ring {
  background: var(--ig-gradient);
  padding: 2px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

/* ─── Unified Header Action Buttons ─── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.header-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.header-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.header-btn-download {
  background: var(--ig-gradient);
  border: none;
  color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.25), 0 4px 6px -4px rgba(236, 72, 153, 0.25);
}

.header-btn-download:hover:not(:disabled) {
  opacity: 0.95;
}

.header-btn-share {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(236, 72, 153, 0.3);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(236, 72, 153, 0.1), 0 2px 4px -2px rgba(236, 72, 153, 0.1);
}

.header-btn-share:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(236, 72, 153, 0.5);
}

.header-btn-share svg {
  color: #f472b6;
  stroke: #f472b6;
  flex-shrink: 0;
}

.header-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-weight: 600;
}

.header-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ─── Glass Card ─── */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 12, 16, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(142, 149, 165, 0.35);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(236, 72, 153, 0.6);
}

/* ─── Range Slider ─── */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  height: 7px;
  accent-color: var(--accent);
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.7);
  border: 2px solid #ffffff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
input[type=range]::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.7);
  border: 2px solid #ffffff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
input[type=range]::-webkit-slider-thumb:hover,
input[type=range]::-moz-range-thumb:hover {
  transform: scale(1.16);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.95);
}
input[type=range]::-moz-range-progress {
  background-color: var(--accent);
  border-radius: 9999px;
  height: 7px;
}

/* ─── Transparent Canvas Checkerboard ─── */
.bg-checkered {
  background-color: #0b0c10;
  background-image:
    linear-gradient(45deg, #161922 25%, transparent 25%),
    linear-gradient(-45deg, #161922 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #161922 75%),
    linear-gradient(-45deg, transparent 75%, #161922 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* ─── Dropzone Active State ─── */
.dropzone-active {
  border-color: var(--accent) !important;
  background-color: rgba(236, 72, 153, 0.08) !important;
  transform: scale(1.01);
}

/* ─── Text Selection ─── */
::selection {
  background: rgba(236, 72, 153, 0.4);
  color: #fff;
}
