:root {
    --color-surface: #FFFFFF;
    --color-on-surface: #000000;
    --color-surface-variant: #E7E0Ec;
    --button-green: #4CAF50;
    --label-bg-tint: #E0E0E0;
    --nth-bg: #E14158;
}

@font-face {
    font-family: MHeiHK-Bold;
    src: url("/MHeiHK-Bold.otf") format("opentype");
}

@font-face {
    font-family: CaseyReplica-Bold;
    src: url("/CaseyReplica.ttf") format("truetype");
}
@font-face {
    font-family: MyriadPro-Semibold-13;
    src: url("/MyriadPro-Semibold-13.otf") format("opentype");
}

@font-face {
    font-family: MHeiHK-Bold;
    font-weight: bold;
    src: url("/MHeiHK-Bold.otf") format("opentype");
}

#info-train {
	font-family: MHeiHK-Bold, CaseyReplica-Bold;
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: var(--color-surface);
    color: var(--color-on-surface);
    overflow: hidden;
}

#nested_scroll_view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.top-spacer {
    height: 120px;
}

.bottom-spacer {
    height: 120px;
}

/* Header */
#top_bar_container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    transition: transform 0.2s ease-out;
}

#line_banner {
    height: 56px;
    background-color: var(--color-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-content {
    display: flex;
    align-items: center;
}

#line_color_badge {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    background-color: #5DE2FF;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

#tv_line_code_badge {
    width: 26px;
    height: 26px;
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    color: #000000;
}

#tv_banner_name {
    font-size: 18px;
    font-weight: bold;
}

.banner-button {
    position: absolute;
    top: 4px;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    color: #92ADBB;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.banner-button .material-icons {
    font-size: 32px;
}

#btn_guide {
    left: 4px;
}

#btn_close {
    right: 4px;
}

#btn_close_sheet {
    right: 4px;
}

#btn_close_guide {
    right: 4px;
}

/* Refresh time */
#tv_refresh_time {
    position: fixed;
    top: 50px;
    right: 0;
    padding: 16px;
    font-size: 12px;
    color: gray;
    z-index: 5;
    pointer-events: none;
}

/* Direction label */
.direction-label {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    background-color: var(--label-bg-tint);
    padding: 4px 10px;
    border-radius: 16px;
	font-family: MHeiHK-Bold;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#tv_up_dir {
    top: 80px;
}

#tv_dn_dir {
    bottom: 20px;
}


/* Non-traffic Hour banner */
#layout-nth {
    height: 80px;
    margin-top: 56px;
    background-color: var(--nth-bg);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.nth-title {
    font-weight: bold;
}

/* Train Badge */
.train-badge-wrapper {
    width: 65px;
    height: 80px;
    filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.1));
    pointer-events: auto !important;
    cursor: pointer;
    z-index: 10;
}

.train-badge {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: white;
    overflow: hidden;
}

.train-badge.up {
    clip-path: polygon(50% 0%, 100% 15%, 100% 100%, 0% 100%, 0% 15%);
}

.train-badge.dn {
    clip-path: polygon(0% 0%, 100% 0%, 100% 85%, 50% 100%, 0% 85%);
}

.train-badge-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.train-badge-crowd {
    display: flex;
    gap: 3px;
}

.train-badge.up .train-badge-crowd {
    margin-top: 6px;
}

.train-badge.dn .train-badge-crowd {
    margin-bottom: 6px;
}

.train-badge-dot {
    width: 2px;
    height: 6px;
}

.train-badge-info {
    width: 100%;
    color: white;
    padding: 2px 0;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}


/* RecyclerView Items */
.recycler-view {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Rows */
.item-station {
    background-color: var(--color-surface-variant);
    align-items: center;
}

.item-between {
    background-color: var(--color-surface);
    align-items: center;
}

.item-branch {
    background-color: var(--color-surface);
    align-items: center;
}

.item-parallel {
    background-color: var(--color-surface-variant);
    align-items: center;
}

/* Station name */
.station-name-col {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
	font-family: MHeiHK-Bold;
    font-weight: bold;
    color: var(--color-on-surface);
}

/* Station dot */
.station-dot-outer {
    width: 14px;
    height: 14px;
    background-color: #000000;
    border-radius: 50%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.station-dot-inner {
    width: 8px;
    height: 8px;
    background-color: #FFFFFF;
    border-radius: 50%;
}

/* Train badge container */
#train_up,
#train_dn,
#train_up_main,
#train_dn_main,
#train_up_spur,
#train_dn_spur {
    width: 15% !important;
    height: 100%;
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

#train_up {
    left: 20%;
    justify-content: flex-start;
}

#train_dn {
    right: 20%;
    justify-content: flex-end;
}

#train_up_main {
    left: 10px;
    justify-content: flex-start;
}

#train_dn_main {
    left: 80px;
    justify-content: flex-start;
}

#train_up_spur {
    right: 80px;
    justify-content: flex-end;
}

#train_dn_spur {
    right: 10px;
    justify-content: flex-end;
}

/* Bottom Sheet */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
}

.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 80%;
    background: var(--color-surface);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 101;
    transition: bottom 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.bottom-sheet.show {
    bottom: 0;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid var(--color-surface-variant);
}

.sheet-title {
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    flex: 1;
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.train-detail-card {
    background: var(--color-surface-variant);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.train-detail-header {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.train-crowd-layout {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.car-box {
    width: 24px;
    height: 26px;
    border-radius: 4px;
}