@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-main: #090d16;
  --bg-surface: #121824;
  --bg-card: rgba(18, 24, 36, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --primary-hover: #4f46e5;
  --accent-gold: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.15);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  --sidebar-width: 260px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #272f3d;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3e4b5e;
}

/* Sidebar Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.08);
}

/* Sidebar Navigation Link */
.nav-menu {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  flex: 1;
}

.nav-menu-item {
  margin-bottom: 0.5rem;
}

.nav-menu-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-menu-link:hover, .nav-menu-link.active {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

.nav-menu-link svg {
  margin-right: 0.75rem;
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.nav-menu-link:hover svg {
  transform: translateX(3px);
}

/* Brand styling */
.brand {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

/* Header/User section */
.user-profile-stub {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-name-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--primary);
  background-color: var(--primary-glow);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  display: inline-block;
  font-weight: 700;
}

/* Styled Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control, .form-select {
  background-color: rgba(9, 13, 22, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
  background-color: rgba(9, 13, 22, 0.8);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  color: var(--text-primary);
  outline: none;
}

.btn-primary {
  background-color: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Stat Cards */
.stat-card-value {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 700;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.icon-blue { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.icon-purple { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.icon-green { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
.icon-gold { background-color: var(--accent-gold-glow); color: var(--accent-gold); }

/* Premium Tables */
.table-responsive {
  border-radius: 16px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.premium-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background-color: var(--bg-surface);
}

.premium-table th {
  background-color: rgba(9, 13, 22, 0.4);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.premium-table td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.925rem;
}

.premium-table tr:last-child td {
  border-bottom: none;
}

.premium-table tr {
  transition: background-color 0.2s ease;
}

.premium-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.custom-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 600;
}

.badge-success { background-color: var(--success-glow); color: var(--success); }
.badge-danger { background-color: var(--danger-glow); color: var(--danger); }
.badge-warning { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* QR Scanner Page Styles */
.scanner-viewport {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  background-color: #020617;
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scanning bounds overlay */
.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scanner-box {
  width: 250px;
  height: 250px;
  border: 2px solid #818cf8;
  position: relative;
  box-shadow: 0 0 0 9999px rgba(9, 13, 22, 0.6);
  border-radius: 16px;
}

/* Scanner Laser Line Animation */
.scanner-laser {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  box-shadow: 0 0 12px 3px var(--primary);
  animation: scan-animation 2s linear infinite;
}

@keyframes scan-animation {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* Scanner corners */
.scanner-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 4px solid var(--primary);
  pointer-events: none;
}

.corner-tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-top-left-radius: 12px; }
.corner-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-top-right-radius: 12px; }
.corner-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-bottom-left-radius: 12px; }
.corner-br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-bottom-right-radius: 12px; }

/* Status result overlay screen */
.scan-status-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scan-status-screen.active {
  opacity: 1;
  pointer-events: auto;
}

.status-screen-green { background-color: rgba(16, 185, 129, 0.92); }
.status-screen-yellow { background-color: rgba(245, 158, 11, 0.95); }
.status-screen-red { background-color: rgba(239, 68, 68, 0.95); }

.status-icon-container {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scan-status-screen.active .status-icon-container {
  transform: scale(1);
}

.status-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
}

.status-message {
  font-size: 1.1rem;
  opacity: 0.9;
  text-align: center;
  max-width: 80%;
}

/* Mobile responsive hamburger menu button */
.sidebar-toggle {
  display: none;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 8px;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 5rem;
  }
  
  .sidebar-toggle {
    display: block;
  }
}

/* Glassmorphism Login Container */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
}

.login-bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.login-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background-color: var(--primary);
  top: -100px;
  right: -100px;
}

.shape-2 {
  width: 350px;
  height: 350px;
  background-color: #8b5cf6;
  bottom: -100px;
  left: -100px;
}