/* ============================================================
   MOBILE SIMULATOR & RWD MOBILE VIEW
   ============================================================ */

/* 1. Simulator Frame when enabled */
body.mobile-simulator {
  background-color: #07090e;
  background-image: radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  overflow: auto;
}

body.mobile-simulator #app {
  width: 375px;
  height: 812px;
  border: 12px solid #222222;
  border-radius: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 2px #444444;
  position: relative;
  overflow: hidden;
  background-color: var(--background);
  display: flex;
  flex-direction: column;
}

body.mobile-simulator #sidebar {
  display: none !important;
}

body.mobile-simulator #content-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.mobile-simulator #topbar {
  height: 50px;
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-1);
}

body.mobile-simulator #topbar .tb-search,
body.mobile-simulator #topbar .tb-actions > *:not(.tb-user) {
  display: none !important;
}

body.mobile-simulator #main-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 76px 12px; /* Extra bottom padding for Bottom Nav */
}

/* 2. RWD View for genuine mobile screens < 768px (without simulated frame) */
@media (max-width: 768px) {
  body:not(.mobile-simulator) #app {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  
  body:not(.mobile-simulator) #sidebar {
    display: none !important;
  }
  
  body:not(.mobile-simulator) #content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  body:not(.mobile-simulator) #topbar {
    height: 50px;
    min-height: 50px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background-color: var(--surface-1);
  }
  
  body:not(.mobile-simulator) #topbar .tb-search,
  body:not(.mobile-simulator) #topbar .tb-actions > *:not(.tb-user) {
    display: none !important;
  }
  
  body:not(.mobile-simulator) #main-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 76px 12px;
  }
}

/* 3. Bottom Navigation Bar */
.mobile-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(13, 17, 28, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  height: 100%;
}

.mobile-bottom-nav .nav-item i {
  width: 18px;
  height: 18px;
  margin-bottom: 3px;
}

.mobile-bottom-nav .nav-item.active {
  color: var(--blue);
}

/* 4. Mobile Cards Layout style overrides */
.mobile-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  margin-bottom: 10px;
  transition: transform 0.15s ease;
}

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

.mobile-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mobile-card-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.mobile-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 4px;
}

.mobile-card-lbl {
  color: var(--text-muted);
}

/* 5. Mobile Buttons Touch Targets Adjustments */
.mobile-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.mobile-card-actions .btn {
  flex: 1;
  height: 38px;
  line-height: 38px;
  padding: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
}

/* 6. Floating Action Button (FAB) */
.mobile-fab {
  position: absolute;
  bottom: 76px; /* Right above bottom nav */
  right: 16px;
  width: 50px;
  height: 50px;
  border-radius: 25px;
  background-color: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  z-index: 99;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.mobile-fab:active {
  transform: scale(0.9);
  background-color: #2563eb;
}

.mobile-fab i {
  width: 22px;
  height: 22px;
}

/* 7. Sticky Top Header Search Bar */
.mobile-sticky-search {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(13, 17, 28, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 12px 10px 12px;
  margin: -12px -12px 12px -12px; /* Pull to edges */
  border-bottom: 1px solid var(--border);
}

.mobile-sticky-search .search-bar {
  margin-bottom: 0 !important;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.mobile-sticky-search .search-bar input {
  font-size: 12px;
  height: 100%;
}

/* ============================================================
   MOBILE CARD STYLE A & B & STEPPERS
   ============================================================ */

/* STYLE A: Large Card with Big Stage Icon */
.mobile-card-large {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.mobile-card-large:active {
  transform: scale(0.98);
  background: var(--surface-3);
}

.mobile-card-large .stage-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(79, 158, 255, 0.2);
}

.mobile-card-large .stage-icon-wrap.done {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.2);
}

.mobile-card-large .stage-icon-wrap i {
  width: 22px;
  height: 22px;
}

.mobile-card-large .info-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-card-large .card-id-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-card-large .card-id {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.mobile-card-large .card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 1px;
}

.mobile-card-large .card-lbl-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-prog-bar {
  display: flex;
  gap: 2.5px;
  margin-top: 6px;
}

.card-prog-dot {
  flex: 1;
  height: 4.5px;
  border-radius: 2px;
}


/* STYLE B: Small Card with Micro Stage Badge */
.mobile-card-badge-style {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  margin-bottom: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

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

.mobile-card-badge-style .badge-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.mobile-card-badge-style .badge-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.mobile-card-badge-style .micro-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(79,158,255,0.15);
}

.mobile-card-badge-style .micro-badge.done {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(34,197,94,0.15);
}

.mobile-card-badge-style .micro-badge i {
  width: 11px;
  height: 11px;
}

.mobile-card-badge-style .badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-sub);
}

.mobile-card-badge-style .badge-lbl {
  color: var(--text-muted);
}


/* STYLE A STEPPER: Vertical Timeline */
.vertical-stepper {
  position: relative;
  padding-left: 4px;
  margin-top: 4px;
  margin-bottom: 16px;
}

.vertical-stepper::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 16.5px; /* Centers with v-step-circ */
  width: 2.5px;
  background: var(--border);
  z-index: 0;
}

.v-step {
  display: flex;
  align-items: flex-start;
  position: relative;
  margin-bottom: 8px;
  z-index: 1;
}

.v-step:last-child {
  margin-bottom: 0;
}

.v-step-circ {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
  z-index: 2;
  transition: all 0.3s ease;
}

.v-step.done .v-step-circ {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.v-step.active .v-step-circ {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(79, 158, 255, 0.25);
  animation: pulse-ring 2s infinite;
}

.v-step-circ i {
  width: 12px;
  height: 12px;
}

.v-step-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.v-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 3px;
}

.v-step.active .v-step-title {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.v-step.done .v-step-title {
  color: var(--text-muted);
}

.v-step-detail {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 5px;
  background: var(--surface-3);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.v-step-detail-hdr {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}


/* STYLE B STEPPER: Horizontal Scroll Stepper */
.horizontal-stepper-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 8px 4px 12px 4px;
  margin-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.horizontal-stepper-scroll::-webkit-scrollbar {
  height: 3px;
}

.horizontal-stepper-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.h-step {
  flex: 0 0 100px;
  scroll-snap-align: start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: all 0.25s ease;
}

.h-step.done {
  border-color: var(--green-bg);
  background: rgba(34, 197, 94, 0.03);
}

.h-step.active {
  border-color: var(--blue);
  background: var(--blue-bg);
  box-shadow: 0 2px 8px rgba(79, 158, 255, 0.15);
}

.h-step-circ {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}

.h-step.done .h-step-circ {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.h-step.active .h-step-circ {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.h-step-circ i {
  width: 10px;
  height: 10px;
}

.h-step-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.h-step.done .h-step-lbl {
  color: var(--text-sub);
}

.h-step.active .h-step-lbl {
  color: var(--blue);
  font-weight: 700;
}

