/* ==========================================================================
   MAJI (마지) — SMART WEDDING RECEPTION & HOSPITALITY SYSTEM
   Design System & Styling (ui-ux-pro-max Luxury Boarding Pass Spec)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  /* Surface & Background (Textured Fine Paper) */
  --bg-color: #FAF9F7;
  --bg-cream: #F5F2EC;
  --card-bg: #FFFFFF;

  /* Typography Colors (Warm Sum-i Ink Charcoal) */
  --primary: #181716;
  --text-main: #282624;
  --text-secondary: #5C5852;
  --text-muted: #8E8880;

  /* Classic Hot-Stamping Gold Tone (Understated & Elegant) */
  --gold: #9E7B3B;
  --gold-light: #F7F3EA;
  --gold-mid: #B38E46;
  --gold-dark: #785A20;
  --gold-gradient: linear-gradient(135deg, #B38E46 0%, #D4AF60 50%, #9E7B3B 100%);
  --gold-gradient-soft: linear-gradient(135deg, #A88644 0%, #8E6C2D 100%);
  --gold-border: rgba(158, 123, 59, 0.28);
  --gold-glow: 0 4px 16px rgba(158, 123, 59, 0.12);

  /* Functional Accents */
  --border: #E5E1D8;
  --border-subtle: #EFECE5;
  --success: #276738;
  --success-bg: #EAF4ED;
  --success-border: #B8DFC2;
  --danger: #B83232;
  --danger-bg: #FDF0F0;

  /* Geometry & Elevation */
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(24, 23, 22, 0.04);
  --shadow-lg: 0 18px 44px -8px rgba(120, 90, 32, 0.12), 0 0 0 1px rgba(158, 123, 59, 0.12);
  --shadow-pass: 0 20px 48px -10px rgba(32, 28, 22, 0.12), 0 0 0 1px rgba(158, 123, 59, 0.2);
}

/* Base Reset & Smoothness */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  /* Authentic fine textured stationery backdrop */
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(247, 243, 234, 0.6) 0%, transparent 70%),
    linear-gradient(180deg, #FAF9F7 0%, #F5F2EC 100%);
  background-attachment: fixed;
}

/* Layout Containers */
.mobile-wrapper {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 20px calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

.admin-wrapper {
  max-width: 1024px;
  margin: 0 auto;
  padding: 32px 24px calc(60px + env(safe-area-inset-bottom, 0px));
}

/* ==========================================================================
   Header & Editorial Branding
   ========================================================================== */
.brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-eyebrow {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 4px;
}

.brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  line-height: 1.2;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ==========================================================================
   Standard Card Styles
   ========================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: #FAF8F5;
  color: var(--primary);
  transition: all 0.2s ease;
  min-height: 48px;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(179, 137, 71, 0.16);
}

.form-input::placeholder {
  color: #B5B0A6;
}

/* Quantity Selector (Segmented Luxury Control) */
.count-selector {
  display: flex;
  gap: 8px;
}

.count-btn {
  flex: 1;
  padding: 13px 0;
  min-height: 48px;
  border: 1px solid var(--border);
  background: #FAF8F5;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.count-btn:hover {
  border-color: var(--gold-border);
  background: #F7F3EB;
}

.count-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(26, 25, 24, 0.18);
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  min-height: 52px;
  padding: 15px 20px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 22px rgba(26, 25, 24, 0.14);
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-gold {
  background: var(--gold-gradient-soft);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(164, 127, 59, 0.25);
}

.btn-gold:hover {
  filter: brightness(1.03);
}

/* ==========================================================================
   Luxury VIP Boarding Pass (The Core Piece)
   ========================================================================== */
.vip-pass {
  background: #FFFFFF;
  border: 1px solid rgba(179, 137, 71, 0.3);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-pass);
  position: relative;
  transition: transform 0.25s ease;
}

/* Boarding Pass Header */
.vip-pass-header {
  background: linear-gradient(145deg, #1A1918 0%, #282520 100%);
  color: #FFFFFF;
  padding: 26px 22px 22px;
  text-align: center;
  position: relative;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

.vip-pass-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
}

.pass-eyebrow {
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 600;
  color: #D4AF60;
  margin-bottom: 4px;
}

.pass-couple {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #FAF6ED;
  line-height: 1.2;
}

.pass-venue {
  font-size: 12px;
  color: rgba(250, 246, 237, 0.75);
  margin-top: 4px;
}

/* Boarding Pass Body */
.vip-pass-body {
  padding: 26px 20px 24px;
  text-align: center;
  background: #FFFFFF;
}

.pass-guest-label {
  font-size: 11px;
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.pass-guest-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.pass-guest-rel {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 600;
  margin-top: 2px;
}

/* Wax Seal Style Meal Count Badge */
.pass-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--gold-light);
  border: 1px solid rgba(179, 137, 71, 0.35);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-dark);
  margin: 18px 0;
  box-shadow: 0 2px 8px rgba(179, 137, 71, 0.1);
}

.pass-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

/* Perforated Line with Side Notches (Realistic Cutout Ticket) */
.perforated-container {
  position: relative;
  margin: 14px 0 16px;
}

.perforated-line {
  border-top: 2px dashed rgba(179, 137, 71, 0.3);
  position: relative;
}

.perforated-line::before,
.perforated-line::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 24px;
  height: 24px;
  background-color: var(--bg-color);
  border-radius: 50%;
  box-shadow: inset 0 0 4px rgba(40, 32, 18, 0.08);
}

.perforated-line::before { left: -32px; }
.perforated-line::after { right: -32px; }

/* Scannable QR Container with Gold Framing */
.barcode-box {
  background: #FAF8F4;
  border: 1px solid rgba(179, 137, 71, 0.22);
  border-radius: 16px;
  padding: 18px 16px;
  margin: 16px 0 12px;
  position: relative;
}

.qr-frame {
  background: #FFFFFF;
  padding: 12px;
  border-radius: 14px;
  display: inline-block;
  box-shadow: 0 6px 16px rgba(40, 32, 18, 0.06);
  border: 1px solid #ECE7DC;
  position: relative;
}

/* Gold Corner Accents */
.qr-frame::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  border-top-left-radius: 4px;
}

.qr-frame::after {
  content: "";
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  border-bottom-right-radius: 4px;
}

.barcode-num {
  font-family: 'Montserrat', monospace;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--primary);
  margin-top: 12px;
}

/* ==========================================================================
   Live Security Verification Pulse (Anti-Screenshot Dynamic Bar)
   ========================================================================== */
.live-security-bar {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(46, 125, 50, 0.08);
  border: 1px solid rgba(46, 125, 50, 0.25);
  border-radius: 30px;
  padding: 7px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: 0.8px;
  margin-top: 10px;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2E7D32;
  box-shadow: 0 0 8px #2E7D32;
  animation: live-pulse-ring 1.8s ease-in-out infinite;
}

@keyframes live-pulse-ring {
  0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 0 7px rgba(46, 125, 50, 0); }
  100% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

/* Status Tags */
.tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tag.pending { background: #FFF4D3; color: #9A6B00; border: 1px solid #FFE7A0; }
.tag.approved { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.tag.used { background: #EFEFEF; color: #666666; border: 1px solid #E0E0E0; }
.tag.rejected { background: var(--danger-bg); color: var(--danger); border: 1px solid #FFCDD2; }

/* Status Banners */
.status-banner {
  padding: 16px;
  border-radius: 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  line-height: 1.5;
}

.status-banner.waiting {
  background: #FFFDF5;
  border: 1px solid #FFEBAA;
  color: #8C6600;
}

.status-banner.restore {
  background: #F4F7FF;
  border: 1px solid #D5E2FF;
  color: #1D4ED8;
}

/* Gold Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(179, 137, 71, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Admin Dashboard & Reception Tablet
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.stat-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ticket-table th,
.ticket-table td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid #F2EEE8;
  font-size: 14px;
}

.ticket-table th {
  background: #FAF8F5;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.btn-sm {
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  touch-action: manipulation;
}

.btn-sm:hover { opacity: 0.9; }
.btn-sm:active { transform: scale(0.97); }
.btn-approve { background: var(--success); color: #FFFFFF; }
.btn-reject { background: var(--danger); color: #FFFFFF; }

/* PIN Lock Modal */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 25, 24, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.pin-card {
  background: #FFFFFF;
  border-radius: 24px;
  max-width: 360px;
  width: 100%;
  padding: 36px 26px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(179, 137, 71, 0.2);
}

.pin-input {
  font-family: 'Montserrat', monospace;
  font-size: 32px;
  letter-spacing: 14px;
  text-align: center;
  width: 200px;
  margin: 20px auto;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  outline: none;
  font-weight: 800;
  background: #FAF8F5;
}

/* Luxury Glass & Surface Utilities */
.luxury-glass {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(179, 137, 71, 0.22);
  box-shadow: 0 16px 40px rgba(40, 32, 18, 0.08);
}

.luxury-glass-dark {
  background: rgba(26, 24, 22, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* Metric Cards Luxury */
.metric-card-lux {
  background: #FFFFFF;
  border: 1px solid rgba(179, 137, 71, 0.2);
  border-radius: 18px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(36, 30, 20, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card-lux:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(179, 137, 71, 0.12);
}

.metric-card-lux::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient-soft);
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-pill.pending {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}

.status-pill.approved {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.status-pill.used {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.status-pill.rejected {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

/* Toast Feedback */
.toast-notice {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1C1917;
  color: #FFF;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--gold);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
