/* ==========================================================================
   USER PORTAL STYLES - USER.CSS
   Mobile-first, single-action PWA experience with tactile 3D scan button
   ========================================================================== */

.user-portal-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 32px;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* Botanical subtle backdrop graphics */
.user-floral-bg-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: radial-gradient(circle at 50% 0%, rgba(225, 235, 229, 0.7) 0%, rgba(250, 247, 242, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* User Portal Header (User info only - no admin links) */
.user-portal-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  padding-top: 10px;
}

.user-brand-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid var(--bg-card-border);
  padding: 8px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.user-brand-mini:hover {
  transform: translateY(-1px);
}

.user-brand-logo-img {
  height: 46px;
  width: auto;
  max-width: 185px;
  object-fit: contain;
  mix-blend-mode: multiply;
  display: block;
}

.user-greeting-card {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.user-welcome-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.user-display-name {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--sage-900);
  line-height: 1.2;
}

.user-shift-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sage-50);
  border: 1px solid var(--sage-200);
  color: var(--sage-800);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Live Clock Section */
.live-clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0 8px;
}

.live-time-display {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--sage-900);
  letter-spacing: -0.03em;
  line-height: 1;
}

.live-date-display {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* --- CENTER SCAN ACTION CONTAINER --- */
.scan-action-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  position: relative;
  z-index: 2;
}

/* Giant 3D Circular Blooming Scan Button */
.btn-scan-action {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: all var(--transition-normal);
  text-decoration: none;
  outline: none;
}

/* Scan-In State: Sage Blooming */
.btn-scan-in {
  background: radial-gradient(circle at 35% 30%, #76A28C 0%, #466C59 70%, #315141 100%);
  color: #FFFFFF;
  box-shadow: 
    0 8px 0 #233A2E,
    0 16px 30px rgba(51, 80, 67, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.35);
  animation: pulseBloom 3s infinite;
}

.btn-scan-in:hover:not(:disabled) {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 
    0 10px 0 #233A2E,
    0 20px 36px rgba(51, 80, 67, 0.4),
    inset 0 2px 6px rgba(255, 255, 255, 0.45);
}

.btn-scan-in:active:not(:disabled), .btn-scan-in.pressed {
  transform: translateY(6px) scale(0.98);
  box-shadow: 
    0 2px 0 #233A2E,
    0 6px 14px rgba(51, 80, 67, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Scan-Out State: Rose Blooming */
.btn-scan-out {
  background: radial-gradient(circle at 35% 30%, #EA7083 0%, #C84156 70%, #9B2639 100%);
  color: #FFFFFF;
  box-shadow: 
    0 8px 0 #6C1523,
    0 16px 30px rgba(183, 51, 74, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.35);
  animation: pulseRoseBloom 3s infinite;
}

.btn-scan-out:hover:not(:disabled) {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 
    0 10px 0 #6C1523,
    0 20px 36px rgba(183, 51, 74, 0.4),
    inset 0 2px 6px rgba(255, 255, 255, 0.45);
}

.btn-scan-out:active:not(:disabled), .btn-scan-out.pressed {
  transform: translateY(6px) scale(0.98);
  box-shadow: 
    0 2px 0 #6C1523,
    0 6px 14px rgba(183, 51, 74, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.scan-icon-wrapper {
  font-size: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.scan-btn-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.scan-btn-subtitle {
  font-size: 0.76rem;
  opacity: 0.9;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Completed State Card */
.completed-state-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--sage-300);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.completed-icon {
  font-size: 2.5rem;
  color: var(--sage-600);
}

/* --- Today's Punch History Timeline --- */
.user-punch-timeline-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 8px;
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.punch-label-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.punch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.punch-dot-in { background: var(--sage-500); box-shadow: 0 0 6px rgba(85, 126, 107, 0.4); }
.punch-dot-out { background: var(--rose-500); box-shadow: 0 0 6px rgba(210, 75, 98, 0.4); }

.punch-label-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sage-900);
}

.punch-time-val {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

/* --- PWA Install Banner --- */
.pwa-install-banner {
  width: 100%;
  background: var(--sage-50);
  border: 1px dashed var(--sage-400);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.pwa-info {
  display: flex;
  flex-direction: column;
}

.pwa-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--sage-900);
}

.pwa-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Botanical Footer Watermark */
.user-portal-footer {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ==========================================================================
   CAMERA QR SCANNER MODAL & RETICLE STYLES
   ========================================================================== */

.scanner-modal-dialog {
  max-width: 440px !important;
  padding: 0 !important;
  overflow: hidden;
  border-radius: var(--radius-xl) !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 20px 50px rgba(27, 44, 36, 0.35) !important;
}

.scanner-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
  background: #111A15;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Reticle & Viewfinder Frame */
.scanner-target-reticle {
  position: absolute;
  width: 210px;
  height: 210px;
  box-shadow: 0 0 0 4000px rgba(17, 26, 21, 0.6);
  border-radius: var(--radius-md);
  pointer-events: none;
}

.reticle-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid #769E89;
}

.reticle-corner.top-left {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 12px;
}

.reticle-corner.top-right {
  top: -2px;
  right: -2px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 12px;
}

.reticle-corner.bottom-left {
  bottom: -2px;
  left: -2px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 12px;
}

.reticle-corner.bottom-right {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 12px;
}

/* Animated Laser Line */
.scanner-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #A4D9BE 50%, transparent 100%);
  box-shadow: 0 0 10px #769E89, 0 0 20px rgba(118, 158, 137, 0.6);
  animation: scanLaserSweep 2s ease-in-out infinite alternate;
}

@keyframes scanLaserSweep {
  0% {
    top: 5%;
    opacity: 0.8;
  }
  100% {
    top: 95%;
    opacity: 0.8;
  }
}

/* Feedback Status Banner inside scanner */
.scanner-feedback-banner {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  padding: 8px 14px;
  background: rgba(27, 44, 36, 0.85);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
  z-index: 2;
}

.scanner-feedback-banner.feedback-error {
  background: rgba(183, 51, 74, 0.95);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
  animation: shakeAlert 0.4s ease;
}

.scanner-feedback-banner.feedback-success {
  background: rgba(66, 103, 86, 0.95);
  color: #FFFFFF;
  border-color: #A4D9BE;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Controls Toolbar */
.scanner-controls-toolbar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
  background: var(--bg-surface);
}

.btn-scanner-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 60px;
}

.btn-scanner-tool:hover {
  background: var(--sage-50);
  border-color: var(--sage-300);
  color: var(--sage-800);
}

.btn-scanner-tool.active {
  background: var(--sage-600);
  color: #FFFFFF;
  border-color: var(--sage-700);
}

.btn-tool-accent {
  background: var(--sage-50);
  border-color: var(--sage-300);
  color: var(--sage-800);
}
.btn-tool-accent:hover {
  background: var(--sage-500);
  color: #FFFFFF;
}
