/**
 * Vatandar QR Digital Menu System Styles
 * Optimized for mobile viewport (390px base)
 * Strictly loaded only on /qr/* pages
 */

:root {
  --qr-bg-dark: #0D160B;
  --qr-bg-card: rgba(20, 32, 14, 0.88);
  --qr-border-card: rgba(142, 178, 86, 0.28);
  --qr-gold: #DDA135;
  --qr-gold-glow: rgba(221, 161, 53, 0.35);
  --qr-green-accent: #8EB256;
  --qr-text-primary: #FAF6F0;
  --qr-text-muted: rgba(250, 246, 240, 0.72);
  --qr-font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Global Reset for QR Flow */
.qr-body {
  margin: 0;
  padding: 0;
  background-color: #060905;
  background: radial-gradient(circle at 50% 28%, #162611 0%, #0C150A 52%, #050804 100%);
  color: var(--qr-text-primary);
  font-family: var(--qr-font-family);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}

.qr-body *,
.qr-body *::before,
.qr-body *::after {
  box-sizing: border-box;
}

/* ==========================================================================
   NOTE 3: CANVAS Z-INDEX & LAYERING
   Layer 1: Base dark gradient background on body
   Layer 2: Canvas floating white particles (pointer-events: none, z-index: 1)
   Layer 3: Interactive content layer (position: relative, z-index: 2)
   ========================================================================== */
.qr-particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* Base Mobile Container */
.qr-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   PART 1: QR LANDING PAGE (/qr/)
   ========================================================================== */
.qr-landing-page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  text-align: center;
  box-sizing: border-box;
}

/* NOTE 1: Prominent Logo (~170px) with Animated Ambient Glow */
.qr-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.qr-logo-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(221, 161, 53, 0.45) 0%, rgba(142, 178, 86, 0.3) 45%, transparent 70%);
  filter: blur(30px);
  z-index: 1;
  pointer-events: none;
  animation: logoGlowShift 7s ease-in-out infinite alternate;
}

.qr-logo-img {
  position: relative;
  z-index: 2;
  width: 170px;
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 18px rgba(221, 161, 53, 0.25));
  animation: logoFloat 3.6s ease-in-out infinite alternate;
  display: block;
}

@keyframes logoGlowShift {
  0% {
    background: radial-gradient(circle, rgba(221, 161, 53, 0.5) 0%, rgba(142, 178, 86, 0.25) 50%, transparent 70%);
    transform: scale(0.95);
    filter: blur(28px);
  }
  50% {
    background: radial-gradient(circle, rgba(142, 178, 86, 0.45) 0%, rgba(221, 161, 53, 0.35) 50%, transparent 70%);
    transform: scale(1.08);
    filter: blur(35px);
  }
  100% {
    background: radial-gradient(circle, rgba(221, 161, 53, 0.55) 0%, rgba(184, 130, 32, 0.3) 50%, transparent 70%);
    transform: scale(1.02);
    filter: blur(30px);
  }
}

@keyframes logoFloat {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-8px);
  }
}

/* 3-Language Welcome Titles */
.qr-welcome-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  animation: qrFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.qr-welcome-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.qr-welcome-title.fa {
  font-size: 1.45rem;
  color: var(--qr-gold);
  text-shadow: 0 2px 14px rgba(221, 161, 53, 0.3);
}

.qr-welcome-title.en {
  font-size: 1.15rem;
  color: #FAF6F0;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
}

.qr-welcome-title.ar {
  font-size: 1.25rem;
  color: #E2ECD4;
  font-weight: 700;
}

/* 3-Language Subtitles */
.qr-welcome-subs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 30px;
  animation: qrFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
  opacity: 0;
}

.qr-welcome-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--qr-text-muted);
}

/* Flag Buttons Grid (~90px circular buttons with glow ring) */
.qr-flags-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 28px;
  animation: qrFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
  opacity: 0;
}

.qr-flag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qr-flag-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  padding: 0;
  border: 3px solid rgba(221, 161, 53, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(221, 161, 53, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 28, 14, 0.95);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.qr-flag-item:hover .qr-flag-btn,
.qr-flag-item:active .qr-flag-btn {
  transform: scale(1.08);
  border-color: var(--qr-gold);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 28px rgba(221, 161, 53, 0.55);
}

.qr-flag-btn img,
.qr-flag-btn svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qr-flag-label {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--qr-text-primary);
  transition: color 0.2s ease;
}

.qr-flag-item:hover .qr-flag-label {
  color: var(--qr-gold);
}

.qr-brand-badge {
  font-size: 0.78rem;
  color: rgba(250, 246, 240, 0.45);
  border-top: 1px solid rgba(142, 178, 86, 0.2);
  padding-top: 14px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  text-align: center;
}

@keyframes qrFadeUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .qr-logo-glow,
  .qr-logo-img,
  .qr-welcome-titles,
  .qr-welcome-subs,
  .qr-flags-grid,
  .qr-flag-btn,
  .qr-flag-item {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .qr-particles-canvas {
    display: none !important;
  }
}
