:root {
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --naver-green: #03c75a;
    --card-bg: #ffffff;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    padding-top: 180px;
    /* Space for fixed header & trip selector & nav */
}

/* Header */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-titles h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.header-titles p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.desktop-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Trip Selector */
.trip-selector {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem;
    z-index: 45;
    border-bottom: 1px solid var(--border);
}

.trip-sel-btn {
    background: #f1f5f9;
    border: 2px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Pretendard', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.trip-sel-btn.active {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

body.jeju-mobile .trip-sel-btn.active {
    background: #fff7ed;
    border-color: #f97316;
    color: #f97316;
}

/* Jeju mobile theme */
body.jeju-mobile .header-titles h1 {
    color: #f97316;
}

body.jeju-mobile .tab-btn.active {
    color: #f97316;
}

body.jeju-mobile .tab-btn.active::after {
    background: #f97316;
}

body.jeju-mobile .day-title {
    border-left-color: #f97316;
}

body.jeju-mobile .card-dot {
    border-color: #f97316;
    color: #f97316;
}

body.jeju-mobile .card-time {
    color: #f97316;
}

body.jeju-mobile .card-click-hint {
    color: #f97316;
}

body.jeju-mobile .modal-time-tag {
    color: #f97316;
}

body.jeju-mobile .modal-box h3 {
    color: #f97316;
}

body.jeju-mobile .transit-badge {
    background: #fff7ed;
    color: #ea580c;
}

/* Tag badges for mobile */
.mobile-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 5px;
    vertical-align: middle;
}

.mobile-tag-snorkeling { background: #e0f2fe; color: #0284c7; }
.mobile-tag-backpacking { background: #dcfce7; color: #16a34a; }
.mobile-tag-food { background: #fff7ed; color: #ea580c; }
.mobile-tag-nature { background: #f3e8ff; color: #9333ea; }
.mobile-tag-stay { background: #fce7f3; color: #db2777; }
.mobile-tag-sightseeing { background: #fef9c3; color: #ca8a04; }
.mobile-tag-transit { background: #f1f5f9; color: #64748b; }

/* Horizontal Nav */
.day-tabs {
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--card-bg);
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 40;
    border-bottom: 1px solid var(--border);
}

.day-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    border: none;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem 0.2rem;
    cursor: pointer;
    position: relative;
    font-family: 'Pretendard', sans-serif;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* Timeline Content */
.mobile-main {
    padding: 1rem;
}

.day-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    padding-left: 0.8rem;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
}

.timeline-list::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 20px;
    width: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.card-item {
    display: flex;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.card-dot {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 5px;
}

.card-body {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1rem;
    flex-grow: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
}

.card-time {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.card-click-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 0.8rem;
    background: #f1f5f9;
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Transit Mini Badge */
.transit-badge {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 5px;
    margin-bottom: 10px;
}

/* Fullscreen Modal */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 100%;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 100;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-modal.open {
    left: 0;
}

.modal-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 110;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-main);
    padding: 10px;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-hero-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.modal-content-pad {
    padding: 1.5rem;
}

.modal-time-tag {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.modal-description {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-main);
    margin-bottom: 2rem;
}

.modal-box {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.modal-box h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.transit-main {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.transit-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 3rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.btn-nmap {
    background: var(--naver-green);
    color: white;
    box-shadow: 0 4px 15px rgba(3, 199, 90, 0.3);
}

.btn-search {
    background: white;
    color: var(--text-main);
    border: 1.5px solid var(--border);
}