/* ===== Universal Enrollment Styles ===== */
/* Shared styles for Management, Card, and Fingerprint enrollment pages */
/* Page-specific styles (including modals for management) are in their dedicated CSS files */

/* Table and form styles are now in components/table.css and components/form.css */

/* Table Wrap */
.table-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid #e0e0e0;
  animation: fadeIn 0.3s ease;
}

html.dark-mode .table-wrap {
  background: #2a2a2a;
  border-color: #555;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* Modern Input Fields */
.modern-input {
  font-size: 0.95rem;
  padding: var(--input-padding-y, 0.75rem) var(--input-padding-x, 1rem);
  min-height: var(--input-height, 44px);
  box-sizing: border-box;
}

html.dark-mode .modern-input {
  background-color: #2e2e2e;
  border: 1px solid #555;
  color: #fff;
}

html.dark-mode .modern-input:focus {
  border-color: #3399ff;
  box-shadow: 0 0 5px rgba(51, 153, 255, 0.3);
}

html.dark-mode .modern-input:disabled {
  background-color: #1a1a1a;
  border-color: #333;
  color: #999;
}

html.dark-mode .modern-input option {
  background-color: #2e2e2e;
  color: #fff;
}

/* Employee Code Input (Read-only field) */
.employee-code-input {
  background: #f5f5f5 !important;
}

html.dark-mode .employee-code-input {
  background-color: #1a1a1a !important;
  border-color: #333 !important;
  color: #bbb !important;
}

/* Card styles are now in components/card.css - using basic .card for this module */

/* Instructions Box */
.instructions {
  border-left: 4px solid #8bc34a;
  background: linear-gradient(135deg, rgba(139, 195, 74, 0.1), rgba(94, 129, 34, 0.05));
}

html.dark-mode .instructions {
  background: linear-gradient(135deg, rgba(139, 195, 74, 0.2), rgba(94, 129, 34, 0.1));
  border-left-color: #7ab82d;
}

.instructions h4 {
  margin-top: 0;
  color: #8bc34a;
}

html.dark-mode .instructions h4 {
  color: #8ec134;
}

.instructions ol {
  margin-bottom: 0;
}

.instructions li {
  margin-bottom: 0.5rem;
}

/* Welcome Box */
.welcome-box h3 {
  margin-top: 0;
  color: #8bc34a;
}

html.dark-mode .welcome-box h3 {
  color: #8ec134;
}

/* Loading Indicator */
.loading-indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(139, 195, 74, 0.3);
  border-top: 2px solid #8bc34a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Status Indicators (for card and fingerprint pages) */
#cardStatus,
#fpStatus {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Fingerprint Preview */
#fingerprintPreview {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Enrollment Page Padding */
  .enrollment-home,
  .enrollment-management,
  .enrollment-card,
  .enrollment-fingerprint {
    padding: 0.5rem;
  }

  /* Toolbar Responsive */
  .toolbar {
    flex-direction: column;
    align-items: stretch !important;
  }

  /* Table Responsive */
  .modern-table {
    font-size: 0.8rem;
  }

  .modern-table th,
  .modern-table td {
    padding: 4px 2px !important;
  }

  /* Input Responsive */
  .modern-input {
    font-size: 0.8rem;
    padding: 4px 6px;
  }
}

/* Very Small Screens */
@media (max-width: 600px) {
  .table-wrap {
    overflow-x: auto;
  }

  .modern-table {
    min-width: 700px;
  }
}

/* ===== Dropdown System (from modern-ui.css) ===== */
.dropdown-container { 
  position: relative; 
  display: inline-block; 
  overflow: visible; 
  width: 100%;
}

.dropdown-container .dropdown-toggle {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #374151;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-weight: 500;
  min-height: 44px;
  line-height: 1.2;
}

.dropdown-container .dropdown-toggle:hover {
  background: #f8fafc;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  border-color: #cbd5e1;
}

.dropdown-container.open .dropdown-toggle {
  border-color: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.1), 0 3px 8px rgba(0,0,0,0.12);
  background: #f1f5f9;
}

.dropdown-container .dropdown-toggle .arrow {
  opacity: 0.7;
  transition: transform 0.2s ease;
  font-size: 0.8rem;
  color: #64748b;
}

.dropdown-container.open .dropdown-toggle .arrow {
  transform: rotate(180deg);
  color: #475569;
}

.dropdown-container .dropdown-content {
  position: absolute;
  z-index: 3003;
  left: 0;
  right: 0;
  margin-top: 6px;
  background-color: #ffffff;
  color: #374151;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-height: 280px;
  overflow: auto;
  transform-origin: top center;
  transform: translateY(-6px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
}

.dropdown-container.open .dropdown-content {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dropdown-container .dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  transition: all 0.15s ease;
  color: #374151;
  position: relative;
  margin: 1px 0;
  user-select: none;
}

.dropdown-container .dropdown-item:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.dropdown-container .dropdown-item:active {
  background: #e2e8f0;
}

.dropdown-container .dropdown-item.selected {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 500;
}

/* Dark mode for dropdown-container */
html.dark-mode .dropdown-container .dropdown-toggle {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

html.dark-mode .dropdown-container .dropdown-toggle:hover {
  background: #334155;
  border-color: #64748b;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

html.dark-mode .dropdown-container.open .dropdown-toggle {
  border-color: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.2), 0 3px 8px rgba(0,0,0,0.4);
  background: #475569;
}

html.dark-mode .dropdown-container .dropdown-toggle .arrow {
  color: #94a3b8;
}

html.dark-mode .dropdown-container.open .dropdown-toggle .arrow {
  color: #cbd5e1;
}

html.dark-mode .dropdown-container .dropdown-content {
  background-color: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

html.dark-mode .dropdown-container .dropdown-item {
  color: #e2e8f0;
}

html.dark-mode .dropdown-container .dropdown-item:hover {
  background: #374151;
  color: #f1f5f9;
}

html.dark-mode .dropdown-container .dropdown-item:active {
  background: #475569;
}

html.dark-mode .dropdown-container .dropdown-item.selected {
  background: #374151;
  color: #f1f5f9;
}

/* Global backdrop for dropdown system */
.dropdown-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3000;
  display: none;
}
.dropdown-backdrop.show { 
  opacity: 1; 
  pointer-events: auto; 
  display: block;
}

/* ===== Modal Title (from modern-ui.css) ===== */
.modal-title {
    background: none;
    -webkit-text-fill-color: var(--header-color);
    border-bottom: none;
    padding-bottom: 0;
}

/* ===== Status Indicator (for JS-generated fingerprint status in management) ===== */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.active {
    background: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
}

.status-indicator.inactive {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}
