/* ═══════════════════════════════════════════════════
   Kiosk App — style.css
   Optimised for iPad (1024×768 landscape / 768×1024 portrait)
═══════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

:root {
  /* ── Giraffe CCTV brand palette ─────────────────────── */
  --brand-primary:   #f5c518;   /* golden yellow — CTA / accent */
  --brand-secondary: #d4a012;   /* darker gold — hover states  */
  --brand-accent:    #ffd740;   /* lighter gold — highlights   */
  --brand-light:     #fff8e1;   /* pale gold tint              */

  /* Neutrals — dark navy family matching the website */
  --neutral-900: #10121c;
  --neutral-800: #181b2a;
  --neutral-700: #1f2338;
  --neutral-600: #282d46;
  --neutral-400: #6b7280;
  --neutral-200: #e5e7eb;
  --neutral-100: #f3f4f6;
  --white:        #ffffff;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;

  /* Timing */
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--neutral-900);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ── View System ───────────────────────────────────── */
.view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
  transition:
    opacity var(--transition),
    transform var(--transition);
  will-change: opacity, transform;
}

.view.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.view.exiting {
  opacity: 0;
  transform: translateX(-40px);
}

/* ── Shared View Header ────────────────────────────── */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: var(--neutral-800);
  border-bottom: 1px solid var(--neutral-600);
  flex-shrink: 0;
  gap: 16px;
}

.view-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.01em;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--neutral-700);
  border: 1px solid var(--neutral-600);
  border-radius: var(--radius-sm);
  color: var(--neutral-200);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.back-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.back-btn:active {
  background: var(--neutral-600);
  color: var(--white);
}

/* ════════════════════════════════════════════════════
   LANDING VIEW
════════════════════════════════════════════════════ */
#view-landing {
  background: var(--neutral-900);
  overflow: hidden;
}

/* Animated mesh gradient background */
.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(245,197,24,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255,215,64,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(16,18,28,1) 40%, transparent 100%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  from { opacity: 0.8; }
  to   { opacity: 1; }
}

/* Grid overlay removed */


.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 48px 40px 32px;
}

/* Header */
.landing-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

#company-logo {
  height: clamp(72px, 10vh, 140px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(245,197,24,0.35));
}

#company-name {
  font-size: clamp(2rem, 4vw, 4.5rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, var(--brand-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--neutral-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* Action Cards */
.landing-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;   /* cards always side by side in landscape */
  gap: clamp(16px, 2vw, 32px);
  width: 100%;
  max-width: min(1300px, 96vw);
  flex: 1;
  align-items: center;
  justify-content: center;
}

.action-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 40px 36px;
  background: linear-gradient(145deg, rgba(245,197,24,0.14), rgba(212,160,18,0.07));
  border: 1px solid rgba(245,197,24,0.30);
  border-radius: var(--radius-xl);
  cursor: pointer;
  /* Both cards are always equal: flex: 1 1 0 shares space evenly.
     max-width caps them at 550px on large screens.
     They shrink together on smaller viewports so they always fit side by side. */
  flex: 1 1 0;
  min-width: 0;
  max-width: 550px;
  height: 400px;
  text-align: left;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform 0.2s ease,
    box-shadow var(--transition);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow:
    0 0 36px rgba(245,197,24,0.08),
    inset 0 1px 0 rgba(255,255,255,0.07);
}

.action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition);
}

.action-card:active {
  transform: scale(0.97);
  box-shadow:
    0 0 60px rgba(245,197,24,0.20),
    0 0 0 2px var(--brand-primary);
}

.action-card:active::before {
  opacity: 1;
}

/* Primary card — same gold bloom, no visual difference */
.action-card--primary {
  background: linear-gradient(145deg, rgba(245,197,24,0.14), rgba(212,160,18,0.07));
  border-color: rgba(245,197,24,0.30);
  box-shadow:
    0 0 36px rgba(245,197,24,0.08),
    inset 0 1px 0 rgba(255,255,255,0.07);
}

.action-card--primary:active {
  box-shadow:
    0 0 60px rgba(245,197,24,0.20),
    0 0 0 2px var(--brand-primary);
  transform: scale(0.97);
}

.action-card-icon {
  width: clamp(52px, 6vw, 80px);
  height: clamp(52px, 6vw, 80px);
  border-radius: var(--radius-md);
  background: rgba(245,197,24,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.action-card--primary .action-card-icon {
  background: rgba(245,197,24,0.18);
}

.action-card-icon svg {
  width: clamp(26px, 3vw, 40px);
  height: clamp(26px, 3vw, 40px);
  color: var(--white);
}

.action-card h2 {
  font-size: clamp(1.4rem, 2.2vw, 2.6rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.action-card p {
  font-size: clamp(0.9rem, 1.2vw, 1.3rem);
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
}

.action-card-arrow {
  position: absolute;
  bottom: 28px;
  right: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform 0.2s;
}

.action-card:active .action-card-arrow {
  background: rgba(255,255,255,0.15);
  transform: translateX(3px);
}

.action-card-arrow svg {
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,0.7);
}

/* Footer */
.landing-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.3);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* ════════════════════════════════════════════════════
   PDF VIEW
════════════════════════════════════════════════════ */
#view-pdf {
  background: var(--neutral-800);
}

.pdf-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 100px;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px;
  color: var(--neutral-400);
  font-size: 1rem;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#pdf-canvas {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: block;
}

/* PDF Navigation */
.pdf-nav {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(30,32,41,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 60px;
  padding: 10px 24px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.pdf-nav.visible {
  opacity: 1;
  pointer-events: all;
}

.pdf-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.pdf-nav-btn:active {
  background: rgba(255,255,255,0.18);
}

.pdf-nav-btn svg {
  width: 18px;
  height: 18px;
}

.pdf-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

#pdf-page-info {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  min-width: 90px;
  text-align: center;
}

/* ════════════════════════════════════════════════════
   SURVEY LAUNCH TRANSITION SCREEN
════════════════════════════════════════════════════ */
#view-survey {
  background: var(--neutral-900);
  align-items: center;
  justify-content: center;
}

.survey-launch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.survey-launch-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(245,197,24,0.12);
  border: 1px solid rgba(245,197,24,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.survey-launch-icon svg {
  width: 36px;
  height: 36px;
  color: var(--brand-accent);
}

.survey-launch h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
}

.survey-launch p {
  font-size: 1rem;
  color: var(--neutral-400);
}

.survey-spinner {
  margin-top: 8px;
}

/* ════════════════════════════════════════════════════
   INACTIVITY OVERLAY
════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.4s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: rgba(24, 27, 42, 0.97);
  border: 1px solid rgba(245,197,24,0.15);
  border-radius: var(--radius-xl);
  padding: 48px 56px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(245,197,24,0.05) inset;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.overlay-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(245,197,24,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-icon svg {
  width: 28px;
  height: 28px;
  color: var(--brand-accent);
}

.overlay-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
}

.overlay-card > p {
  font-size: 1rem;
  color: var(--neutral-400);
  margin-top: -8px;
}

/* Countdown ring */
.countdown-ring {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.countdown-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.countdown-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 8;
}

.countdown-progress {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.5s;
}

.countdown-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

/* Stay button — dark text on gold for legibility */
.stay-btn {
  margin-top: 8px;
  padding: 14px 28px;
  background: var(--brand-primary);
  color: #10121c;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}

.stay-btn:active {
  background: var(--brand-accent);
  transform: scale(0.97);
}

/* ── Portrait mode adjustments ────────────────────── */
@media (orientation: portrait) {
  .landing-content {
    padding: 40px 28px 28px;
  }

  .landing-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: center; /* vertically centre the card group */
    flex: 0 1 auto;          /* don't force-fill remaining height */
    gap: 20px;
  }

  .action-card {
    flex: 0 0 auto;   /* don't stretch — size to content */
    width: 100%;      /* full width in portrait */
    height: auto;
    min-height: 0;
    max-height: none;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 28px;
  }

  .action-card-icon {
    flex-shrink: 0;
  }

  .action-card-arrow {
    position: static;
    margin-left: auto;
    flex-shrink: 0;
  }

  .action-card h2 { font-size: 1.3rem; }
  .action-card p  { font-size: 0.88rem; }

  #company-name { font-size: 2rem; }
}

