/* ==========================================================================
   Kids Trip - Global & Dashboard Stylesheet
   Version: 1.4.0 (KTDS Design System Integration)
   ========================================================================== */

@import './tokens.css';
@import './components.css';

/* --------------------------------------------------------------------------
   2. Reset & Base Setup
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0.5rem;
    box-sizing: border-box;
    min-width: 0;
}

main {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   3. Global Ambient Lighting & Header
   -------------------------------------------------------------------------- */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 450px;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.08) 0%, rgba(16, 185, 129, 0.04) 40%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    gap: 0.75rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.brand-badge {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Header Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.departure-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.departure-select {
    appearance: none;
    background: var(--bg-secondary);
    color: var(--accent-emerald);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1.8rem 0.4rem 0.65rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 140px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

@media (min-width: 640px) {
    .departure-select {
        max-width: 180px;
    }
}

.departure-select:hover, .departure-select:focus {
    border-color: var(--accent-emerald);
    background: var(--bg-card-hover);
    box-shadow: 0 0 10px var(--accent-emerald-glow);
    outline: none;
}

.departure-select-wrapper::after {
    content: '▼';
    font-size: 0.6rem;
    color: var(--text-muted);
    position: absolute;
    right: 0.6rem;
    pointer-events: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    padding: 0 0.6rem;
    gap: 0.35rem;
    font-weight: 600;
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.badge-count {
    background: var(--accent-rose);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   4. Search & Quick Filters Bar
   -------------------------------------------------------------------------- */
.search-section {
    padding: 1rem 0 0.5rem 0;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.search-bar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 2.8rem 0 2.8rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue-glow);
    background: var(--bg-card-hover);
    outline: none;
}

.search-icon-left {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 0.8rem;
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
    z-index: 2;
}

.search-clear-btn.visible {
    display: flex;
}

/* Hero Quick Filter Chips */
.quick-filters-scroll {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.quick-filters-scroll::-webkit-scrollbar {
    display: none;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 38px;
}

.quick-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.quick-chip.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.2));
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    box-shadow: 0 0 12px var(--accent-emerald-glow);
}

/* --------------------------------------------------------------------------
   5. Guide & Intro Banner (Collapsible)
   -------------------------------------------------------------------------- */
.guide-banner {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0FDF4 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.22);
    border-radius: var(--radius-lg);
    margin: 0.5rem 0 1rem 0;
    overflow: hidden;
    box-shadow: 0 4px 16px -2px rgba(5, 150, 105, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

[data-theme="dark"] .guide-banner {
    background: linear-gradient(135deg, rgba(19, 27, 46, 0.95), rgba(15, 23, 42, 0.98));
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.guide-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(16, 185, 129, 0.12);
    transition: background-color var(--duration-fast) ease;
}

.guide-banner-header:hover {
    background: rgba(16, 185, 129, 0.06);
}

[data-theme="dark"] .guide-banner-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .guide-banner-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.guide-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.guide-toggle-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.guide-banner.collapsed .guide-toggle-icon {
    transform: rotate(-90deg);
}

.guide-banner.collapsed .guide-banner-body {
    display: none;
}

.guide-banner-body {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.category-summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.category-summary-card:hover {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald-tint);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

[data-theme="dark"] .category-summary-card {
    background: rgba(11, 15, 25, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .category-summary-card:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--accent-emerald);
}

.category-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.category-badge-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-emerald);
    background: var(--accent-emerald-tint);
    border: 1px solid rgba(5, 150, 105, 0.2);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.category-card-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.guide-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.guide-step-item {
    flex: 1 1 220px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.step-num {
    background: rgba(5, 150, 105, 0.12);
    color: var(--accent-emerald);
    border: 1px solid rgba(5, 150, 105, 0.25);
    font-weight: 800;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   6. Dashboard Controls (Category Tabs, View Switcher & Filter Bar)
   -------------------------------------------------------------------------- */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* Category Horizontal Tabs */
.category-tabs-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.category-tabs-bar::-webkit-scrollbar {
    display: none;
}

.cat-tab {
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cat-tab:hover {
    color: var(--color-emerald-700);
    background: var(--accent-emerald-tint);
    border-color: rgba(5, 150, 105, 0.35);
}

.cat-tab.active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #FFFFFF !important;
    border-color: #047857;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(4, 120, 87, 0.25);
}

[data-theme="dark"] .cat-tab:hover {
    color: var(--color-emerald-400);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .cat-tab.active {
    background: var(--color-emerald-600);
    color: #FFFFFF !important;
    border-color: var(--color-emerald-500);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

/* Filter Summary & View Switcher Row */
.filter-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-left-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-filter-trigger:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
}

.filter-count-badge {
    background: var(--accent-blue);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.results-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.results-count b {
    color: var(--accent-emerald);
}

.filter-right-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sort Dropdown */
.sort-select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.sort-select:focus {
    border-color: var(--accent-blue);
    outline: none;
}

/* View Switcher */
.view-switcher {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px;
}

.view-btn {
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.view-btn.active {
    background: var(--bg-card-hover);
    color: var(--accent-blue);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   7. Card Grid View
   -------------------------------------------------------------------------- */
.places-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .places-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .places-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

.place-card {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 278px;
    content-visibility: auto;
    contain-intrinsic-size: 0 278px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.07), 0 1px 3px 0 rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 639px) {
    .place-card {
        padding: 1rem; /* 360px 모바일 가용 폭 확보 */
    }
}

.place-card:hover {
    border-color: var(--accent-emerald);
    background: var(--bg-secondary);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -4px rgba(5, 150, 105, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
}

/* Card Header */
.card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    gap: 0.5rem;
    min-width: 0;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

.badge-tier {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
}

.badge-tier.tier-1,
.badge-tier.badge-tier-1 {
    background: linear-gradient(135deg, var(--accent-emerald), #047857);
    color: #ffffff !important;
    box-shadow: 0 2px 6px var(--accent-emerald-glow);
}

.badge-tier.tier-2,
.badge-tier.badge-tier-2 {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-tier.tier-3,
.badge-tier.badge-tier-3 {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.badge-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.badge-travel {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.btn-heart {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.15rem;
    transition: transform var(--duration-fast) var(--ease-spring), color var(--duration-fast) ease;
    border: 1px solid transparent;
}

.btn-heart:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    transform: scale(1.15);
}

.btn-heart.favorited {
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    animation: heartPop 0.35s var(--ease-bounce);
}

/* Card Body */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.place-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.place-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.place-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.2rem 0;
}

.tag-badge {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

.booking-info-box {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent-amber);
    padding: 0.4rem 0.6rem;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.booking-info-box strong {
    color: var(--accent-amber);
}

/* Card Footer Actions */
.place-card .card-actions,
.card-actions {
    display: flex;
    gap: 0.45rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.place-card .card-actions .btn-action,
.btn-action {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    box-sizing: border-box;
    transition: all var(--duration-fast) ease;
}

.place-card .btn-action-primary,
.btn-action-primary {
    background: var(--accent-emerald-tint);
    border: 1.5px solid var(--accent-emerald);
    color: var(--accent-emerald);
}

.place-card .btn-action-primary:hover,
.btn-action-primary:hover {
    background: var(--accent-emerald);
    color: #ffffff !important;
}

.place-card .btn-action-secondary,
.btn-action-secondary {
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.place-card .btn-action-secondary:hover,
.btn-action-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.place-card .btn-action-ghost,
.btn-action-ghost {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.place-card .btn-action-ghost:hover,
.btn-action-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* --------------------------------------------------------------------------
   8. Table View
   -------------------------------------------------------------------------- */
.places-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.places-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.places-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.places-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.places-table tbody tr {
    content-visibility: auto;
    contain-intrinsic-size: 0 52px;
}

.places-table tr:hover td {
    background: var(--bg-card-hover);
}

/* --------------------------------------------------------------------------
   9. Map View (Leaflet.js)
   -------------------------------------------------------------------------- */
.map-view-wrapper {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 480px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

#map-container {
    width: 100%;
    height: 100%;
    background: #111827;
}

.map-preview-sheet {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 420px;
    margin: 0 auto;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 1rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: slideUp 0.25s ease-out;
}

.map-preview-sheet.active {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

/* --------------------------------------------------------------------------
   10. Multi-Dimensional Filter Modal / Bottom Sheet
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1500;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }
}

.filter-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@media (min-width: 768px) {
    .filter-modal-content {
        border-radius: var(--radius-xl);
        max-height: 80vh;
    }
}

@keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.btn-close-modal:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.filter-group-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .filter-checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-checkbox-label:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-checkbox-label input[type="checkbox"]:checked + span {
    color: var(--accent-blue);
    font-weight: 700;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    padding-bottom: calc(0.85rem + var(--safe-bottom));
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    gap: 0.75rem;
}

.btn-reset-filters {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: underline;
    padding: 0.5rem;
}

.btn-apply-filters {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

/* --------------------------------------------------------------------------
   11. Mobile Bottom Navigation Bar
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
    flex: 1;
    height: 100%;
    position: relative;
    box-sizing: border-box;
}

.nav-item.active {
    color: var(--accent-emerald);
}

/* Data-Page Driven Automatic Active States & Display Control */
body[data-page="home"] .nav-item-home,
body[data-page="calendar"] .nav-item-calendar {
    color: var(--accent-emerald) !important;
    font-weight: 800;
}

body[data-page="home"] .header-nav-home,
body[data-page="calendar"] .header-nav-calendar {
    color: var(--accent-emerald) !important;
    font-weight: 800;
}

body[data-page="place"] .header-departure-box,
body[data-page="calendar"] .header-departure-box {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 1rem);
    }
    .pc-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.footer-inner p {
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.45;
}

.footer-links {
    display: flex;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.footer-links a {
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
    font-size: 0.8rem;
}

.footer-links a:hover {
    color: var(--text-primary);
}
