/* ============================================================
 * FREEZE ADS BOT — Base Reset & Global Styles
 * ============================================================
 * 
 * Modern CSS reset optimised for Telegram Mini Apps.
 * Handles:
 *   • Box-model reset
 *   • Full-viewport body setup
 *   • Custom scrollbar (themed)
 *   • Selection & focus-visible styling
 *   • Smooth theme-switch transitions
 *   • Image & media defaults
 *   • Telegram-specific quirks
 * ========================================================== */


/* ──────────────────────────────────────────────────────────── 
 * BOX-MODEL RESET
 * ──────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ──────────────────────────────────────────────────────────── 
 * SMOOTH THEME TRANSITIONS
 * Apply to ALL elements so color/bg changes between themes
 * animate gracefully instead of flashing.
 * ──────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  transition:
    color var(--transition-normal),
    background-color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    opacity var(--transition-normal);
}


/* ──────────────────────────────────────────────────────────── 
 * HTML & BODY
 * ──────────────────────────────────────────────────────────── */

html {
  /* Smooth scroll for in-page anchors */
  scroll-behavior: smooth;

  /* Prevent font-size inflation on orientation change (iOS) */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;

  /* Use sub-pixel antialiasing for crisp text */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Prevent pull-to-refresh in Telegram WebView */
  overscroll-behavior: none;
  
  /* Lock height and prevent scrolling */
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);

  /* Fill the entire viewport precisely and prevent overflow */
  height: 100%;
  width: 100%;
  overflow: hidden;

  /* Subtle background gradient for depth */
  background-image: var(--gradient-hero);
  background-attachment: fixed;
}


/* ──────────────────────────────────────────────────────────── 
 * CUSTOM SCROLLBAR
 * Thin, accent-colored in dark mode; subtle grey in light.
 * ──────────────────────────────────────────────────────────── */

/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}


/* ──────────────────────────────────────────────────────────── 
 * TEXT SELECTION
 * Accent-coloured highlight for brand consistency.
 * ──────────────────────────────────────────────────────────── */

::selection {
  background-color: rgba(var(--accent-rgb), 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background-color: rgba(var(--accent-rgb), 0.3);
  color: var(--text-primary);
}


/* ──────────────────────────────────────────────────────────── 
 * FOCUS-VISIBLE OUTLINE
 * Accessible keyboard-navigation ring that matches the theme.
 * Only shows on keyboard focus, not on click (focus-visible).
 * ──────────────────────────────────────────────────────────── */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ──────────────────────────────────────────────────────────── 
 * TYPOGRAPHY DEFAULTS
 * ──────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl);  }
h5 { font-size: var(--font-size-lg);  }
h6 { font-size: var(--font-size-base); }

p {
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

strong, b {
  font-weight: var(--font-weight-semibold);
}

small {
  font-size: var(--font-size-sm);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-light);
}


/* ──────────────────────────────────────────────────────────── 
 * IMAGES & MEDIA
 * ──────────────────────────────────────────────────────────── */

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  /* Prevent image dragging in Telegram WebView */
  -webkit-user-drag: none;
  user-select: none;
}


/* ──────────────────────────────────────────────────────────── 
 * LISTS
 * ──────────────────────────────────────────────────────────── */

ul, ol {
  list-style: none;
}


/* ──────────────────────────────────────────────────────────── 
 * BUTTONS & INTERACTIVE DEFAULTS
 * ──────────────────────────────────────────────────────────── */

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}


/* ──────────────────────────────────────────────────────────── 
 * TABLE
 * ──────────────────────────────────────────────────────────── */

table {
  border-collapse: collapse;
  border-spacing: 0;
}


/* ──────────────────────────────────────────────────────────── 
 * UTILITY: PREVENT USER SELECT ON UI ELEMENTS
 * Applied to headers, navs, buttons, etc. via this class.
 * ──────────────────────────────────────────────────────────── */

.no-select {
  -webkit-user-select: none;
  user-select: none;
}


/* ──────────────────────────────────────────────────────────── 
 * UTILITY: VISUALLY HIDDEN (a11y)
 * Screen-reader-only content.
 * ──────────────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ──────────────────────────────────────────────────────────── 
 * UTILITY: TEXT TRUNCATION
 * ──────────────────────────────────────────────────────────── */

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ──────────────────────────────────────────────────────────── 
 * TELEGRAM MINI APP SPECIFIC
 * ──────────────────────────────────────────────────────────── */

/* Disable long-press context menu in WebView */
body {
  -webkit-touch-callout: none;
}

/* Remove tap highlight on all interactive elements */
a,
button,
input,
textarea,
select,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* ──────────────────────────────────────────────────────────── 
 * BACKGROUND GLOWING ORBS (NEBULAR EFFECT)
 * ──────────────────────────────────────────────────────────── */

.glowing-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  user-select: none;
}

.orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(100px);
  -webkit-filter: blur(100px);
  opacity: 0.08; /* subtle in light mode */
  mix-blend-mode: screen;
  transition: opacity var(--transition-slow);
}

html.theme-dark .orb {
  opacity: 0.15; /* more vibrant in dark mode */
}

.orb--blue {
  top: -10%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation: floatOrb 25s infinite alternate ease-in-out;
}

.orb--purple {
  bottom: -10%;
  right: -10%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-premium) 0%, transparent 70%);
  animation: floatOrb 30s infinite alternate-reverse ease-in-out;
}

