/* ============================================
   Omnetic TV Display - Base Styles
   ============================================ */

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

:root {
  /* Primary color - overridden by URL param ?color=XXXXXX */
  --primary: #E32C1E;
  --primary-rgb: 227, 44, 30;

  /* Neutrals */
  --white: #ffffff;
  --black: #000000;
  --bg-dark: #111111;
  --bg-card: #1a1a1a;
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 40px;
  --gap-2xl: 64px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Transitions */
  --fade-duration: 300ms;
  --fade-easing: ease-in-out;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Fade Animations
   ============================================ */

.fade-in {
  animation: fadeIn var(--fade-duration) var(--fade-easing) forwards;
}

.fade-out {
  animation: fadeOut var(--fade-duration) var(--fade-easing) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ============================================
   Shared Price Block (Parallelogram)
   ============================================ */

.price-block {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background-color: var(--primary);
  color: var(--white);
  font-weight: var(--font-weight-bold);
  font-size: 2rem;
  transform: skewX(-8deg);
  line-height: 1;
}

.price-block__inner {
  transform: skewX(8deg);
}

.price-block--old {
  background-color: rgba(255, 255, 255, 0.15);
  text-decoration: line-through;
  font-size: 1.3rem;
  font-weight: var(--font-weight-medium);
  opacity: 0.7;
}

/* ============================================
   Screen containers
   ============================================ */

#login-screen,
#loading-screen,
#error-screen,
#tv-display {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#loading-screen,
#error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-md);
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
  width: 64px;
  height: 64px;
  border: 5px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  -webkit-animation: spin 0.8s linear infinite;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  will-change: transform;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

/* ============================================
   Error Screen
   ============================================ */

.error-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.error-title {
  font-size: 1.4rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.error-message {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 400px;
  text-align: center;
}

/* ============================================
   Utility Classes
   ============================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Ken Burns container */
.parallax-container {
  overflow: hidden;
  position: relative;
}

.parallax-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  transition: transform 0s linear;
}
