/*assets\css\public-home.css*/
:root{
    --bg:#eef4fb;
    --card:#ffffff;
    --text:#10233f;
    --muted:#5f718d;
    --primary:#1d4ed8;
    --line:#d8e2f0;
    --shadow:0 12px 30px rgba(16,35,63,.08);
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:"Noto Sans Thai", system-ui, sans-serif;
    background:var(--bg);
    color:var(--text);
}

html,
body{
    height:100%;
}

.topbar{
    position:sticky;
    top:0;
    z-index:1000;
    background:rgba(255,255,255,.92);
    backdrop-filter:blur(10px);
    border-bottom:1px solid var(--line);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 16px;
}

.brand{
    font-weight:700;
    font-size:20px;
}

.actions a{
    color:var(--primary);
    text-decoration:none;
    font-weight:600;
    margin-left:12px;
}

.layout{
    display:grid;
    grid-template-columns:420px 1fr;
    min-height:calc(100dvh - 57px);
    align-items:stretch;
}

.sidebar{
    padding:16px;
    border-right:1px solid var(--line);
    background:#f7faff;
    overflow:auto;
}

.card{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:20px;
    box-shadow:var(--shadow);
    padding:16px;
    margin-bottom:16px;
}

.card h3{
    margin:0 0 10px;
    font-size:18px;
}

.map-wrap{
    position:relative;
    min-height:calc(100dvh - 57px);
    height:calc(100dvh - 57px);
    min-width:0;
    display:flex;
    overflow:hidden;
}

#map{
    width:100%;
    height:100%;
    min-height:320px;
    flex:1 1 auto;
    z-index:1;
}

.leaflet-container{
    width:100%;
    height:100%;
}

.search{
    display:flex;
    gap:10px;
}

.search input{
    flex:1;
    padding:12px 14px;
    border:1px solid var(--line);
    border-radius:14px;
    font:inherit;
    background:#fff;
}

.search button,
.chip{
    border:none;
    background:var(--primary);
    color:#fff;
    padding:12px 14px;
    border-radius:14px;
    cursor:pointer;
    font:inherit;
}

.route-chip{
    font-weight:700;
    min-width:72px;
    text-align:center;
    border:1px solid transparent;
    transition:transform .15s ease, opacity .15s ease, box-shadow .15s ease, filter .15s ease;
}

.route-chip:hover{
    transform:translateY(-2px);
    opacity:.92;
    box-shadow:0 10px 22px rgba(16,35,63,.18);
}

.route-chip:active{
    transform:translateY(0);
    box-shadow:0 4px 10px rgba(16,35,63,.12);
}

.route-chip.is-active{
    outline:3px solid rgba(29,78,216,.18);
    box-shadow:0 12px 26px rgba(29,78,216,.22);
    transform:translateY(-1px);
    filter:saturate(1.05);
}

.chip{
    display:inline-block;
    text-decoration:none;
    margin:4px 6px 0 0;
    font-size:14px;
}

.list{
    display:grid;
    gap:10px;
}

.row{
    padding:12px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
}

.muted{
    color:var(--muted);
    font-size:14px;
}

.routes{
    display:flex;
    flex-wrap:wrap;
}

.floating{
    position:absolute;
    top:16px;
    left:16px;
    right:16px;
    z-index:500;
    pointer-events:none;
}

.floating .card{
    max-width:760px;
    pointer-events:auto;
    margin:0 auto;
}

.floating-card{
    padding:14px 16px;
}

.floating-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
}

.typing-text{
    margin-top:4px;
    min-height:30px;
    font-size:22px;
    font-weight:700;
    line-height:1.35;
    letter-spacing:.1px;
    word-break:break-word;
}

.typing-text::after{
    content:"";
    display:inline-block;
    width:2px;
    height:1em;
    margin-left:4px;
    vertical-align:-2px;
    background:var(--primary);
    animation:blinkCaret .8s step-end infinite;
}

.typing-text.is-complete::after{
    opacity:.35;
}

@keyframes blinkCaret{
    0%, 100%{ opacity:1; }
    50%{ opacity:0; }
}

.clear-route-btn{
    border:none;
    background:#eff6ff;
    color:#1d4ed8;
    border:1px solid #bfdbfe;
    padding:10px 14px;
    border-radius:12px;
    cursor:pointer;
    font:inherit;
    font-weight:700;
    white-space:nowrap;
    transition:all .18s ease;
}

.clear-route-btn:hover{
    transform:translateY(-1px);
    box-shadow:0 8px 18px rgba(29,78,216,.12);
    background:#dbeafe;
}

.statusbar{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
}

.stat{
    padding:12px;
    border-radius:14px;
    background:#fff;
    border:1px solid var(--line);
    text-align:center;
}

.stat strong{
    display:block;
    font-size:20px;
}

.legend{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}

.legend-item{
    display:flex;
    align-items:center;
    gap:8px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:999px;
    padding:6px 10px;
    font-size:13px;
}

.dot{
    width:10px;
    height:10px;
    border-radius:50%;
    display:inline-block;
}

.dot-online{
    background:#1d4ed8;
}

.dot-stale{
    background:#f59e0b;
}

.dot-stop{
    background:#0f172a;
}

.search-results{
    margin-top:12px;
}

.map-summary{
    margin-top:10px;
}

.leaflet-popup-content{
    font-family:"Noto Sans Thai", system-ui, sans-serif;
}

.kmove-vehicle-marker-wrap{
    position:relative;
    width:40px;
    height:40px;
}

.kmove-vehicle-pulse{
    position:absolute;
    inset:-8px;
    border-radius:50%;
    background:rgba(29,78,216,.18);
    animation:kmovePulse 1.8s ease-out infinite;
    z-index:0;
}

@keyframes kmovePulse{
    0%{transform:scale(.75);opacity:.75;}
    100%{transform:scale(1.65);opacity:0;}
}

.kmove-vehicle-marker{
    position:absolute;
    left:50%;
    top:50%;
    width:34px;
    height:34px;
    border-radius:50% 50% 50% 0;
    transform:translate(-50%, -50%) rotate(-45deg);
    border:3px solid #fff;
    box-shadow:0 0 0 4px rgba(29,78,216,.15),0 10px 24px rgba(0,0,0,.22);
    z-index:1;
}

.kmove-vehicle-marker::before{
    content:"";
    position:absolute;
    inset:7px;
    background:#fff;
    border-radius:50%;
    opacity:.96;
}

.kmove-vehicle-marker::after{
    content:"";
    position:absolute;
    top:50%;
    left:50%;
    width:10px;
    height:10px;
    transform:translate(-50%,-50%);
    border-radius:50%;
    background:currentColor;
    box-shadow:0 0 10px rgba(255,255,255,.75);
}

.kmove-vehicle-marker.is-online{color:#1d4ed8;}
.kmove-vehicle-marker.is-stale{color:#f59e0b;}
.kmove-vehicle-marker.is-offline{color:#94a3b8;}
.kmove-vehicle-marker.is-disabled{color:#64748b;}

.kmove-route-tooltip{
    background:rgba(255,255,255,.96);
    border:1px solid rgba(216,226,240,.95);
    border-radius:999px;
    box-shadow:0 8px 22px rgba(16,35,63,.14);
    color:#10233f;
    font-size:13px;
    font-weight:700;
    padding:6px 10px;
    white-space:nowrap;
}

/* stop marker image */
.kmove-stop-image-marker{
    width:100%;
    height:100%;
    display:block;
    object-fit:contain;
    pointer-events:none;
    filter:drop-shadow(0 6px 12px rgba(16,35,63,.25));
}

@media (max-width:960px){
    .layout{grid-template-columns:1fr;}
    .sidebar{order:2;border-right:none;border-top:1px solid var(--line);}
    #map{height:58dvh;}
    .map-wrap{min-height:58dvh;height:58dvh;}
    .floating-head{
        flex-direction:column;
        align-items:stretch;
    }
    .clear-route-btn{
        width:100%;
    }
}

.brand{
    display:flex;
    align-items:center;
    gap:8px;
    font-weight:700;
    font-size:18px;
}

.brand-icon{
    width:24px;
    height:24px;
}

.social-icons-glow {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.social-icons-glow a {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #e9edf3;
    color: #64748b;
    font-size: 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
    overflow: visible;
}

.social-icons-glow a::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: -1;
}

/* brand colors */
.social-icons-glow a:nth-child(1)::after {
    background: radial-gradient(circle, rgba(24,119,242,0.35) 0%, rgba(24,119,242,0.12) 45%, transparent 72%);
}

.social-icons-glow a:nth-child(2)::after {
    background: radial-gradient(circle, rgba(225,48,108,0.35) 0%, rgba(225,48,108,0.12) 45%, transparent 72%);
}

.social-icons-glow a:nth-child(3)::after {
    background: radial-gradient(circle, rgba(88,101,242,0.35) 0%, rgba(88,101,242,0.12) 45%, transparent 72%);
}

.social-icons-glow a:nth-child(4)::after {
    background: radial-gradient(circle, rgba(6,199,85,0.35) 0%, rgba(6,199,85,0.12) 45%, transparent 72%);
}

/* hover */
.social-icons-glow a:hover {
    transform: translateY(-4px) scale(1.08);
    color: #fff;
}

.social-icons-glow a:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* hover background per brand */
.social-icons-glow a:nth-child(1):hover {
    background: #1877f2;
    box-shadow: 0 10px 24px rgba(24,119,242,0.35);
}

.social-icons-glow a:nth-child(2):hover {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    box-shadow: 0 10px 24px rgba(225,48,108,0.35);
}

.social-icons-glow a:nth-child(3):hover {
    background: #5865f2;
    box-shadow: 0 10px 24px rgba(88,101,242,0.35);
}

.social-icons-glow a:nth-child(4):hover {
    background: #06c755;
    box-shadow: 0 10px 24px rgba(6,199,85,0.35);
}

/* active */
.social-icons-glow a.active {
    color: #fff;
    transform: scale(1.02);
}

.social-icons-glow a:nth-child(1).active {
    background: #1877f2;
    box-shadow: 0 10px 24px rgba(24,119,242,0.35);
}

.social-icons-glow a:nth-child(2).active {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    box-shadow: 0 10px 24px rgba(225,48,108,0.35);
}

.social-icons-glow a:nth-child(3).active {
    background: #5865f2;
    box-shadow: 0 10px 24px rgba(88,101,242,0.35);
}

.social-icons-glow a:nth-child(4).active {
    background: #06c755;
    box-shadow: 0 10px 24px rgba(6,199,85,0.35);
}

/* icon tuning */
.social-icons-glow a i {
    position: relative;
    z-index: 1;
    line-height: 1;
}

.social-icons-glow a:nth-child(4) i {
    font-size: 22px;
}

/* tooltip */
.social-icons-glow a::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* ลูกศร tooltip */
.social-icons-glow a::after {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 6px solid transparent;
    border-top-color: #0f172a;
    opacity: 0;
    transition: all 0.25s ease;
}

/* show tooltip */
.social-icons-glow a:hover::before,
.social-icons-glow a:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}