/**
 * Global Stylesheet - Snapchat Story & Video Studio
 * Defines base design tokens, reset overrides, mobile viewport guards, and utility classes.
 */

:root {
  --bg-primary: #030712;     /* gray-950 */
  --bg-surface: #111827;     /* gray-900 */
  --bg-card: #1f2937;        /* gray-800 */
  --bg-input: #374151;       /* gray-700 */
  --border-color: #374151;   /* gray-700 */
  --text-main: #f9fafb;      /* gray-50 */
  --text-muted: #9ca3af;     /* gray-400 */
  --color-snap-yellow: #fffc00;
  --color-primary: #2563eb;  /* blue-600 */
  --color-primary-hover: #1d4ed8; /* blue-700 */
  --color-success: #16a34a;  /* green-600 */
  --color-success-hover: #15803d; /* green-700 */
  --color-disabled: #4b5563; /* gray-600 */
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition-fast: 0.15s ease-in-out;
}

/* Strict mobile viewport guard: prevents any horizontal scroll */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  /* Respect notch and home-indicator safe areas on iPhone and Android */
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

/* Aspect ratio utility (9:16 vertical Snapchat standard) */
.aspect-9-16 {
  aspect-ratio: 9 / 16;
}

/* Mobile responsive constraints */
img, video, canvas {
  max-width: 100%;
  height: auto;
}

/* Common icon styling */
.download-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Smooth textarea custom scrollbar */
textarea::-webkit-scrollbar {
  width: 6px;
}

textarea::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}

textarea::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-md);
}

textarea::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
