/* ============================================
   HỆ THỐNG CHẤM CÔNG QR - CHECKIN STYLESHEET
   ============================================ */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --info-light: #cffafe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Card */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #0891b2; }

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-group label i {
  color: var(--primary);
  font-size: 0.8rem;
}

/* Alert System */
.alert-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 350px;
  pointer-events: none;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  cursor: pointer;
  pointer-events: auto;
}

.alert i { flex-shrink: 0; }

.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-error { background: var(--danger-light); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-light); color: #155e75; border-left: 4px solid var(--info); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   CHECKIN PAGE
   ============================================ */
.checkin-container {
  max-width: 500px;
  margin: 2rem auto;
}

.checkin-logo {
  text-align: center;
  padding: 2rem 0;
}

.checkin-logo i {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
}

.checkin-logo h1 {
  font-size: 1.5rem;
  color: var(--gray-800);
}

.checkin-logo p {
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.time-display {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.time-value {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.time-date {
  font-size: 1rem;
  opacity: 0.9;
}

.checkin-card {
  padding: 1.5rem;
}

.checkin-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.checkin-select {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1rem;
}

.checkin-select:focus {
  border-color: var(--primary);
}

.checkin-select.selected-highlight {
  background: #dbeafe;
  border-color: #2563eb;
}

.checkin-btn {
  width: 100%;
  padding: 1.2rem;
  font-size: 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.checkin-btn i {
  margin-right: 0.5rem;
}

.checkin-result {
  /* result section wrapper */
}

.checkin-success {
  text-align: center;
  padding: 2rem;
}

.checkin-checkmark {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 3rem;
  color: white;
  animation: popIn 0.5s ease;
}

.checkin-checkmark.success { background: var(--success); }
.checkin-checkmark.info { background: var(--info); }
.checkin-checkmark.warning { background: var(--warning); }

.checkin-success h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.checkin-success p {
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.checkin-details {
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: left;
}

.checkin-details p {
  margin: 0.3rem 0;
  color: var(--gray-700);
}

@keyframes popIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Connection Status */
.connection-status {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-800);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 9999;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.connection-status.visible {
  transform: translateX(-50%) translateY(0);
}

.connection-status.online {
  background: var(--success);
}

.connection-status.offline {
  background: var(--danger);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 768px) {
  .checkin-container {
    margin: 1rem auto;
    padding: 0.5rem;
  }
  
  .time-value {
    font-size: 2.5rem;
  }
  
  .checkin-logo i {
    font-size: 3rem;
  }
  
  .checkin-btn {
    padding: 1rem;
    font-size: 1.1rem;
  }
}
