/* ==========================================================================
   Niminko TAP — Brand Stylesheet
   - Tech Dark Theme (NFC & Augmented Reality Accentuation)
   - Glassmorphism UI Systems
   - Interactive T-Shirt Designer Workspace
   - Camera Feed & Mobile AR Scan Layouts
   ========================================================================== */

:root {
  --bg-main: #07090e;
  --bg-surface: #0e121a;
  --bg-card: #151a24;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(0, 229, 255, 0.2);
  
  /* Brand Typography & Color Palette */
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --brand-blue: #1e3a8a;
  --neon-blue: #00e5ff;
  --neon-purple: #a855f7;
  --danger-red: #ef4444;
  --success-green: #10b981;
  
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-cursive: 'Allura', cursive;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 15px rgba(0, 229, 255, 0.35);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --nav-height: 70px;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

body.dark-theme {
  color-scheme: dark;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ==========================================================================
   Typography & Helper Utilities
   ========================================================================== */
.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--neon-blue) 70%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monospace { font-family: monospace; }
.block { display: block; }
.hidden { display: none !important; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.badge-glow {
  background: rgba(0, 229, 255, 0.05);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  transition: background var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.logo-area {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
}

.logo-script {
  font-family: var(--font-cursive);
  font-size: 2.2rem;
  font-weight: normal;
  line-height: 0.8;
  color: var(--text-primary);
}

.logo-sub {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--neon-blue);
  transform: translateY(-4px);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0.25rem;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--neon-blue);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--neon-blue);
  border-radius: 9999px;
  box-shadow: var(--shadow-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
}

.user-name-text {
  font-size: 0.8rem;
  font-weight: 500;
}

.btn-logout {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.btn-logout:hover {
  color: var(--danger-red);
}

/* ==========================================================================
   Buttons UI System
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }
.btn-md { padding: 0.75rem 1.5rem; font-size: 0.825rem; }
.btn-lg { padding: 1rem 2rem; font-size: 0.9rem; border-radius: 10px; }
.btn-xs { padding: 0.35rem 0.75rem; font-size: 0.65rem; border-radius: 6px; }
.btn-block { width: 100%; display: flex; }

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-main);
}
.btn-primary:hover {
  background-color: var(--neon-blue);
  color: var(--bg-main);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger-red);
}
.btn-danger:hover {
  background: var(--danger-red);
  color: white;
}

.btn-glow {
  background: var(--neon-blue);
  color: var(--bg-main);
  box-shadow: var(--shadow-glow);
}
.btn-glow:hover {
  background: #00b8cc;
  transform: translateY(-1px);
}

/* ==========================================================================
   SPA Content Mount & Transitions
   ========================================================================== */
#main-content {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  position: relative;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   VIEW: HOME (Landing Page) Styling
   ========================================================================== */
.hero-wrapper {
  position: relative;
  padding-block: clamp(3rem, 10vw, 8rem);
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  mask-image: radial-gradient(circle at 60% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 60% 40%, black 20%, transparent 75%);
  z-index: 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 4rem;
  }
}

.hero-text-block {
  max-width: 620px;
}

@media (max-width: 968px) {
  .hero-text-block {
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.hero-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  font-weight: 300;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Home Interactive Card Demo */
.hero-visual-block {
  position: relative;
  display: flex;
  justify-content: center;
}

.glow-container {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.35;
  z-index: 0;
}

.glow-circle {
  position: absolute;
  border-radius: 9999px;
}
.glow-blue { width: 300px; height: 300px; background: var(--neon-blue); top: 10%; left: 10%; }
.glow-purple { width: 250px; height: 250px; background: var(--neon-purple); bottom: 10%; right: 10%; }

.interactive-card {
  width: 100%;
  max-width: 380px;
  background: rgba(14, 18, 26, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.interactive-card.ar-active {
  border-color: var(--border-color-glow);
  box-shadow: var(--shadow-glow);
}

.shirt-preview-container {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.shirt-base-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #171d27; /* T-shirt base color */
  position: relative;
}

.svg-shirt {
  width: 90%;
  height: 90%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
  transition: color var(--transition-fast);
}

.nfc-pulse-circle {
  fill: rgba(0, 229, 255, 0.2);
  stroke: var(--neon-blue);
  stroke-width: 1.5;
  cursor: pointer;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { r: 10; fill-opacity: 0.2; }
  50% { r: 16; fill-opacity: 0.5; }
  100% { r: 10; fill-opacity: 0.2; }
}

.nfc-waves {
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.interactive-card.nfc-tapped .nfc-waves {
  opacity: 1;
  animation: wavePulse 1s ease-out infinite;
}

@keyframes wavePulse {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.2); opacity: 0; }
}

.shirt-print-overlay {
  position: absolute;
  top: 32%;
  left: 28%;
  right: 28%;
  bottom: 28%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-graphic-mock {
  width: 75%;
  height: 75%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity var(--transition-normal);
}

/* Interactive Card AR Scan Simulation Layer */
.demo-overlay-message {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 10;
}

.interactive-card.ar-active .demo-overlay-message {
  opacity: 1;
  pointer-events: auto;
}

.ar-scanner-grid {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(to right, rgba(0,229,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,229,255,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}

.ar-target-box {
  width: 70%;
  aspect-ratio: 1;
  border: 1px dashed rgba(0, 229, 255, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.ar-target-box::after {
  content: 'ANCHORED';
  position: absolute;
  bottom: -22px;
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--neon-blue);
}

.ar-video-frame {
  position: absolute;
  width: 72%;
  height: 72%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--neon-blue);
  box-shadow: var(--shadow-glow);
  z-index: 2;
  transform: perspective(400px) rotateX(15deg);
}

.ar-video-frame iframe,
.ar-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.interactive-controls {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.demo-status-text {
  font-size: 0.725rem;
  color: var(--text-muted);
  text-align: center;
}

/* Feature Grid */
.features-section {
  padding-block: 5rem 3rem;
  border-top: 1px solid var(--border-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  transition: all var(--transition-fast);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.feature-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--border-color-glow);
  color: var(--neon-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Brand Showcase Block */
.brand-showcase {
  padding-block: 5rem;
}

.showcase-content {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.25) 0%, rgba(142, 68, 173, 0.05) 100%);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 24px;
  padding: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 3rem;
}

@media (max-width: 868px) {
  .showcase-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

.showcase-text h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.showcase-text p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.showcase-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.color-stack {
  display: flex;
  gap: 0.75rem;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.color-black { background: #171d27; }
.color-dot.color-white { background: #f3f4f6; }
.color-dot.color-sand  { background: #dcd7ca; }
.color-dot.color-sage  { background: #8f978b; }
.color-dot.color-cobalt { background: #1a4099; }

.custom-card-preview {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1.58;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.card-glow {
  position: absolute;
  top: -40%;
  right: -40%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.3) 0%, transparent 70%);
  filter: blur(15px);
}

.custom-card-preview span {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.custom-card-preview strong {
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

/* ==========================================================================
   VIEW: DESIGNER (T-Shirt Creator) Layout
   ========================================================================== */
.designer-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
}

@media (max-width: 968px) {
  .designer-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    overflow: visible;
  }
}

/* Designer Sidebar */
.designer-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

@media (max-width: 968px) {
  .designer-sidebar {
    height: 480px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

.sidebar-tab-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 0;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--neon-blue);
  border-bottom-color: var(--neon-blue);
  background: rgba(0, 229, 255, 0.02);
}

.sidebar-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Custom scrollbars */
.sidebar-scroll-content::-webkit-scrollbar {
  width: 6px;
}
.sidebar-scroll-content::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}
.sidebar-scroll-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-tab-content {
  display: none;
}

.sidebar-tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.sidebar-subtitle {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.sidebar-note {
  font-size: 0.775rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* Sidebar Color Picker */
.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.color-option {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.color-option.active {
  border-color: var(--neon-blue);
  transform: scale(1.05);
}

.side-toggle-group {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.face-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.face-toggle button {
  padding: 0.6rem;
  font-size: 0.75rem;
}

.face-toggle button.active {
  background: var(--neon-blue);
  color: var(--bg-main);
  border-color: var(--neon-blue);
}

.placement-info-card {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
}

.placement-info-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.placement-info-card p {
  font-size: 0.725rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Sidebar Assets Tab */
.assets-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.assets-header-row .sidebar-title {
  margin-bottom: 0;
}

.hidden-file-input {
  display: none;
}

.assets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.asset-item {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
  padding: 0.25rem;
}

.asset-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.asset-item svg,
.asset-item img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

.user-assets-wrapper {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

/* Transform Control Panel (Floating sidebar container) */
.transform-controls-box {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
}

.control-row label {
  color: var(--text-secondary);
  width: 50px;
}

.control-row input[type="range"] {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  accent-color: var(--neon-blue);
  margin-inline: 0.75rem;
  cursor: pointer;
}

.control-row span {
  width: 40px;
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
}

.control-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.control-actions button {
  flex: 1;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label,
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

#tab-video > .form-input {
  margin-bottom: 1.5rem;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--neon-blue);
}

.video-preview-wrapper {
  width: 100%;
  aspect-ratio: 1.777;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.video-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.video-preview-placeholder span {
  font-size: 0.75rem;
}

.video-preview-player {
  width: 100%;
  height: 100%;
  background: #000;
}

.video-preview-player iframe,
.video-preview-player video {
  width: 100%;
  height: 100%;
  border: none;
}

.ar-scaffolding-info {
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 1rem;
  border-radius: 8px;
}

.ar-scaffolding-info h4 {
  font-size: 0.8rem;
  color: var(--neon-purple);
  margin-bottom: 0.25rem;
}

.ar-scaffolding-info p {
  font-size: 0.725rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

/* Designer Canvas Workspace */
.designer-canvas-area {
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

@media (max-width: 968px) {
  .designer-canvas-area {
    height: 480px;
  }
}

.canvas-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(7, 9, 14, 0.4);
}

.garment-type-badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.face-indicator {
  font-size: 0.75rem;
  color: var(--neon-blue);
  font-weight: 600;
  text-transform: uppercase;
}

.canvas-outer-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.canvas-shadow-box {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-main-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #171d27; /* Reactive T-shirt fill */
  position: relative;
}

/* Print Box overlay (Where client designs on the shirt) */
.canvas-print-area {
  position: absolute;
  top: 32%;
  left: 28%;
  right: 28%;
  bottom: 28%;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  overflow: visible; /* Allows scaling and handle drags outside boundaries */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fiducial overlay container mirroring canvas-print-area dimensions */
.fiducial-overlay-bounds {
  position: absolute;
  top: 32%;
  left: 28%;
  right: 28%;
  bottom: 28%;
  pointer-events: none;
  overflow: visible;
}

/* 4-Corner Fiducial Markers styling */
.fiducial-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  opacity: 0.85;
  pointer-events: none;
  box-sizing: border-box;
}

/* Circle: Top-Left Corner */
.fiducial-marker.top-left {
  top: -7px;
  left: -7px;
  border: 1.5px solid currentColor;
  border-radius: 99px;
  width: 12px;
  height: 12px;
}

/* Square: Top-Right Corner */
.fiducial-marker.top-right {
  top: -7px;
  right: -7px;
  border: 1.5px solid currentColor;
  width: 10px;
  height: 10px;
}

/* Equal Sign (=): Bottom-Left Corner */
.fiducial-marker.bottom-left {
  bottom: -9px;
  left: -7px;
  font-size: 11px;
}

/* Triangle (▲): Bottom-Right Corner */
.fiducial-marker.bottom-right {
  bottom: -9px;
  right: -7px;
  font-size: 9px;
}

/* Plaged Graphic Layer */
.designer-graphic-layer {
  position: absolute;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.designer-graphic-layer img,
.designer-graphic-layer svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
  object-fit: contain;
}

/* Selected boundary ring */
.designer-graphic-layer.layer-selected {
  outline: 1.5px solid var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.canvas-help-footer {
  text-align: center;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.725rem;
  color: var(--text-muted);
  background: rgba(7, 9, 14, 0.4);
}

/* ==========================================================================
   VIEW: AR SCANNER & Camera Simulation
   ========================================================================== */
.ar-scanner-viewport {
  position: relative;
  width: 100vw;
  height: calc(100vh - var(--nav-height));
  background: #000;
  overflow: hidden;
}

#ar-camera-feed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.ar-camera-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #0e121a;
}

.fallback-gradient {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(30, 58, 138, 0.2) 0%, #07090e 100%);
  background-image: 
    radial-gradient(circle at center, rgba(30, 58, 138, 0.2) 0%, #07090e 100%),
    linear-gradient(to right, rgba(255,255,255,0.01) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.01) 1px, transparent 1px);
  background-size: 100% 100%, 30px 30px, 30px 30px;
}

.ar-overlay-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 15%, transparent 85%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

.ar-overlay-ui * {
  pointer-events: auto;
}

.ar-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1.5rem;
}

.btn-ar-back {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-ar-back:hover {
  background: var(--bg-main);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
}

.ar-title {
  font-family: var(--font-display);
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
}

.ar-spacer {
  width: 38px;
}

/* AR Targeting & Floating Shirt */
.ar-targeting-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
}

.ar-target-brackets {
  width: 320px;
  height: 320px;
  position: absolute;
  pointer-events: none;
  transition: border-color var(--transition-normal);
}

.bracket {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  opacity: 0.2; /* 80% translucent */
  transition: opacity 0.2s;
}

.bracket.top-left     { top: 0; left: 0; border-right: none; border-bottom: none; }
.bracket.top-right    { top: 0; right: 0; border-left: none; border-bottom: none; }
.bracket.bottom-left  { bottom: 0; left: 0; border-right: none; border-top: none; }
.bracket.bottom-right { bottom: 0; right: 0; border-left: none; border-top: none; }

.ar-scanner-viewport.scanning-active .bracket {
  border-color: var(--neon-blue);
  filter: drop-shadow(0 0 5px var(--neon-blue));
  opacity: 0.25; /* Subtle glow when active */
}

.ar-shirt-container {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  color: #171d27; /* Current T-shirt color */
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  transform: scale(0.9);
}

.ar-scanner-viewport.scanning-active .ar-shirt-container {
  opacity: 1;
  transform: scale(1.05);
}

.ar-shirt-relative {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ar-graphics-mount {
  position: absolute;
  top: 32%;
  left: 28%;
  right: 28%;
  bottom: 28%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ar-graphics-mount img,
.ar-graphics-mount svg {
  position: absolute;
  object-fit: contain;
}

/* Floating AR Video Overlay Screen */
.ar-video-overlay {
  position: absolute;
  top: 32%;
  left: 28%;
  right: 28%;
  bottom: 28%;
  background: #000;
  border: 1px solid var(--neon-blue);
  box-shadow: var(--shadow-glow);
  border-radius: 4px;
  overflow: hidden;
  z-index: 5;
  animation: arFloat 4s ease-in-out infinite alternate;
}

@keyframes arFloat {
  0% { transform: translateY(0) rotateY(0); }
  100% { transform: translateY(-4px) rotateY(4deg); }
}

.ar-video-frame-inner {
  width: 100%;
  height: 100%;
}

.ar-video-frame-inner iframe,
.ar-video-frame-inner video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

/* HUD Bottom */
.ar-hud-bottom {
  padding: 1.5rem;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hud-status {
  font-size: 0.775rem;
  color: var(--text-secondary);
  text-align: center;
}

.hud-buttons {
  display: flex;
  justify-content: center;
  width: 100%;
}

.nfc-icon {
  animation: nfcSwing 2.5s infinite;
}

@keyframes nfcSwing {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* Scan Laser beam */
.ar-scanner-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
  box-shadow: 0 0 10px var(--neon-blue);
  z-index: 8;
  top: 0;
  opacity: 0;
}

.ar-scanner-viewport.scanning-active .ar-scanner-bar {
  opacity: 0.2; /* 80% translucent */
  animation: scanSweep 3s linear infinite;
}

@keyframes scanSweep {
  0% { top: 10%; }
  50% { top: 75%; }
  100% { top: 10%; }
}

/* ==========================================================================
   Modals UI System (Overlay & Wrapper)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  opacity: 1;
  animation: modalFadeIn 0.3s ease-out forwards;
}

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

.modal-wrapper {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalSlideUp {
  from { transform: translateY(24px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

.max-width-sm { max-width: 400px; }
.max-width-md { max-width: 600px; }
.max-width-lg { max-width: 860px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-close {
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  width: 32px;
  height: 32px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.modal-body {
  padding: 1.5rem;
}

.modal-description {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Custom Preview Modal Columns */
.preview-cols {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .preview-cols {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.preview-visual-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.preview-shirt-card {
  width: 100%;
  aspect-ratio: 1;
  background: #080a0e;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-shirt-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-toggle-row {
  display: flex;
  gap: 0.5rem;
}

.preview-info-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 229, 255, 0.03);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  margin-block: 1rem;
}

.qr-code-box {
  width: 140px;
  height: 140px;
  background: white;
  border-radius: 6px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-data-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.meta-data-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  margin-block: 0.35rem;
}

.meta-data-row strong {
  color: var(--text-secondary);
}

.meta-data-row span {
  color: var(--text-primary);
}

/* Authentication Modal styles */
.auth-modal-body {
  padding-block: 2rem;
}

.auth-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-auth {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.03);
  color: white;
}

.btn-auth:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-auth-icon {
  margin-right: 0.75rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-block: 1.5rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding-inline: 0.75rem;
}

/* ==========================================================================
   Toasts Notification Overlay
   ========================================================================== */
.toast-wrapper {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
}

.toast-item {
  background: rgba(14, 18, 26, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
  animation: toastSlideIn 0.3s ease-out forwards;
  pointer-events: auto;
}

.toast-item.toast-success {
  border-left: 3px solid var(--success-green);
}

.toast-item.toast-info {
  border-left: 3px solid var(--neon-blue);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-item.toast-fadeout {
  animation: toastFadeOut 0.25s ease-in forwards;
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* Drag and Drop visual feedback overlays */
#tab-assets.drag-over-panel {
  border: 2px dashed var(--neon-blue) !important;
  background: rgba(0, 229, 255, 0.05) !important;
  transition: all var(--transition-fast);
}

#designer-canvas-container.drag-over-canvas {
  outline: 2px dashed var(--neon-blue) !important;
  outline-offset: 4px;
  background: rgba(0, 229, 255, 0.04) !important;
  transition: all var(--transition-fast);
}
