/* -------------------------------------------------------------
 * Theme Configuration & Custom Variables (Premium Dark/Glassmorphism)
 * ------------------------------------------------------------- */
:root {
  --font-title: 'Outfit', 'Sarabun', sans-serif;
  --font-body: 'Sarabun', sans-serif;

  /* Colors (PRINC Group Theme: Navy Blue, Sky Blue, and Gold) */
  --bg-primary: #091024;
  --bg-card: rgba(14, 26, 56, 0.65);
  --bg-card-hover: rgba(22, 38, 77, 0.8);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.5);

  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #718096;

  --accent-cyan: #38bdf8;          /* Brand Light Blue */
  --accent-purple: #1d4ed8;        /* Brand Dark Blue */
  --accent-gold: #e2b93c;          /* Brand Gold/Yellow */
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #1d4ed8 100%);
  --accent-gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
  --gold-gradient: linear-gradient(135deg, #e2b93c 0%, #c19328 100%);
  
  --success-color: #10b981;
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --danger-color: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);

  /* Shadows & Blurs */
  --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --glass-blur: blur(16px);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* -------------------------------------------------------------
 * Global Reset & Background Styling
 * ------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Glowing Background Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}

.bg-glow-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  top: -100px;
  right: -50px;
  animation: float 25s infinite alternate ease-in-out;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-gold);
  bottom: -150px;
  left: -100px;
  animation: float 30s infinite alternate-reverse ease-in-out;
  opacity: 0.15;
}

.bg-glow-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-purple);
  top: 40%;
  left: 45%;
  animation: float 20s infinite alternate ease-in-out;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.1); }
  100% { transform: translate(-20px, -40px) scale(0.9); }
}

/* -------------------------------------------------------------
 * Application Layout Container
 * ------------------------------------------------------------- */
.app-container {
  width: 100%;
  max-width: 650px;
  padding: 24px;
  margin: 40px auto;
  z-index: 10;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-area {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease;
}

.logo-area:hover {
  transform: translateY(-2px);
}

.company-logo {
  max-height: 48px;
  width: auto;
  display: block;
}

.main-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-weight: 300;
  font-size: 15px;
}

/* -------------------------------------------------------------
 * Premium Glassmorphic Check-in Card
 * ------------------------------------------------------------- */
.checkin-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.checkin-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* Helper Elements */
.number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--gold-gradient);
  color: #0b1120;
  border-radius: 50%;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 14px;
  margin-right: 8px;
  box-shadow: 0 2px 8px rgba(226, 185, 60, 0.3);
}

.section-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.sub-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

/* -------------------------------------------------------------
 * Form Input Elements (Styled Custom Text Inputs)
 * ------------------------------------------------------------- */
.input-section {
  margin-bottom: 24px;
}

.id-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.id-input-wrapper .input-icon {
  position: absolute;
  left: 18px;
  color: var(--text-secondary);
  font-size: 18px;
  pointer-events: none;
  transition: color 0.3s ease;
}

.id-input-wrapper input {
  width: 100%;
  padding: 16px 56px 16px 52px;
  background: rgba(10, 15, 29, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

.id-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.id-input-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
  background: rgba(10, 15, 29, 0.8);
}

.id-input-wrapper input:focus + .input-icon {
  color: var(--accent-cyan);
}

.search-icon-btn {
  position: absolute;
  right: 8px;
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  color: var(--bg-primary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.search-icon-btn:hover {
  transform: scale(1.05);
}

.search-icon-btn:active {
  transform: scale(0.95);
}

.help-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-left: 4px;
}

/* -------------------------------------------------------------
 * Custom Dropdown / Select Option
 * ------------------------------------------------------------- */
.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.select-wrapper select {
  width: 100%;
  padding: 16px 48px 16px 52px;
  background: rgba(10, 15, 29, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-wrapper select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.select-icon {
  position: absolute;
  left: 18px;
  font-size: 18px;
  color: var(--text-secondary);
  pointer-events: none;
}

.select-arrow {
  position: absolute;
  right: 18px;
  font-size: 14px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: transform 0.3s ease;
}

.select-wrapper select:focus ~ .select-arrow {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

/* Course details container */
.course-meta-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta-item i {
  font-size: 20px;
  color: var(--accent-cyan);
  opacity: 0.9;
}

.meta-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* -------------------------------------------------------------
 * Employee Details (Bento Grid Layout)
 * ------------------------------------------------------------- */
.details-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}

.sub-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.info-item {
  background: rgba(10, 15, 29, 0.4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.info-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.highlight-value {
  font-family: var(--font-title);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* -------------------------------------------------------------
 * Action Buttons
 * ------------------------------------------------------------- */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0, 242, 254, 0.25);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.submit-btn:hover {
  background: var(--accent-gradient-hover);
  box-shadow: 0 12px 35px rgba(0, 242, 254, 0.4);
  transform: translateY(-2px);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn:disabled {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* -------------------------------------------------------------
 * Skeleton Loading Shimmer Effect
 * ------------------------------------------------------------- */
.skeleton-container {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}

.skeleton-line {
  height: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.skeleton-line.title {
  width: 40%;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.skeleton-box {
  height: 58px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton-line::after,
.skeleton-box::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.04) 20%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* -------------------------------------------------------------
 * Alerts and Dialogue Banners
 * ------------------------------------------------------------- */
.alert-banner {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
  color: #ff8080;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-icon {
  font-size: 18px;
}

/* -------------------------------------------------------------
 * Success Modal overlay (Checkmark Animation)
 * ------------------------------------------------------------- */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.success-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  animation: zoom-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoom-in {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.success-icon-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #fff;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--success-color);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke: var(--success-color);
  stroke-linecap: round;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-linecap: round;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}

@keyframes scale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
  100% { box-shadow: inset 0px 0px 0px 40px var(--success-color); }
}

.success-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.success-message {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.success-summary {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 28px;
  text-align: left;
}

.summary-row {
  display: flex;
  margin-bottom: 8px;
  font-size: 14px;
}

.summary-row:last-child {
  margin-bottom: 0;
}

.sum-label {
  color: var(--text-muted);
  width: 90px;
  flex-shrink: 0;
}

.sum-val {
  color: var(--text-primary);
  font-weight: 500;
}

.sum-val.highlight {
  color: var(--accent-cyan);
}

.close-modal-btn {
  width: 100%;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* -------------------------------------------------------------
 * Helper Animations classes
 * ------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

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

.animate-slide-down {
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from { opacity: 0; height: 0; transform: translateY(-10px); overflow: hidden; }
  to { opacity: 1; height: auto; transform: translateY(0); }
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

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

/* Footer info styling */
.app-footer {
  text-align: center;
  margin-top: 36px;
  font-size: 12px;
  color: var(--text-muted);
}

.gas-link-info {
  margin-top: 6px;
  color: var(--text-muted);
  opacity: 0.8;
}

/* Responsive queries */
@media(max-width: 480px) {
  .checkin-card {
    padding: 24px;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .course-meta-card {
    grid-template-columns: 1fr;
  }
  .main-title {
    font-size: 26px;
  }
}
