/**
 * MISTER FAST LiveMapChat WEB V3.6.1
 * Map Workspace Navigation State Engine
 */

body.mf361-workspace-state-home .mf361-live-badge,
body.mf361-workspace-state-driver-search .mf361-live-badge,
body.mf361-workspace-state-job-tracking .mf361-live-badge{
  display:none!important;
}

.mf361-live-badge{
  position:absolute;
  top:14px;
  left:50%;
  z-index:1100;
  display:inline-flex;
  align-items:center;
  gap:7px;
  transform:translateX(-50%);
  min-height:34px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.85);
  border-radius:999px;
  background:rgba(0,61,165,.92);
  color:#fff;
  box-shadow:0 8px 24px rgba(0,43,105,.22);
  font-size:12px;
  font-weight:900;
  pointer-events:none;
}

.mf361-live-badge::before{
  content:'';
  width:8px;
  height:8px;
  border-radius:50%;
  background:#37d46f;
  box-shadow:0 0 0 4px rgba(55,212,111,.18);
}

/* LIVE MAP: map is the whole center workspace; no Driver Feed. */
body.mf361-workspace-state-live-map .mf3306-feed,
body.mf361-workspace-state-live-map [data-mf3306-root],
body.mf361-workspace-state-live-map .mf215-map-driver-splitter,
body.mf361-workspace-state-live-map .mf20-workspace-panel{
  display:none!important;
}

body.mf361-workspace-state-live-map .mf514-map-pane{
  grid-template-rows:58px minmax(0,1fr) 64px!important;
}

body.mf361-workspace-state-live-map .mf16-workspace-header{grid-row:1!important}
body.mf361-workspace-state-live-map .mf514-map-wrap{grid-row:2!important;min-height:0!important;height:100%!important}
body.mf361-workspace-state-live-map .mf16-primary-nav{grid-row:3!important}
body.mf361-workspace-state-live-map .mf361-live-badge{display:inline-flex!important}

/* DRIVER SEARCH: Map + result list. No route/tracking tray. */
body.mf361-workspace-state-driver-search .mf20-workspace-panel{
  display:none!important;
}

body.mf361-workspace-state-driver-search .mf3306-feed{
  display:block!important;
}

body.mf361-workspace-state-driver-search .mf3306-feed-title b::after{
  content:' ค้นหารถใกล้คุณ';
}

body.mf361-workspace-state-driver-search .mf3306-feed-title small{
  display:none!important;
}

/* TRACKING: replace MyDriver Feed with the real tracking dock. */
body.mf361-workspace-state-job-tracking .mf3306-feed,
body.mf361-workspace-state-job-tracking [data-mf3306-root],
body.mf361-workspace-state-job-tracking .mf215-map-driver-splitter,
body.mf361-workspace-state-job-tracking .mf20-workspace-panel{
  display:none!important;
}

body.mf361-workspace-state-job-tracking .mf514-map-pane{
  grid-template-rows:58px minmax(300px,1fr) 64px auto!important;
}

body.mf361-workspace-state-job-tracking .mf16-workspace-header{grid-row:1!important}
body.mf361-workspace-state-job-tracking .mf514-map-wrap{grid-row:2!important;min-height:0!important;height:100%!important}
body.mf361-workspace-state-job-tracking .mf16-primary-nav{grid-row:3!important}
body.mf361-workspace-state-job-tracking .mf361-tracking-dock{grid-row:4!important}

.mf361-tracking-dock{
  display:none;
  width:100%;
  min-height:188px;
  max-height:300px;
  overflow:auto;
  border-top:1px solid #d7e3f2;
  background:#f7faff;
  box-shadow:0 -8px 22px rgba(0,43,105,.08);
}

body.mf361-workspace-state-job-tracking .mf361-tracking-dock{
  display:block!important;
}

.mf361-tracking-dock-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:44px;
  padding:7px 14px;
  border-bottom:1px solid #e0e9f5;
  background:#fff;
}

.mf361-tracking-dock-head b{
  color:#003da5;
  font-size:15px;
}

.mf361-tracking-dock-head span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  background:#e9f9ef;
  color:#137f3b;
  font-size:11px;
  font-weight:900;
}

.mf361-tracking-dock-body{
  padding:10px 14px 14px;
}

.mf361-tracking-dock .mf20-workspace-view,
.mf361-tracking-dock .mf-tracking-c{
  display:block!important;
  min-height:0!important;
  padding:0!important;
}

.mf361-tracking-dock .mf-tracking-c-shell{
  display:block!important;
}

.mf361-tracking-dock .mf-tracking-c-live,
.mf361-tracking-dock .mf-tracking-c-empty{
  margin:0!important;
}

.mf361-tracking-dock .mf-job-d{
  margin-top:10px!important;
}

body.mf361-workspace-state-job-tracking .mf514-map-wrap::after{
  content:'ติดตามงาน';
  position:absolute;
  left:14px;
  bottom:14px;
  z-index:1002;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(0,61,165,.90);
  color:#fff;
  font-size:11px;
  font-weight:900;
  pointer-events:none;
}

/* Active menu is driven by state, not by old default class. */
.mf514-menu [data-mf514-nav].mf361-nav-active{
  background:#ffc400!important;
  border-color:#ffc400!important;
  color:#003da5!important;
  box-shadow:0 7px 16px rgba(0,38,102,.16)!important;
}

.mf514-menu [data-mf514-nav].mf361-nav-active > span:first-child{
  background:rgba(255,255,255,.58)!important;
}

@media (max-width:900px){
  body.mf361-workspace-state-live-map .mf514-map-pane{
    grid-template-rows:54px minmax(0,1fr) 56px!important;
  }

  body.mf361-workspace-state-job-tracking .mf514-map-pane{
    grid-template-rows:54px minmax(240px,1fr) 56px auto!important;
  }

  .mf361-tracking-dock{
    min-height:170px;
    max-height:250px;
  }

  .mf361-live-badge{
    top:9px;
    font-size:11px;
  }
}
