/**
 * Workbobo AI Job Hunter — Universal Skeleton Lazy Loader System
 * Provides silky smooth shimmering placeholders for all screens,
 * components, tables, metrics, and page transitions.
 */

:root {
  --skel-bg-base: #f1f4f9;
  --skel-shimmer-highlight: #ffffff;
  --skel-line: #e2e8f0;
  --skel-border-radius: 8px;
  --skel-duration: 1.4s;
}

/* ========================================================
   1. CORE SHIMMER ANIMATION & UTILITIES
   ======================================================== */
@keyframes workbobo-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(226, 232, 240, 0.65) 0%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(226, 232, 240, 0.65) 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: workbobo-shimmer var(--skel-duration) infinite ease-in-out !important;
  border-radius: var(--skel-border-radius);
  position: relative;
  overflow: hidden;
  color: transparent !important;
  user-select: none !important;
  border: none !important;
  pointer-events: none !important;
}

.skeleton * {
  visibility: hidden !important;
}

/* Specific component placeholders */
.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 0.4rem;
  border-radius: 4px;
}

.skeleton-text.sm {
  height: 10px;
  width: 60%;
}

.skeleton-text.xs {
  height: 8px;
  width: 40%;
}

.skeleton-title {
  height: 22px;
  width: 70%;
  margin-bottom: 0.6rem;
  border-radius: 6px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.skeleton-badge {
  height: 20px;
  width: 75px;
  border-radius: 12px;
  display: inline-block;
}

.skeleton-btn {
  height: 40px;
  width: 120px;
  border-radius: 10px;
}

.skeleton-card {
  background: #ffffff;
  border: 1px solid var(--skel-line);
  border-radius: 14px;
  padding: 1.25rem;
}

/* ========================================================
   2. UNIVERSAL FULL-SCREEN SKELETON LAZY LOADER OVERLAY
   ======================================================== */
.screen-skeleton-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #fbfbfd;
  display: flex;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.screen-skeleton-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Desktop Sidebar Skeleton */
.skel-sidebar {
  width: 250px;
  background: #ffffff;
  border-right: 1px solid var(--skel-line);
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex-shrink: 0;
}

.skel-brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.skel-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.skel-nav-item {
  height: 40px;
  border-radius: 10px;
  width: 100%;
}

.skel-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--skel-line);
}

/* App Main Body Skeleton */
.skel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow-y: auto;
  min-width: 0;
}

.skel-topbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--skel-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  flex-shrink: 0;
}

.skel-content-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Banner Skeleton */
.skel-banner {
  height: 120px;
  border-radius: 16px;
  width: 100%;
}

/* 4-Stat Cards Skeleton Grid */
.skel-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.skel-stat-card {
  height: 108px;
  background: #ffffff;
  border: 1px solid var(--skel-line);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Table / Feed Card Skeleton */
.skel-table-card {
  background: #ffffff;
  border: 1px solid var(--skel-line);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skel-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 1rem;
}

.skel-table-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skel-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f8fafc;
}

/* Mobile Bottom Navigation Bar Skeleton */
.skel-mobile-bottom-nav {
  display: none;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid var(--skel-line);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-around;
}

.skel-bottom-tab {
  width: 44px;
  height: 40px;
  border-radius: 8px;
}

/* ========================================================
   3. AUTH & ONBOARDING / SINGLE CARD SKELETON
   ======================================================== */
.skel-auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 1.5rem;
  background: #faf9f6;
}

.skel-auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--skel-line);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

/* ========================================================
   4. INLINE DISPATCH TABLE SKELETON ROWS (DASHBOARD)
   ======================================================== */
.dispatch-skeleton-row td {
  padding: 1rem 1.4rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.dispatch-skeleton-row .skel-cell-company {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dispatch-skeleton-row .skel-cell-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 130px;
}

/* ========================================================
   5. RESPONSIVE SKELETON STYLES (MOBILE)
   ======================================================== */
@media (max-width: 768px) {
  .skel-sidebar {
    display: none !important;
  }

  .skel-topbar {
    height: 56px;
    padding: 0 1rem;
  }

  .skel-content-body {
    padding: 1rem;
    gap: 1rem;
    padding-bottom: 80px; /* Space for bottom nav */
  }

  .skel-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .skel-stat-card {
    height: 96px;
    padding: 0.85rem;
  }

  .skel-banner {
    height: 140px;
  }

  .skel-mobile-bottom-nav {
    display: flex !important;
  }
}
