/* ═══════════════════════════════════════════════════════════════════
   Face Recognition App — Design System & Global Styles
   Premium dark-mode UI with glassmorphism, gradients, micro-animations
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ─── CSS Custom Properties ────────────────────────────────────────── */
:root {
  /* Colors — Base */
  --bg-primary: #06080f;
  --bg-secondary: #0d1117;
  --bg-tertiary: #161b22;
  --bg-card: rgba(22, 27, 34, 0.6);
  --bg-glass: rgba(13, 17, 23, 0.7);

  /* Colors — Text */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --text-inverse: #06080f;

  /* Colors — Accent */
  --accent-blue: #58a6ff;
  --accent-purple: #bc8cff;
  --accent-cyan: #39d0d8;
  --accent-green: #3fb950;
  --accent-orange: #f0883e;
  --accent-red: #f85149;
  --accent-pink: #f778ba;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #58a6ff 0%, #bc8cff 50%, #f778ba 100%);
  --gradient-glow: linear-gradient(135deg, #58a6ff 0%, #39d0d8 100%);
  --gradient-card: linear-gradient(135deg, rgba(88, 166, 255, 0.08) 0%, rgba(188, 140, 255, 0.05) 100%);
  --gradient-success: linear-gradient(135deg, #3fb950 0%, #39d0d8 100%);

  /* Borders */
  --border-default: rgba(48, 54, 61, 0.6);
  --border-accent: rgba(88, 166, 255, 0.3);
  --border-glow: rgba(88, 166, 255, 0.5);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(88, 166, 255, 0.15);
  --shadow-glow-strong: 0 0 40px rgba(88, 166, 255, 0.25);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.6;
}

/* ─── Background Effects ───────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 20%, rgba(88, 166, 255, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(188, 140, 255, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(57, 208, 216, 0.03) 0%, transparent 50%);
  z-index: -1;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
}

/* ─── App Layout ───────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: auto 1fr;
  height: 100vh;
  gap: 0;
}

.app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
  z-index: 10;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.app-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-glow);
}

.app-logo h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.app-logo .app-version {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  -webkit-text-fill-color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition-base);
}

.status-dot.status-active {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.status-loading {
  background: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
  animation: pulse 1s ease-in-out infinite;
}

.status-dot.status-error {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ─── Camera Section ───────────────────────────────────────────────── */
.camera-section {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  overflow: hidden;
}

.camera-viewport {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Camera scan-line effect */
.camera-viewport::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.4;
  animation: scanLine 3s linear infinite;
  z-index: 2;
}

@keyframes scanLine {
  0% { top: 0; }
  100% { top: 100%; }
}

/* Camera corner markers */
.camera-corners {
  position: absolute;
  top: var(--space-xl);
  left: var(--space-xl);
  right: var(--space-xl);
  bottom: var(--space-xl);
  pointer-events: none;
  z-index: 3;
}

.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--accent-cyan);
  opacity: 0.6;
}

.corner-tl { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; }
.corner-tr { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; }
.corner-bl { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; }
.corner-br { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; }

/* Camera toolbar */
.camera-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-default);
}

/* Camera placeholder when not started */
.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-2xl);
  text-align: center;
}

.camera-placeholder-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-card);
  border: 2px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(88, 166, 255, 0.1); }
}

.camera-placeholder h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-primary);
}

.camera-placeholder p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 300px;
}

/* ─── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-default);
  overflow-y: auto;
}

.sidebar-section {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-default);
}

.sidebar-section:last-child {
  border-bottom: none;
  flex: 1;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-badge {
  background: var(--bg-tertiary);
  color: var(--accent-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-accent);
}

/* ─── Recognition Panel ────────────────────────────────────────────── */
#recognition-panel {
  min-height: 200px;
  transition: var(--transition-slow);
}

.recognition-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) 0;
  text-align: center;
}

.scan-animation {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(88, 166, 255, 0.2);
  animation: scanPulse 2s ease-out infinite;
}

.scan-ring.ring-2 { animation-delay: 0.5s; }
.scan-ring.ring-3 { animation-delay: 1s; }

@keyframes scanPulse {
  0% { transform: scale(0.8); opacity: 1; border-color: rgba(88, 166, 255, 0.4); }
  100% { transform: scale(1.4); opacity: 0; border-color: transparent; }
}

.scan-icon {
  font-size: 1.8rem;
  z-index: 1;
}

.idle-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.idle-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Recognition result */
.recognition-result {
  animation: slideInUp 0.4s var(--transition-spring);
}

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

.result-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.result-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--accent-green);
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.3);
  flex-shrink: 0;
}

.result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-result {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
}

.result-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 8px var(--accent-green);
}

.result-meta {
  flex: 1;
  min-width: 0;
}

.result-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.result-confidence {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.confidence-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease-out;
}

.confidence-text {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.result-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

/* ─── Action Grid ──────────────────────────────────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.action-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-btn-icon {
  font-size: 1.5rem;
}

.action-btn-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.action-info:hover:not(:disabled) { border-color: var(--accent-blue); box-shadow: 0 0 15px rgba(88, 166, 255, 0.2); }
.action-website:hover:not(:disabled) { border-color: var(--accent-purple); box-shadow: 0 0 15px rgba(188, 140, 255, 0.2); }
.action-video:hover:not(:disabled) { border-color: var(--accent-cyan); box-shadow: 0 0 15px rgba(57, 208, 216, 0.2); }
.action-payment:hover:not(:disabled) { border-color: var(--accent-green); box-shadow: 0 0 15px rgba(63, 185, 80, 0.2); }

/* ─── Profile Cards ────────────────────────────────────────────────── */
.profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: var(--transition-base);
}

.profile-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-accent);
}

.profile-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.profile-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-card);
  border: 1px solid var(--border-accent);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-blue);
}

.profile-card-info {
  flex: 1;
  min-width: 0;
}

.profile-card-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-samples {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-card-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-card-delete:hover {
  color: var(--accent-red);
  background: rgba(248, 81, 73, 0.1);
}

.empty-profiles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) 0;
  text-align: center;
}

.empty-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.empty-profiles p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.empty-hint {
  font-size: 0.75rem !important;
}

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-glow);
  color: white;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.4);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 2px 8px rgba(63, 185, 80, 0.3);
}

.btn-success:hover {
  box-shadow: 0 4px 16px rgba(63, 185, 80, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 81, 73, 0.25);
}

.btn-icon { font-size: 1rem; }

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg) translateX(-100%);
  transition: 0.6s;
}

.btn-glow:hover::after {
  transform: rotate(45deg) translateX(100%);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.78rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Form Elements ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.label-icon {
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-base);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

/* ─── Modal System ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-base);
  padding: var(--space-lg);
}

.modal-overlay.modal-visible {
  opacity: 1;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.92) translateY(20px);
  transition: transform var(--transition-spring);
}

.modal-overlay.modal-visible .modal {
  transform: scale(1) translateY(0);
}

.modal-lg {
  max-width: 600px;
}

.modal-video {
  max-width: 800px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: rgba(248, 81, 73, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.modal-body {
  padding: var(--space-lg);
}

/* ─── Registration Modal ──────────────────────────────────────────── */
.registration-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.registration-preview {
  display: flex;
  justify-content: center;
}

.preview-image-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(57, 208, 216, 0.2);
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-weight: 500;
}

/* ─── Profile Info Modal ──────────────────────────────────────────── */
.profile-info-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.profile-info-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-accent);
  flex-shrink: 0;
}

.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-lg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: white;
}

.profile-info-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.profile-info-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-info-bio {
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.profile-info-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.detail-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}

.detail-icon { font-size: 1rem; }
.detail-value {
  font-size: 0.85rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* ─── Video Player Modal ──────────────────────────────────────────── */
.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

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

/* ─── Payment Modal ───────────────────────────────────────────────── */
.payment-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
}

.payment-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.payment-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-xs);
}

.payment-amount-display {
  text-align: right;
}

.payment-currency {
  font-size: 1rem;
  color: var(--accent-green);
  font-weight: 600;
}

.payment-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-green);
}

.payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.payment-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--space-sm);
}

.payment-form .btn {
  width: 100%;
  padding: var(--space-md);
  font-size: 0.95rem;
  margin-top: var(--space-sm);
}

/* ─── Toast Notifications ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  transform: translateX(120%);
  transition: transform var(--transition-spring);
  pointer-events: auto;
  max-width: 380px;
}

.toast-visible {
  transform: translateX(0);
}

.toast-icon { font-size: 1.1rem; }
.toast-message {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.toast-info { border-left: 3px solid var(--accent-blue); }
.toast-success { border-left: 3px solid var(--accent-green); }
.toast-warning { border-left: 3px solid var(--accent-orange); }
.toast-error { border-left: 3px solid var(--accent-red); }

/* ─── Loading Screen ───────────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  z-index: 5000;
  transition: opacity 0.5s ease;
}

#loading-screen.loading-fadeout {
  opacity: 0;
}

.loading-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  animation: loadingPulse 2s ease-in-out infinite;
  box-shadow: var(--shadow-glow-strong);
}

@keyframes loadingPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(88, 166, 255, 0.3); }
  50% { transform: scale(1.08); box-shadow: 0 0 50px rgba(88, 166, 255, 0.5); }
}

.loading-info {
  text-align: center;
}

.loading-info h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.loading-progress {
  width: 240px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

#loading-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-glow);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ─── Spinner ──────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

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

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .sidebar {
    border-left: none;
    border-top: 1px solid var(--border-default);
    max-height: 40vh;
    overflow-y: auto;
  }

  .camera-viewport {
    min-height: 50vh;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: var(--space-sm) var(--space-md);
  }

  .app-logo h1 {
    font-size: 1.1rem;
  }

  .modal {
    margin: var(--space-sm);
    max-height: 90vh;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Scrollbar ────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

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

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

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