/* ==========================================
   CAREERFLOW MOBILE-FIRST CSS v1.0
   Agent 2: CSS Modernization Specialist
   ========================================== */

/* ==========================================
   MOBILE CSS VARIABLES & TOKENS
   ========================================== */
:root {
  /* Mobile Breakpoints */
  --breakpoint-mobile-sm: 320px;
  --breakpoint-mobile-md: 375px;
  --breakpoint-mobile-lg: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 769px;

  /* Touch Targets */
  --touch-target-min: 44px;
  --touch-target-preferred: 48px;

  /* Mobile Z-Index Scale (Push Navigation Hierarchy) */
  --z-mobile-sidebar: 1998;          /* Below pushed content */
  --z-mobile-sidebar-backdrop: 1997; /* Below sidebar (unused in push nav) */
  --z-mobile-header: 2000;           /* Above sidebar when pushed */
  --z-mobile-bottom-nav: 2000;       /* Above sidebar when pushed */
  --z-bottom-sheet: 2001;            /* Above all mobile UI */
  --z-bottom-sheet-backdrop: 2000;   /* Same as header/nav */
  --z-toast: 3000;                   /* Topmost layer */

  /* Mobile Transitions (Optimized for 60fps smooth animations) */
  --transition-mobile-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-mobile-base: 350ms cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Push navigation */
  --transition-mobile-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Safe Area Insets (iOS) */
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-bottom: env(safe-area-inset-bottom);
  --safe-area-left: env(safe-area-inset-left);
  --safe-area-right: env(safe-area-inset-right);
}

/* ==========================================
   BASE MOBILE STYLES (320px+)
   ========================================== */

/* Mobile Body Adjustments */
@media (max-width: 768px) {
  body {
    padding-top: calc(56px + var(--safe-area-top));
    padding-bottom: calc(64px + var(--safe-area-bottom));
    overflow-x: hidden;
  }

  /* Prevent iOS auto-zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="url"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important; /* Critical: prevents iOS zoom */
  }
}

/* ==========================================
   MOBILE HEADER (Hamburger)
   ========================================== */

.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--safe-area-top));
  padding-top: var(--safe-area-top);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-left: 12px;
  padding-right: 16px;
  z-index: 2000; /* Above sidebar when pushed */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.mobile-header__hamburger {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #71717a;
  background: transparent;
  border: none;
  border-radius: 8px;
  transition: all var(--transition-mobile-fast);
}

.mobile-header__hamburger:active {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(0.95);
}

.mobile-header__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.mobile-header__actions {
  display: flex;
  gap: 8px;
}

.mobile-header__ai-btn {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 12px;
  transition: all var(--transition-mobile-fast);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border: none;
  color: white;
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.3);
}

.mobile-header__ai-btn:active {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-accent-dark) 100%);
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(var(--color-primary-rgb), 0.4);
}

.mobile-header__ai-btn svg {
  width: 20px;
  height: 20px;
}

/* Show mobile header on mobile devices */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  /* Hide desktop header on mobile */
  header {
    display: none !important;
  }
}

/* ==========================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================== */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 2000; /* Above sidebar when pushed */
  padding-left: var(--safe-area-left);
  padding-right: var(--safe-area-right);
}

.mobile-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  min-width: 64px;
  min-height: 64px;
  cursor: pointer;
  transition: all var(--transition-mobile-fast);
  border-radius: 12px;
  background: transparent;
  border: none;
}

.mobile-bottom-nav__item:active {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(0.95);
}

.mobile-bottom-nav__icon {
  width: 24px;
  height: 24px;
  color: #71717a;
  transition: color var(--transition-mobile-fast);
}

.mobile-bottom-nav__label {
  font-size: 11px;
  color: #71717a;
  font-weight: 400;
  transition: color var(--transition-mobile-fast);
  font-family: var(--font-sans);
}

.mobile-bottom-nav__item--active .mobile-bottom-nav__icon {
  color: var(--color-primary);
}

.mobile-bottom-nav__item--active .mobile-bottom-nav__label {
  color: var(--color-primary);
  font-weight: 600;
}

/* Show bottom nav on mobile */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
}

/* Small phones: Hide labels, icons only */
@media (max-width: 480px) {
  .mobile-bottom-nav__label {
    display: none;
  }

  .mobile-bottom-nav {
    height: calc(56px + var(--safe-area-bottom));
  }

  .mobile-bottom-nav__item {
    min-width: 56px;
    min-height: 56px;
  }
}

/* ==========================================
   MOBILE SIDEBAR (Slide-out)
   ========================================== */

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(-100%) !important; /* Force off-screen by default */
  transition: transform var(--transition-mobile-base);
  z-index: 1998; /* Below pushed content */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12), 2px 0 8px rgba(0, 0, 0, 0.08);
  padding-top: var(--safe-area-top);
  padding-bottom: var(--safe-area-bottom);
  display: none; /* Hidden on desktop */
  /* Smooth scrolling */
  scroll-behavior: smooth;
}

.mobile-sidebar--open {
  transform: translateX(0) !important;
}

.mobile-sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-sidebar__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  margin: 0;
}

.mobile-sidebar__close {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 12px;
  transition: all var(--transition-mobile-fast);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
}

.mobile-sidebar__close:active {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(0.95);
}

.mobile-sidebar__content {
  padding: 16px;
}

.mobile-sidebar__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-mobile-base), visibility var(--transition-mobile-base);
  z-index: var(--z-mobile-sidebar-backdrop);
  display: none; /* Hidden on desktop */
}

.mobile-sidebar__backdrop--visible {
  opacity: 1;
  visibility: visible;
}

/* Show mobile sidebar on mobile */
@media (max-width: 768px) {
  .mobile-sidebar {
    display: block;
  }

  .mobile-sidebar__backdrop {
    display: none; /* No backdrop for push navigation */
  }

  /* Hide desktop sidebar on mobile */
  .sidebar {
    display: none !important;
  }

  /* ===== WORLD-CLASS PUSH NAVIGATION ===== */
  /* Core concept: Only push the app wrapper, not body or sidebar */

  /* Prevent body scroll when sidebar open */
  body.sidebar-open {
    overflow: hidden;
  }

  /* Create app wrapper that will be pushed (everything except sidebar) */
  .mobile-header,
  .mobile-bottom-nav,
  .main-wrapper,
  .container,
  #main-content,
  #kanban-app,
  .hero-section,
  .stats-overview,
  .kanban-container,
  #auth-modal,
  #add-job-modal,
  #job-details-modal,
  .email-sidebar-container {
    transition: transform var(--transition-mobile-base);
    will-change: transform;
  }

  /* Push all content when sidebar opens */
  body.sidebar-open .mobile-header,
  body.sidebar-open .mobile-bottom-nav,
  body.sidebar-open .main-wrapper,
  body.sidebar-open .container,
  body.sidebar-open #main-content,
  body.sidebar-open #kanban-app,
  body.sidebar-open .hero-section,
  body.sidebar-open .stats-overview,
  body.sidebar-open .kanban-container,
  body.sidebar-open #auth-modal,
  body.sidebar-open #add-job-modal,
  body.sidebar-open #job-details-modal,
  body.sidebar-open .email-sidebar-container {
    transform: translateX(280px);
  }

  /* Sidebar: Add GPU acceleration hint */
  .mobile-sidebar {
    will-change: transform;
  }

  /* Add subtle shadow to content when pushed */
  body.sidebar-open .mobile-header::before,
  body.sidebar-open .main-wrapper::before,
  body.sidebar-open .container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 999;
    transition: opacity var(--transition-mobile-base);
  }
}

/* ==========================================
   BOTTOM SHEET MODAL
   ========================================== */

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.16);
  transform: translateY(100%);
  transition: transform var(--transition-mobile-base);
  z-index: var(--z-bottom-sheet);
  max-height: 90vh;
  overflow-y: auto;
  padding-bottom: var(--safe-area-bottom);
  display: none;
}

.bottom-sheet--visible {
  transform: translateY(0);
}

.bottom-sheet--expanded {
  height: 90vh;
}

.bottom-sheet__drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  margin: 12px auto;
}

.bottom-sheet__content {
  padding: 40px 16px 16px 16px; /* Top padding clears drag handle */
}

.bottom-sheet__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-mobile-base), visibility var(--transition-mobile-base);
  z-index: var(--z-bottom-sheet-backdrop);
  display: none;
}

.bottom-sheet__backdrop--visible {
  opacity: 1;
  visibility: visible;
}

/* Enable bottom sheet display on mobile (only when visible class is added) */
@media (max-width: 768px) {
  .bottom-sheet--visible {
    display: block;
  }

  .bottom-sheet__backdrop--visible {
    display: block;
  }
}

/* Desktop: Convert to centered modal */
@media (min-width: 769px) {
  .bottom-sheet {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.9);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
  }

  .bottom-sheet--visible {
    transform: translate(-50%, -50%) scale(1);
  }

  .bottom-sheet__drag-handle {
    display: none; /* No drag handle on desktop */
  }
}

/* ==========================================
   JOB CARD (Mobile)
   ========================================== */

.job-card-mobile {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  min-height: 120px;
  display: none;

  /* Enhanced micro-interactions */
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              opacity 0.3s ease;
  will-change: transform;
  animation: cardSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Lift effect when tapped */
.job-card-mobile:active {
  transform: translateY(-4px) scale(0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Better shadow on hover (for devices with mouse) */
@media (hover: hover) {
  .job-card-mobile:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  }
}

/* Slide in animation when card appears */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stagger animation for multiple cards - creates cascading effect */
.job-card-mobile:nth-child(1) { animation-delay: 0ms; }
.job-card-mobile:nth-child(2) { animation-delay: 50ms; }
.job-card-mobile:nth-child(3) { animation-delay: 100ms; }
.job-card-mobile:nth-child(4) { animation-delay: 150ms; }
.job-card-mobile:nth-child(5) { animation-delay: 200ms; }
.job-card-mobile:nth-child(6) { animation-delay: 250ms; }
.job-card-mobile:nth-child(7) { animation-delay: 300ms; }
.job-card-mobile:nth-child(8) { animation-delay: 350ms; }
.job-card-mobile:nth-child(9) { animation-delay: 400ms; }
.job-card-mobile:nth-child(10) { animation-delay: 450ms; }

/* Reduced motion support (accessibility) */
@media (prefers-reduced-motion: reduce) {
  .job-card-mobile {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

.job-card-mobile__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.job-card-mobile__company {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  margin: 0;
}

.job-card-mobile__star {
  width: 24px;
  height: 24px;
  min-width: 24px;
  color: #E8C48A;
  cursor: pointer;
  transition: all var(--transition-mobile-fast);
}

.job-card-mobile__star:active {
  transform: scale(0.9);
}

.job-card-mobile__position {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0 0 12px 0;
}

.job-card-mobile__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.job-card-mobile__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-tertiary);
}

.job-card-mobile__meta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.job-card-mobile__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.job-card-mobile__status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
}

.job-card-mobile__status--interested {
  background: rgba(232, 196, 138, 0.2);
  color: #C4A564;
}

.job-card-mobile__status--applied {
  background: rgba(157, 184, 205, 0.2);
  color: #7D9CB9;
}

.job-card-mobile__status--interviewing {
  background: rgba(208, 155, 141, 0.2);
  color: #B8877D;
}

.job-card-mobile__status--offer {
  background: rgba(168, 200, 154, 0.2);
  color: #88AA7A;
}

.job-card-mobile__status--rejected {
  background: rgba(217, 160, 154, 0.2);
  color: #C9887E;
}

.job-card-mobile__match {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
}

/* Show mobile job cards on mobile */
@media (max-width: 768px) {
  .job-card-mobile {
    display: block;
  }
}

/* ==========================================
   LOADING SKELETON SCREENS
   ========================================== */

.job-card-skeleton {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  min-height: 120px;
  animation: skeletonFadeIn 0.3s ease;
}

@keyframes skeletonFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.skeleton-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.skeleton-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Base skeleton element with shimmer animation */
.skeleton {
  background: linear-gradient(
    90deg,
    #E8E6E3 0%,
    #F0EEEB 50%,
    #E8E6E3 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

/* Shimmer animation (wave effect) */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Different skeleton shapes */
.skeleton--circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton--title {
  height: 20px;
  flex: 1;
  max-width: 180px;
}

.skeleton--subtitle {
  height: 18px;
  width: 100%;
  margin-bottom: 12px;
}

.skeleton--text {
  height: 14px;
  width: 100%;
  margin-bottom: 6px;
}

.skeleton--text.short {
  width: 60%;
}

.skeleton--badge {
  height: 28px;
  width: 100px;
  border-radius: 8px;
}

.skeleton--badge.short {
  width: 70px;
}

/* Dark mode support */
body.dark-mode .skeleton {
  background: linear-gradient(
    90deg,
    #1a1a1a 0%,
    #262626 50%,
    #1a1a1a 100%
  );
  background-size: 200% 100%;
}

body.dark-mode .job-card-skeleton {
  background: rgba(39, 39, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .skeleton-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #E8E6E3;
  }

  body.dark-mode .skeleton {
    background: #262626;
  }
}

/* ==========================================
   TOUCH-OPTIMIZED BUTTONS & INPUTS
   ========================================== */

/* Primary Button (Mobile) */
.btn-mobile-primary {
  height: var(--touch-target-preferred);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  width: 100%;
  cursor: pointer;
  transition: all var(--transition-mobile-fast);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-text-inverse);
  border: none;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-sm);
}

.btn-mobile-primary:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-xs);
}

/* Secondary Button (Mobile) */
.btn-mobile-secondary {
  height: var(--touch-target-preferred);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  width: 100%;
  cursor: pointer;
  transition: all var(--transition-mobile-fast);
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  font-family: var(--font-sans);
}

.btn-mobile-secondary:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.05);
}

/* Icon Button (Mobile) */
.icon-btn-mobile {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-mobile-fast);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
}

.icon-btn-mobile:active {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(0.95);
}

/* Input Fields (Mobile) */
.input-mobile {
  height: var(--touch-target-preferred);
  padding: 12px 16px;
  font-size: 16px; /* Critical: prevents iOS zoom */
  border: 1px solid var(--color-border);
  border-radius: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  transition: all 200ms ease;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
}

.input-mobile:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 165, 154, 0.1);
}

.input-mobile::placeholder {
  color: var(--color-text-tertiary);
}

/* ==========================================
   STATS CARD (Mobile Grid)
   ========================================== */

.stats-grid-mobile {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card-mobile {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: all var(--transition-mobile-fast);
}

.stat-card-mobile:active {
  transform: scale(0.98);
}

.stat-card-mobile__value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  margin: 0 0 4px 0;
}

.stat-card-mobile__label {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin: 0;
}

.stat-card-mobile__icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .stats-grid-mobile {
    display: grid;
  }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-notification {
  position: fixed;
  bottom: calc(80px + var(--safe-area-bottom));
  left: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: var(--z-toast);
  animation: toastSlideUp 300ms ease-out;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-notification--success {
  border-left: 4px solid var(--color-success);
}

.toast-notification--error {
  border-left: 4px solid var(--color-error);
}

.toast-notification--warning {
  border-left: 4px solid var(--color-warning);
}

.toast-notification--info {
  border-left: 4px solid var(--color-info);
}

.toast-notification__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-notification__message {
  flex: 1;
  font-size: 15px;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
}

.toast-notification__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-mobile-fast);
  background: transparent;
  border: none;
  color: var(--color-text-tertiary);
}

.toast-notification__close:active {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(0.9);
}

/* ==========================================
   LOADING SKELETON
   ========================================== */

.skeleton-loader {
  animation: shimmer 1.5s ease-in-out infinite;
  background: linear-gradient(90deg, #E8E6E3 0%, #F0EEEB 50%, #E8E6E3 100%);
  background-size: 400% 100%;
  border-radius: 8px;
}

.skeleton-loader--text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-loader--title {
  height: 24px;
  margin-bottom: 12px;
}

.skeleton-loader--card {
  height: 120px;
  border-radius: 16px;
  margin-bottom: 12px;
}

/* ==========================================
   FLOATING ACTION BUTTON (FAB)
   ========================================== */

.fab-mobile {
  position: fixed;
  bottom: calc(80px + var(--safe-area-bottom));
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(212, 165, 154, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-mobile-base);
  z-index: 100;
}

.fab-mobile:active {
  transform: scale(0.9);
}

.fab-mobile svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .fab-mobile {
    display: flex;
  }
}

/* ==========================================
   EMPTY STATES
   ========================================== */

.empty-state-mobile {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-state-mobile__icon {
  font-size: 64px;
  opacity: 0.3;
  color: var(--color-text-tertiary);
}

.empty-state-mobile__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  margin: 0;
}

.empty-state-mobile__message {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin: 0 0 24px 0;
  max-width: 320px;
}

.empty-state-mobile__action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-primary);
  color: white;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-mobile-fast);
  border: none;
  font-family: var(--font-sans);
}

.empty-state-mobile__action:active {
  transform: scale(0.95);
}

/* ==========================================
   PULL-TO-REFRESH INDICATOR
   ========================================== */

.pull-to-refresh {
  position: fixed;
  top: calc(56px + var(--safe-area-top));
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  opacity: 0;
  transition: all var(--transition-mobile-base);
  z-index: 100;
  pointer-events: none;
}

.pull-to-refresh--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.pull-to-refresh__icon {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  animation: spin 1s linear infinite;
}

/* ==========================================
   SWIPE ACTION OVERLAYS
   ========================================== */

.swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  opacity: 0;
  transition: opacity var(--transition-mobile-fast);
}

.swipe-actions--visible {
  opacity: 1;
}

.swipe-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  min-width: 80px;
  cursor: pointer;
  transition: all var(--transition-mobile-fast);
}

.swipe-action--delete {
  background: var(--color-error);
  color: white;
}

.swipe-action--archive {
  background: var(--color-warning);
  color: white;
}

.swipe-action:active {
  filter: brightness(0.9);
}

/* ==========================================
   CONTEXT MENU (Dropdown)
   ========================================== */

.context-menu-mobile {
  position: fixed;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  padding: 8px 0;
  min-width: 200px;
  z-index: var(--z-toast);
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--transition-mobile-fast);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.context-menu-mobile--visible {
  opacity: 1;
  transform: scale(1);
}

.context-menu-mobile__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition-mobile-fast);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--color-text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
}

.context-menu-mobile__item:active {
  background: rgba(0, 0, 0, 0.05);
}

.context-menu-mobile__item-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
}

.context-menu-mobile__item--danger {
  color: var(--color-error);
}

.context-menu-mobile__item--danger .context-menu-mobile__item-icon {
  color: var(--color-error);
}

/* ==========================================
   DRAG-TO-REORDER STYLES
   ========================================== */

/* Placeholder shown while dragging */
.drag-placeholder {
  background: linear-gradient(135deg, rgba(212, 165, 154, 0.1) 0%, rgba(212, 165, 154, 0.05) 100%);
  border: 2px dashed rgba(212, 165, 154, 0.3);
  border-radius: 16px;
  margin-bottom: 12px;
  transition: all 200ms ease;
}

/* Job card being dragged */
.job-card-mobile.dragging {
  opacity: 0.95;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transform: scale(1.05) rotate(2deg);
  z-index: 1000;
  cursor: grabbing;
  transition: box-shadow 200ms ease, opacity 200ms ease;
}

/* Disable pointer events on cards while dragging */
.job-card-mobile.dragging * {
  pointer-events: none;
}

/* Add grab cursor on long-press */
.job-card-mobile:active {
  cursor: grab;
}

/* ==========================================
   ANIMATIONS & KEYFRAMES
   ========================================== */

/* Sidebar slide */
@keyframes slideInLeft {
  from { transform: translateX(-280px); }
  to { transform: translateX(0); }
}

/* Bottom sheet slide */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Shimmer loading */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Button press */
@keyframes buttonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Shake error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.input-error {
  animation: shake 0.4s ease-in-out;
  border-color: var(--color-error);
}

/* Toast slide up */
@keyframes toastSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================
   DARK MODE (Mobile Components)
   ========================================== */

body.dark-mode .mobile-header {
  background: rgba(24, 24, 27, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .mobile-header__title {
  color: #e4e4e7;
}

body.dark-mode .mobile-header__hamburger {
  color: #a1a1aa;
}

body.dark-mode .mobile-header__hamburger:active {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mobile-header__ai-btn {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.4);
}

body.dark-mode .mobile-header__ai-btn:active {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-accent-dark) 100%);
}

body.dark-mode .mobile-bottom-nav {
  background: rgba(24, 24, 27, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .mobile-bottom-nav__icon,
body.dark-mode .mobile-bottom-nav__label {
  color: #a1a1aa;
}

body.dark-mode .mobile-bottom-nav__item--active .mobile-bottom-nav__icon,
body.dark-mode .mobile-bottom-nav__item--active .mobile-bottom-nav__label {
  color: var(--color-primary);
}

body.dark-mode .mobile-bottom-nav__item:active {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mobile-sidebar {
  background: rgba(24, 24, 27, 0.98);
}

body.dark-mode .mobile-sidebar__title {
  color: #e4e4e7;
}

body.dark-mode .mobile-sidebar__close {
  color: #a1a1aa;
}

body.dark-mode .mobile-sidebar__close:active {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .bottom-sheet {
  background: rgba(24, 24, 27, 0.98);
}

body.dark-mode .bottom-sheet__drag-handle {
  background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .bottom-sheet__backdrop {
  background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .job-card-mobile {
  background: rgba(39, 39, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .job-card-mobile__company {
  color: #e4e4e7;
}

body.dark-mode .job-card-mobile__position {
  color: #a1a1aa;
}

body.dark-mode .job-card-mobile__meta-item {
  color: #71717a;
}

body.dark-mode .job-card-mobile__footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .btn-mobile-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

body.dark-mode .btn-mobile-secondary {
  background: #27272a;
  border-color: #3f3f46;
  color: #e4e4e7;
}

body.dark-mode .btn-mobile-secondary:active {
  background: #3f3f46;
}

body.dark-mode .input-mobile {
  background: #27272a;
  border-color: #3f3f46;
  color: #e4e4e7;
}

body.dark-mode .input-mobile:focus {
  border-color: var(--color-primary);
}

body.dark-mode .stat-card-mobile {
  background: rgba(39, 39, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .stat-card-mobile__value {
  color: #e4e4e7;
}

body.dark-mode .stat-card-mobile__label {
  color: #a1a1aa;
}

body.dark-mode .toast-notification {
  background: rgba(39, 39, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .toast-notification__message {
  color: #e4e4e7;
}

body.dark-mode .skeleton-loader {
  background: linear-gradient(90deg, #1a1a1a 0%, #262626 50%, #1a1a1a 100%);
  background-size: 400% 100%;
}

body.dark-mode .empty-state-mobile__title {
  color: #e4e4e7;
}

body.dark-mode .empty-state-mobile__message {
  color: #a1a1aa;
}

body.dark-mode .context-menu-mobile {
  background: rgba(39, 39, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .context-menu-mobile__item {
  color: #e4e4e7;
}

body.dark-mode .context-menu-mobile__item:active {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .context-menu-mobile__item-icon {
  color: #a1a1aa;
}

body.dark-mode .drag-placeholder {
  background: linear-gradient(135deg, rgba(212, 165, 154, 0.15) 0%, rgba(212, 165, 154, 0.08) 100%);
  border-color: rgba(212, 165, 154, 0.4);
}

body.dark-mode .job-card-mobile.dragging {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* ==========================================
   ACCESSIBILITY - FOCUS STATES
   ========================================== */

/* Focus indicators for keyboard navigation */
.mobile-header__hamburger:focus-visible,
.mobile-header__icon-btn:focus-visible,
.mobile-bottom-nav__item:focus-visible,
.mobile-sidebar__close:focus-visible,
.btn-mobile-primary:focus-visible,
.btn-mobile-secondary:focus-visible,
.icon-btn-mobile:focus-visible,
.input-mobile:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================
   REDUCED MOTION SUPPORT
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Small phones (320-480px) */
@media (max-width: 480px) {
  .mobile-header__title {
    font-size: 16px;
  }

  .job-card-mobile {
    padding: 12px;
  }

  .stat-card-mobile__value {
    font-size: 28px;
  }
}

/* Large phones & tablets (481-768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .mobile-sidebar {
    width: 320px; /* Wider sidebar */
  }
}

/* Desktop (769px+) - Hide all mobile elements */
@media (min-width: 769px) {
  .mobile-header,
  .mobile-bottom-nav,
  .mobile-sidebar,
  .mobile-sidebar__backdrop,
  .job-card-mobile,
  .stats-grid-mobile,
  .fab-mobile {
    display: none !important;
  }
}

/* ==========================================
   FILTER CHIPS - IMPROVED VISUAL HIERARCHY
   Quick Win #2
   ========================================== */

@media (max-width: 768px) {
  /* Better filter chip styles for mobile */
  .filter-btn {
    background: transparent !important;
    border: 1.5px solid #E4E4E7 !important;
    color: #71717A !important;
    font-weight: 400 !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    transition: all var(--transition-mobile-fast) !important;
  }

  .filter-btn:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.03) !important;
  }

  .filter-btn.active {
    background: var(--color-primary) !important;
    color: white !important;
    border-color: var(--color-primary) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  }

  .filter-btn .filter-count {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 400;
    margin-left: 4px;
  }

  .filter-btn.active .filter-count {
    opacity: 0.9;
    font-weight: 600;
  }

  /* Improved filters bar layout for mobile */
  .filters-bar {
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .filters-section {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .sort-section {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .sort-section label {
    font-size: 14px !important;
    color: #71717A !important;
    font-weight: 500 !important;
  }

  .sort-section select {
    flex: 1 !important;
    padding: 10px 12px !important;
    border: 1.5px solid #E4E4E7 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    background: white !important;
    color: var(--color-text-primary) !important;
  }

  /* Move trash/reset icon to better location or hide it */
  .sort-section .icon-btn {
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
    background: transparent !important;
    border: 1.5px solid #E4E4E7 !important;
    color: #71717A !important;
    transition: all var(--transition-mobile-fast) !important;
  }

  .sort-section .icon-btn:active {
    transform: scale(0.95);
    background: rgba(217, 160, 154, 0.1) !important;
    border-color: #D9A09A !important;
    color: #C9887E !important;
  }
}

/* ==========================================
   IMPROVED TEXT CONTRAST
   Quick Win #6
   ========================================== */

@media (max-width: 768px) {
  /* Darken secondary text for better accessibility */
  .job-card-mobile__position,
  .mobile-bottom-nav__label,
  .stat-card-mobile__label {
    color: #52525B !important; /* Darker than #71717A */
  }

  .job-card-mobile__meta-item {
    color: #52525B !important;
  }

  body.dark-mode .job-card-mobile__position,
  body.dark-mode .stat-card-mobile__label {
    color: #D4D4D8 !important; /* Lighter for dark mode */
  }
}
