:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    color: var(--text-main);
    font-family: 'Pretendard', -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 8px 12px;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    max-width: 480px; 
    display: flex;
    flex-direction: column;
    gap: 8px; /* 전체 카드 간격 최소화 */
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 2px;
}

.nav-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.lang-toggles {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.lang-divider {
    width: 1px;
    height: 10px;
    background: var(--glass-border);
}

.lang-btn {
    background: none;
    border: none;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
}

.lang-btn.glow-active {
    color: #f8fafc;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 12px rgba(56, 189, 248, 0.5);
}

.logo {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.i-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    -webkit-text-fill-color: #34d399;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
    padding: 1px 7px;
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: 6px;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(0,0,0,0.3));
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.15);
    line-height: 1.2;
}

.sub-title {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 10px 14px; /* 내부 여백 압축 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* 방향 */
.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}
.segmented-control input { display: none; }
.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
}
.segmented-control input:checked + label { color: #fff; }
#work:checked + label { text-shadow: 0 0 8px var(--primary-glow); }
#home:checked + label { text-shadow: 0 0 8px rgba(192, 132, 252, 0.8); }

.sliding-bg {
    position: absolute;
    top: 3px; left: 3px;
    height: calc(50% - 4.5px); /* Half height minus half gap/padding */
    width: calc(50% - 3px);
    border-radius: 8px;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
#work:checked ~ .sliding-bg {
    transform: translate(0, 0);
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 10px var(--primary-glow);
}
#home:checked ~ .sliding-bg {
    transform: translate(calc(100% + 3px), 0);
    background: rgba(192, 132, 252, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.4);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.4);
}

/* Coming Soon Buttons */
.coming-soon-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: not-allowed;
    opacity: 0.6;
    grid-column: span 1;
    z-index: 2;
}

.coming-soon-badge {
    position: absolute;
    bottom: -6px;
    right: -2px;
    background: #fbbf24;
    color: #000;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 10px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 3;
    pointer-events: none;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.x-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ef4444;
    font-size: 24px;
    font-weight: 900;
    opacity: 0.7;
    pointer-events: none;
    z-index: 4;
}

/* 출발지 */
.location-card h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.loc-btn {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 10px 6px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.loc-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
.loc-btn.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 10px var(--primary-glow);
}
.loc-btn.home-btn.active {
    background: rgba(192, 132, 252, 0.1);
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.4);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.4);
}

/* Info Message for Home Tab */
.info-message {
    grid-column: 1 / -1;
    background: rgba(192, 132, 252, 0.1);
    border: 1px solid rgba(192, 132, 252, 0.3);
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 5px;
}
.info-message strong {
    color: #c084fc;
    margin-right: 2px;
}

/* 출발시간 조정 */
.time-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.time-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.real-time-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
#real-time-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}
#custom-time-btn.active {
    background: rgba(192, 132, 252, 0.15);
    border-color: #c084fc;
    color: #c084fc;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}
.time-picker-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 2px 8px;
}
.user-time-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 32px; /* 대폭 축소 */
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    outline: none;
    cursor: pointer;
    width: 100%;
}
.user-time-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
    cursor: pointer;
}

/* 타이머 */
.timer-card {
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 14px;
    padding-bottom: 14px;
}
.timer-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}
.loc-badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 8px var(--primary-glow);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 2px;
}
.time-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    margin-left: 2px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 8px var(--primary-glow);
    transition: all 0.3s ease;
}
.time-badge.custom-mode {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.4);
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}
.main-arrival {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-top: 10px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
.main-arrival .route-badge {
    font-size: 18px;
    padding: 6px 14px;
    border-radius: 8px;
    transform: translateY(-2px);
}
.main-arrival .highlight {
    font-size: 44px;
    margin-left: 0;
}
.arrival-time {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-muted);
}
.arrival-time .highlight {
    color: var(--primary);
    font-weight: 600;
    margin-left: 6px;
}

/* Route Badges */
.route-badge {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
    margin-right: 2px;
    vertical-align: middle;
    letter-spacing: -0.5px;
}
.badge-02 {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-03 {
    background: rgba(167, 139, 250, 0.15);
    color: #c084fc; 
    border: 1px solid rgba(192, 132, 252, 0.3);
}
.badge-직원 {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399; 
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.sub-schedule {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid var(--glass-border);
}
.schedule-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.schedule-label {
    font-size: 10px;
    color: var(--text-muted);
}
.schedule-time {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 노선도 */
.route-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.route-card h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}
.route-map {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 8px 8px 100px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.route-map::-webkit-scrollbar {
    height: 3px;
}
.route-map::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.route-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
    min-width: 40px;
}
.node-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-darker);
    border: 2px solid var(--glass-border);
    transition: all 0.3s ease;
}
.node-circle.active {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}
.node-circle.highlight {
    border-color: #a5b4fc;
    background: #a5b4fc;
    box-shadow: 0 0 8px rgba(165, 180, 252, 0.4);
}
.node-label {
    font-size: 9px;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
}
.route-line {
    flex: 1;
    min-width: 25px; /* 모바일 화면 비정상 축소 방지 */
    height: 4px;
    background: var(--primary);
    margin: 0px 4px 4px 4px;
    border-radius: 2px;
    position: relative;
    max-width: 40px;
}
.bus-icon {
    position: absolute;
    top: 18px;
    font-size: 16px;
    transform: translateX(-50%);
    transition: left 1s linear;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tiny-badge {
    font-size: 7px;
    line-height: 1;
    background: var(--bg-darker);
    border-radius: 3px;
    padding: 1px 3px;
    margin-bottom: 0px;
    font-weight: 800;
}
.route-color-02 { color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.route-color-03 { color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.4); }
.route-color-직원 { color: #34d399; border: 1px solid rgba(52, 211, 153, 0.4); }

/* 광고 */
.ad-banner {
    margin-top: 2px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--glass-border);
    border-radius: 10px;
    height: 60px; /* 기존 100px에서 대폭 축소 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 10px;
    text-align: center;
}
.ad-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
    opacity: 0.5;
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    transition: opacity 0.3s;
}
.mobile-menu-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}
.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.menu-link {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.menu-link:hover {
    color: #38bdf8;
}

/* Custom Time Picker Modal */
.time-modal {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
    opacity: 1; transition: opacity 0.3s ease;
}
.time-modal.hidden { opacity: 0; pointer-events: none; }
.time-modal-content {
    background: var(--bg-dark); width: 100%; max-width: 480px;
    border-radius: 20px 20px 0 0; padding: 20px 20px 30px 20px;
    border-top: 1px solid var(--glass-border);
    transform: translateY(0); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.time-modal.hidden .time-modal-content { transform: translateY(100%); }
.time-modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.time-modal-header h3 { font-size: 16px; font-weight: 600; color: var(--text-main); }
#time-picker-close {
    background: rgba(56, 189, 248, 0.15); border: none; color: var(--primary);
    font-size: 15px; font-weight: 700; padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.time-picker-wheels {
    display: flex; justify-content: center; align-items: center; height: 180px; position: relative;
    mask-image: linear-gradient(to bottom, transparent 0%, black 40%, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40%, black 60%, transparent 100%);
}
.wheel-highlight {
    position: absolute; top: 50%; left: 0; right: 0; height: 40px; margin-top: -20px;
    background: rgba(255, 255, 255, 0.05); border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1); border-radius: 8px; pointer-events: none;
}
.wheel {
    flex: 1; height: 100%; overflow-y: scroll; overflow-x: hidden; scroll-snap-type: y mandatory;
    scrollbar-width: none; list-style: none; padding: 70px 0; margin: 0; text-align: center;
}
.wheel::-webkit-scrollbar { display: none; }
.wheel li {
    height: 40px; line-height: 40px; font-size: 20px; color: var(--text-muted);
    scroll-snap-align: center; transition: all 0.2s ease; cursor: pointer;
}
.wheel li.selected { color: var(--text-main); font-size: 26px; font-weight: 700; }
.wheel-separator {
    font-size: 24px; font-weight: bold; margin: 0 10px; color: var(--text-main); z-index: 2; pointer-events: none;
}

/* Instagram & YouTube Buttons */
.ig-btn, .yt-btn {
    display: block;
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ig-btn {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 4px 15px rgba(220, 39, 67, 0.3);
}
.ig-btn:hover {
    box-shadow: 0 6px 20px rgba(220, 39, 67, 0.5);
    transform: translateY(-2px);
}

.yt-btn {
    background: linear-gradient(135deg, #FF0000 0%, #CD201F 100%);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
}
.yt-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
    transform: translateY(-2px);
}

.ig-btn-content, .yt-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Recommend Button */
.recommend-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}
.recommend-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.2);
}
.recommend-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.3px;
}
