/* ===== MODERN VISITOR MANAGEMENT SYSTEM ===== */
/* Premium Design with Glassmorphism & Neumorphism */

:root {
  /* Modern Color Palette */
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --primary-light: #4895ef;
  --secondary: #7209b7;
  --accent: #f72585;
  --success: #4cc9f0;
  --warning: #f9c74f;
  --danger: #f94144;
  --dark: #2b2d42;
  --light: #f8f9fa;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* Glassmorphism Effects */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: rgba(0, 0, 0, 0.1);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  --gradient-secondary: linear-gradient(135deg, #7209b7 0%, #560bad 100%);
  --gradient-accent: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  overflow-x: hidden;
  /* background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); */
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 20px 28px;
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  animation: slideDown 0.6s ease;
}

header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

#username {
  font-weight: 600;
  color: var(--gray-800);
  background: var(--gradient-glass);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

#logout-btn {
  background: var(--gradient-accent);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

#logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== CARD STYLES ===== */
.card {
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
  border: 1px solid var(--glass-border);
  transition: var(--transition-normal);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.6s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card h2 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary-light);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card h2::before {
  content: '';
  width: 8px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: inline-block;
}

/* ===== FORM STYLES ===== */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.95rem;
  padding-left: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: var(--transition-normal);
  background: var(--light);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
  transform: translateY(-2px);
}

/* ===== BUTTON STYLES ===== */
button {
  padding: 16px 32px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition-normal);
}

button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

button:hover::before {
  left: 100%;
}

button:active {
  transform: translateY(0);
}

.action-btn {
  padding: 12px 24px;
  font-size: 0.9rem;
}

.btn-edit {
  background: var(--gradient-secondary);
}

.btn-delete {
  background: var(--gradient-accent);
}

.export-btn {
  background: var(--gradient-primary);
}

/* ===== BADGE STYLES ===== */
#badge {
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--gradient-card);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

#badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--gradient-primary);
}

.badge-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--primary-light);
}

.badge-header h3 {
  font-size: 2rem;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-content {
  display: flex;
  margin-bottom: 28px;
  gap: 24px;
  align-items: center;
}

#badge-photo {
  width: 120px;
  height: 120px;
  border: 3px solid var(--primary-light);
  border-radius: var(--radius-lg);
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.badge-details {
  flex: 1;
}

.badge-details p {
  margin: 10px 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-details strong {
  color: var(--primary);
  min-width: 100px;
  font-weight: 600;
}

.badge-footer {
  text-align: center;
  border-top: 2px solid var(--gray-200);
  padding-top: 24px;
}

#badge-qr {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  background: var(--light);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* ===== DASHBOARD STATS ===== */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--gradient-primary);
  padding: 28px;
  border-radius: var(--radius-xl);
  text-align: center;
  color: white;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.stat-card h3 {
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

.stat-card span {
  font-size: 2.4rem;
  font-weight: 800;
  display: block;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--gray-200);
  background: var(--gradient-glass);
  border-radius: var(--radius-lg);
  padding: 8px;
  backdrop-filter: blur(10px);
}

.tab-btn {
  padding: 16px 32px;
  background: transparent;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  font-weight: 600;
  position: relative;
  transition: var(--transition-normal);
  border-radius: var(--radius-md);
  flex: 1;
  text-align: center;
}

.tab-btn.active {
  color: var(--primary);
  background: white;
  box-shadow: var(--shadow-sm);
}

.tab-btn.active::after {
  display: none;
}

.tab-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.5);
}

.tab-content {
  margin-top: 24px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-pane.active {
  display: block;
}

/* ===== TABLE STYLES - FIXED FOR ADMIN ===== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin: 24px 0;
  background: var(--gradient-card);
  width: 100%;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-width: 1000px; /* Ensure table doesn't collapse on small screens */
}

th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

th {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  position: sticky;
  top: 0;
  font-size: 0.95rem;
  padding: 18px 20px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: rgba(67, 97, 238, 0.03);
}

/* Specific fixes for admin table */
#admin-all-visits-table {
  width: 100%;
}

#admin-all-visits-table th,
#admin-all-visits-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
}

#admin-all-visits-table th {
  font-size: 0.95rem;
  padding: 16px;
}

/* ===== ADMIN STYLES ===== */
.admin-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  margin-top: 32px;
  width: 100%;
}

.sidebar {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  height: fit-content;
  color: white;
  position: sticky;
  top: 32px;
}

.sidebar h3 {
  color: white;
  margin-bottom: 24px;
  font-size: 1.4rem;
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 12px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: var(--transition-normal);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.sidebar a::before {
  content: '';
  width: 20px;
  height: 20px;
  background: currentColor;
  mask-size: cover;
  -webkit-mask-size: cover;
}

.sidebar a:hover, .sidebar a.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateX(8px);
}

.admin-content {
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
  width: 100%;
  overflow: hidden;
}

.admin-section {
  display: none;
  animation: fadeIn 0.5s ease;
  width: 100%;
}

.admin-section.active {
  display: block;
}

/* Specific fix for admin visits section */
#admin-visits {
  width: 100%;
  overflow: visible;
}

/* ===== FILTERS ===== */
.filter-options, .report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
  align-items: end;
  width: 100%;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.95rem;
}

/* ===== CAMERA STYLES ===== */
#camera-preview {
  width: 100%;
  max-width: 400px;
  margin: 12px 0;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#video {
  width: 100%;
  height: auto;
  background: var(--gray-900);
  display: block;
}

#photo-preview {
  width: 100%;
  max-width: 400px;
  margin: 12px 0;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#captured-photo {
  width: 100%;
  height: auto;
  display: block;
}

#capture-controls {
  margin: 16px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#capture-controls button {
  flex: 1;
  min-width: 120px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { transform: rotate(45deg) translateX(-100%); }
  100% { transform: rotate(45deg) translateX(200%); }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .admin-container {
    grid-template-columns: 250px 1fr;
    gap: 24px;
  }
  
  .admin-content {
    padding: 28px;
  }
}

@media (max-width: 1024px) {
  .admin-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .sidebar {
    position: static;
    order: 2;
  }
  
  .admin-content {
    order: 1;
  }
}

@media (max-width: 900px) {
  table {
    min-width: 800px;
  }
  
  th, td {
    padding: 14px 16px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 20px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 24px;
  }
  
  .badge-content {
    flex-direction: column;
    text-align: center;
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    width: 100%;
  }
  
  .filter-options, .report-filters {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    border-radius: var(--radius-lg);
    margin: 16px 0;
  }
  
  th, td {
    padding: 12px 14px;
    font-size: 0.85rem;
  }
  
  th {
    padding: 14px;
  }
}


.exit-options {
  display: flex;
  flex-direction: row;
  gap: 25px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.exit-option {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex: 1;
  min-width: 300px;
}

@media (max-width: 480px) {
  .card {
    padding: 20px;
  }
  
  .admin-content {
    padding: 20px;
  }
  
  button {
    padding: 14px 24px;
    font-size: 0.9rem;
  }
  
  #badge {
    padding: 24px;
  }
  
  .badge-header h3 {
    font-size: 1.6rem;
  }
  
  th, td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.no-results {
  text-align: center;
  padding: 48px;
  color: var(--gray-600);
  font-style: italic;
  background: var(--gradient-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

/* User form specific styles */
#user-role:invalid {
    color: var(--gray-600);
}

#user-role option {
    color: var(--dark);
}

#user-role option[value=""] {
    color: var(--gray-600);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== PRINT STYLES ===== */
@media print {
  body * {
    visibility: hidden;
  }
  #badge, #badge * {
    visibility: visible;
  }
  #badge {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
  }
  .no-print {
    display: none !important;
  }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-200);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ===== SPECIAL EFFECTS ===== */
.glass-effect {
  background: var(--gradient-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.neumorphism {
  border-radius: var(--radius-lg);
  background: #e0e5ec;
  box-shadow: 5px 5px 10px #b8bec5, -5px -5px 10px #ffffff;
}

.hover-lift {
  transition: var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ===== TABLE SPECIFIC FIXES ===== */
/* Ensure tables don't overflow their containers */
.admin-section .table-container {
  width: 100%;
  display: block;
  overflow-x: auto;
}

/* Fix for admin visits table specifically */
#admin-visits .table-container {
  margin: 20px 0;
}

#admin-all-visits-table {
  width: 100%;
  table-layout: auto;
}

#admin-all-visits-table th:nth-child(1) { width: 120px; } /* Visit ID */
#admin-all-visits-table th:nth-child(2) { width: 150px; } /* Name */
#admin-all-visits-table th:nth-child(3) { width: 120px; } /* Mobile */
#admin-all-visits-table th:nth-child(4) { width: 150px; } /* Organization */
#admin-all-visits-table th:nth-child(5) { width: 150px; } /* Host */
#admin-all-visits-table th:nth-child(6) { width: 120px; } /* Purpose */
#admin-all-visits-table th:nth-child(7) { width: 80px; }  /* Gate */
#admin-all-visits-table th:nth-child(8) { width: 160px; } /* Time In */
#admin-all-visits-table th:nth-child(9) { width: 160px; } /* Time Out */
#admin-all-visits-table th:nth-child(10) { width: 80px; } /* Status */
#admin-all-visits-table th:nth-child(11) { width: 100px; } /* Actions */

/* Responsive table fixes */
@media (max-width: 1200px) {
  #admin-all-visits-table th:nth-child(4),
  #admin-all-visits-table td:nth-child(4) {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


@media (max-width: 768px) {
  .exit-options {
    flex-direction: column;
  }
  
  .exit-option {
    min-width: 100%;
  }
}

/* ===== MODERN LOGIN PAGE STYLES ===== */
.login-container {
    display: flex;
    width: 100%;
    min-height: 600px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

.login-form {
    flex: 1;
    padding: 60px 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-logo {

    text-align: center;
    margin-bottom: 40px;
}

.login-logo h2 {
    color: #333;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-form-title {
    display: block;
    font-size: 24px;
    color: #333;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 600;
    position: relative;
}

.login-form-title::after {
    content: '';
    display: block;
    width: 12vw;
    height: 4px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    margin: 15px auto;
    border-radius: 2px;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
}

.symbol-input {
    font-size: 18px;
    color: #999;
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding-left: 15px;
    box-sizing: border-box;
    transition: all 0.4s;
}

.input-field {
    width: 100%;
    padding: 20px 15px 20px 45px;
    border: none;
    border-bottom: 2px solid #d9d9d9;
    font-size: 16px;
    color: #333;
    background: transparent;
    outline: none;
    transition: all 0.4s;
}

.input-field:focus {
    border-color: #4361ee;
}

.input-field:focus + .focus-input {
    visibility: visible;
    opacity: 1;
    transform: scale(1);
}

.input-field:focus + .focus-input + .symbol-input {
    color: #4361ee;
}

.focus-input {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s;
}

.focus-input::before {
    content: '';
    display: block;
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    transition: all 0.4s;
    transform: scaleX(0);
    transform-origin: left;
}

.input-field:focus + .focus-input::before {
    transform: scaleX(1);
}

.form-actions {
    margin-top: 40px;
}

.login-button {
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(67, 97, 238, 0.3);
}

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(67, 97, 238, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-image {
    flex: 1;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.8) 0%, rgba(58, 12, 163, 0.8) 100%), url('https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: linear-gradient(135deg, rgba(67, 97, 238, 0.9) 0%, rgba(58, 12, 163, 0.9) 100%); */
    background: linear-gradient(135deg, #fdfeff 0%, #0a2fe1 100%);
}

.login-image .image-overlay h2{
      display: flex;
    justify-content: center;
    align-items: center;
    height: 140vh;
    color: white;
}


.image-content {

    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 0 40px;
      animation: pulse 2s infinite alternate;
      box-shadow: 0 0 20px rgb(233 226 9);
        background: linear-gradient(135deg, rgba(67, 97, 238, 0.9) 0%, rgba(58, 12, 163, 0.9) 100%);
}

.image-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.image-content p {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .login-form {
        padding: 40px 30px;
        order: 2;
    }
    
    .login-image {
        min-height: 300px;
        order: 1;
    }
    
    .image-content {
        padding: 0 20px;
    }
    
    .image-content h3 {
        font-size: 24px;
    }
    
    .image-content p {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .login-form {
        padding: 30px 20px;
    }
    
    .login-form-title {
        font-size: 20px;
        margin-bottom: 30px;
    }
    
    .input-field {
        padding: 15px 15px 15px 45px;
    }
    
    .login-button {
        height: 50px;
        font-size: 14px;
    }
}

/* Animation for login form */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form {
    animation: fadeInUp 0.6s ease-out;
}

.login-image {
    animation: fadeInUp 0.8s ease-out;
}

/* Loading animation for login button */
.login-button.loading {
    position: relative;
    color: transparent;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== VISITOR FORM STYLES ===== */
.visitor-form-container {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.visitor-form-content {
    flex: 1;
    background: white;
    padding: 40px;
    overflow-y: auto;
}

.visitor-preview {
    width: 400px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.form-logo h2 {
    color: #333;
    font-size: 28px;
    font-weight: 700;
}

.form-header p {
    color: #666;
    font-size: 16px;
}

.form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #9fcad7;
    border-radius: 16px;
    border: 1px solid #e3e8ff;
}

.form-section h3 {
    color: #4361ee;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    flex: 1;
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    color: #666;
    z-index: 2;
}

.input-with-icon input,
.input-with-icon select {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e3e8ff;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
}

.otp-btn {
    padding: 15px 20px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.otp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* Photo Section */
.photo-section {
    text-align: center;
}

#camera-preview {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#video {
    width: 100%;
    height: 200px;
    background: #000;
    display: block;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-circle {
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

#photo-preview {
    margin: 0 auto 20px;
    max-width: 200px;
}

#captured-photo {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.photo-actions {
    margin-top: 10px;
}

/* Chips Container */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 40px;
}

.gadget-chip {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gadget-chip .remove {
    cursor: pointer;
    font-weight: bold;
    padding: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Buttons */
.action-btn {
    padding: 12px 20px;
    background: #e3e8ff;
    color: #4361ee;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: #4361ee;
    color: white;
}

.action-btn.primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
}

.action-btn.small {
    padding: 8px 15px;
    font-size: 12px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(67, 97, 238, 0.3);
}

/* Badge Preview */
.badge-design {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.badge-shape {
    border: 2px solid #4361ee;
    border-radius: 12px;
    overflow: hidden;
}

.badge-header {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    padding: 15px;
    text-align: center;
    position: relative;
}

.badge-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.company-logo {
    position: absolute;
    top: 10px;
    right: 15px;
    background: white;
    color: #4361ee;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.badge-content {
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.photo-placeholder {
    width: 60px;
    height: 60px;
    background: #f8f9ff;
    border: 2px dashed #4361ee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4361ee;
}

.visitor-details {
    flex: 1;
}

.detail-row {
    display: flex;
    margin-bottom: 5px;
    font-size: 12px;
}

.detail-row .label {
    font-weight: 600;
    color: #333;
    min-width: 60px;
}

.detail-row .value {
    color: #666;
    flex: 1;
}

.badge-footer {
    background: #f8f9ff;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e3e8ff;
}

.barcode {
    height: 40px;
    background: #333;
    margin-bottom: 10px;
    border-radius: 4px;
}

.visit-id {
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .visitor-preview {
        display: none;
    }
}

@media (max-width: 768px) {
    .visitor-form-content {
        padding: 20px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    #camera-preview {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .visitor-form-content {
        padding: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .input-with-icon input,
    .input-with-icon select {
        padding: 12px 12px 12px 40px;
    }
    
    .action-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visitor-form-container {
    animation: fadeIn 0.6s ease-out;
}

/* Loading states */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hidden elements */
.hidden {
    display: none !important;
}