/* ═══════════════════════════════════════════
   여행 일정표 대시보드 — Itinerary CSS
   Light European Theme
   ═══════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #fdf6ee;
    --bg-card: #ffffff;
    --bg-warm: #f7ede0;
    --bg-section: #faf3ea;

    --gold: #c08830;
    --gold-dim: #a07020;
    --gold-pale: #f5e8c8;

    --text-primary: #2c1f0e;
    --text-secondary: #7a6040;
    --text-muted: #b0956a;

    --border: rgba(180, 140, 80, 0.2);
    --shadow-sm: 0 2px 12px rgba(140, 100, 40, 0.08);
    --shadow-md: 0 6px 30px rgba(140, 100, 40, 0.12);

    /* City palette */
    --paris: #6050c8;
    --paris-bg: #eeebfa;
    --interlaken: #2870b0;
    --interlaken-bg: #e4eff8;
    --milan: #c06020;
    --milan-bg: #faeee3;
    --venice: #b03060;
    --venice-bg: #fae4ec;
    --florence: #6a9030;
    --florence-bg: #eaf2df;
    --rome: #b04020;
    --rome-bg: #faeae0;

    --font-serif: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --radius: 20px;
    --radius-sm: 10px;
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 13px 32px;
    background: rgba(253, 246, 238, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 16px rgba(140, 100, 40, 0.07);
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: .04em;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    transition: all var(--transition);
    white-space: nowrap;
}

.back-btn:hover {
    color: var(--gold-dim);
    background: var(--gold-pale);
    border-color: rgba(192, 136, 48, .4);
}

.logo {
    font-family: var(--font-serif);
    font-size: .98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    color: #3a8040;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid rgba(42, 138, 74, .3);
    background: rgba(42, 138, 74, .06);
    opacity: 0;
    transition: opacity .5s;
}

.save-indicator.show {
    opacity: 1;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    font-weight: 500;
    font-family: var(--font-body);
    padding: 6px 14px;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid;
}

.print-btn {
    color: var(--gold-dim);
    background: var(--gold-pale);
    border-color: rgba(192, 136, 48, .3);
}

.print-btn:hover {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.danger-btn {
    color: #b03030;
    background: rgba(176, 48, 48, .05);
    border-color: rgba(176, 48, 48, .25);
}

.danger-btn:hover {
    background: rgba(176, 48, 48, .12);
    border-color: rgba(176, 48, 48, .5);
}

/* ── Page Hero ── */
.page-hero {
    text-align: center;
    padding: 52px 24px 36px;
    background: linear-gradient(180deg, #e8f0ff 0%, #f5ecdc 60%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-dim);
    font-weight: 600;
    margin-bottom: 10px;
}

.page-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--gold-dim), var(--gold), #e8a830);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
}

.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.meta-chip {
    font-size: .82rem;
    padding: 6px 16px;
    border-radius: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.hero-hint {
    font-size: .8rem;
    color: var(--text-muted);
    letter-spacing: .04em;
}

/* ── Legend ── */
.legend-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 32px;
}

.legend-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.paris-dot {
    background: var(--paris);
}

.interlaken-dot {
    background: var(--interlaken);
}

.milan-dot {
    background: var(--milan);
}

.venice-dot {
    background: var(--venice);
}

.florence-dot {
    background: var(--florence);
}

.rome-dot {
    background: var(--rome);
}

/* ── Main Layout ── */
/* 모바일 카드는 기본 숨김 — 700px 이하에서만 표시 */
.mobile-cards {
    display: none;
}

.main-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Table Wrapper ── */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    overflow-x: auto;
}

/* ── Itinerary Table ── */
.itinerary-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.itinerary-table thead tr {
    background: var(--bg-section);
    border-bottom: 2px solid var(--border);
}

.itinerary-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Column widths */
.col-day {
    width: 100px;
}

.col-city {
    width: 130px;
}

.col-places {
    min-width: 220px;
}

.col-hotel {
    min-width: 170px;
}

.col-transport {
    min-width: 170px;
}

.col-memo {
    min-width: 180px;
}

/* ── Table Rows ── */
.itinerary-table tbody tr {
    border-bottom: 1px solid rgba(180, 140, 80, 0.1);
    transition: background var(--transition);
}

.itinerary-table tbody tr:last-child {
    border-bottom: none;
}

.itinerary-table tbody tr:hover {
    background: rgba(253, 246, 238, 0.7);
}

/* City section header row */
.section-header-row td {
    padding: 8px 16px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: white;
}

/* Day cell */
.day-cell {
    padding: 14px 16px;
    white-space: nowrap;
}

.day-num {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1;
}

.day-date {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.day-label {
    display: inline-block;
    font-size: .62rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    margin-top: 4px;
    letter-spacing: .06em;
    color: white;
}

/* City badge cell */
.city-cell {
    padding: 14px 14px;
}

.city-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 100px;
    white-space: nowrap;
}

/* Input cells */
.input-cell {
    padding: 10px 12px;
}

.cell-input {
    width: 100%;
    border: 1.5px solid transparent;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .85rem;
    color: var(--text-primary);
    padding: 8px 10px;
    resize: none;
    outline: none;
    min-height: 44px;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    line-height: 1.5;
}

.cell-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: .7;
}

.cell-input:focus {
    border-color: rgba(192, 136, 48, .4);
    background: var(--gold-pale);
    box-shadow: 0 0 0 3px rgba(192, 136, 48, .1);
}

.cell-input:not(:placeholder-shown) {
    border-color: rgba(180, 140, 80, .15);
    background: rgba(253, 246, 238, .5);
}

/* ── City Color Theming ── */
/* Paris */
.row-paris .section-header-row {
    background: var(--paris);
}

.row-paris .day-label {
    background: var(--paris);
}

.row-paris .city-badge {
    background: var(--paris-bg);
    color: var(--paris);
    border: 1px solid rgba(96, 80, 200, .2);
}

.row-paris .cell-input:focus {
    border-color: rgba(96, 80, 200, .4);
    background: rgba(238, 235, 250, .6);
    box-shadow: 0 0 0 3px rgba(96, 80, 200, .08);
}

/* Interlaken */
.row-interlaken .day-label {
    background: var(--interlaken);
}

.row-interlaken .city-badge {
    background: var(--interlaken-bg);
    color: var(--interlaken);
    border: 1px solid rgba(40, 112, 176, .2);
}

.row-interlaken .cell-input:focus {
    border-color: rgba(40, 112, 176, .4);
    background: rgba(228, 239, 248, .6);
    box-shadow: 0 0 0 3px rgba(40, 112, 176, .08);
}

/* Milan */
.row-milan .day-label {
    background: var(--milan);
}

.row-milan .city-badge {
    background: var(--milan-bg);
    color: var(--milan);
    border: 1px solid rgba(192, 96, 32, .2);
}

.row-milan .cell-input:focus {
    border-color: rgba(192, 96, 32, .4);
    background: rgba(250, 238, 227, .6);
    box-shadow: 0 0 0 3px rgba(192, 96, 32, .08);
}

/* Venice */
.row-venice .day-label {
    background: var(--venice);
}

.row-venice .city-badge {
    background: var(--venice-bg);
    color: var(--venice);
    border: 1px solid rgba(176, 48, 96, .2);
}

.row-venice .cell-input:focus {
    border-color: rgba(176, 48, 96, .4);
    background: rgba(250, 228, 236, .6);
    box-shadow: 0 0 0 3px rgba(176, 48, 96, .08);
}

/* Florence */
.row-florence .day-label {
    background: var(--florence);
}

.row-florence .city-badge {
    background: var(--florence-bg);
    color: var(--florence);
    border: 1px solid rgba(106, 144, 48, .2);
}

.row-florence .cell-input:focus {
    border-color: rgba(106, 144, 48, .4);
    background: rgba(234, 242, 223, .6);
    box-shadow: 0 0 0 3px rgba(106, 144, 48, .08);
}

/* Rome */
.row-rome .day-label {
    background: var(--rome);
}

.row-rome .city-badge {
    background: var(--rome-bg);
    color: var(--rome);
    border: 1px solid rgba(176, 64, 32, .2);
}

.row-rome .cell-input:focus {
    border-color: rgba(176, 64, 32, .4);
    background: rgba(250, 234, 224, .6);
    box-shadow: 0 0 0 3px rgba(176, 64, 32, .08);
}

/* ── Section Divider Rows ── */
.city-section-row td {
    padding: 10px 16px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: white;
    border: none;
}

.city-section-row.sec-paris td {
    background: linear-gradient(to right, var(--paris), #8070d8);
}

.city-section-row.sec-interlaken td {
    background: linear-gradient(to right, var(--interlaken), #4090d0);
}

.city-section-row.sec-milan td {
    background: linear-gradient(to right, var(--milan), #d08040);
}

.city-section-row.sec-venice td {
    background: linear-gradient(to right, var(--venice), #d05080);
}

.city-section-row.sec-florence td {
    background: linear-gradient(to right, var(--florence), #8ab050);
}

.city-section-row.sec-rome td {
    background: linear-gradient(to right, var(--rome), #d06040);
}

/* ── Summary Grid ── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.summary-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.summary-label {
    font-family: var(--font-serif);
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.summary-dates {
    font-size: .68rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.summary-nights {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--gold-pale);
    color: var(--gold-dim);
    border: 1px solid rgba(192, 136, 48, .25);
}

/* ── Tips Box ── */
.tips-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}

.tips-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tip-item {
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-section);
    border: 1px solid var(--border);
}

.tip-item strong {
    color: var(--gold-dim);
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 36px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-warm);
    font-size: .78rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-note {
    opacity: .8;
}

/* ══════════════════════════════════════════
   PRINT STYLES
══════════════════════════════════════════ */
@media print {

    .site-header,
    .hero-hint,
    .header-actions,
    .tips-box,
    .summary-grid,
    .legend-bar {
        display: none !important;
    }

    .page-hero {
        padding: 20px 0;
        border: none;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 0;
    }

    .table-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
        border-radius: 0;
    }

    .cell-input {
        border: 1px solid #ddd !important;
        background: white !important;
    }

    body {
        background: white;
    }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-header {
        padding: 12px 16px;
    }

    .legend-inner {
        gap: 14px;
    }

    .main-content {
        padding: 20px 16px 60px;
    }
}

@media (max-width: 600px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .header-actions .print-btn {
        display: none;
    }

    .page-hero {
        padding: 32px 16px 24px;
    }

    .meta-chip {
        font-size: .75rem;
        padding: 5px 12px;
    }
}

/* ═══════════════════════════════════════════
   MOBILE CARD VIEW — ≤ 700px
   테이블 → 카드 형태로 변환
   ═══════════════════════════════════════════ */
@media (max-width: 700px) {

    /* 데스크탑 테이블 숨기기 */
    .table-wrapper {
        display: none;
    }

    /* JS가 주입하는 카드 컨테이너 */
    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 0;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    /* 도시 구분 헤더 */
    .mc-section-header {
        padding: 11px 16px;
        font-size: .72rem;
        font-weight: 700;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: white;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* 날짜별 카드 */
    .mc-day {
        border-bottom: 1px solid rgba(180, 140, 80, 0.1);
        padding: 14px 16px;
    }

    .mc-day:last-child {
        border-bottom: none;
    }

    .mc-day-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .mc-day-num {
        font-family: var(--font-serif);
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary);
        white-space: nowrap;
    }

    .mc-day-date {
        font-size: .72rem;
        color: var(--text-muted);
    }

    .mc-day-label {
        font-size: .62rem;
        font-weight: 600;
        color: white;
        padding: 2px 8px;
        border-radius: 100px;
        margin-left: auto;
        white-space: nowrap;
    }

    /* 입력 필드 그룹 */
    .mc-fields {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mc-field {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .mc-label {
        font-size: .68rem;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    /* font-size: 1rem (≥16px) → iOS 자동 줌 방지 */
    .mc-input {
        width: 100%;
        font-size: 1rem;
        font-family: var(--font-body);
        color: var(--text-primary);
        padding: 10px 12px;
        border-radius: var(--radius-sm);
        border: 1.5px solid transparent;
        background: var(--bg-section);
        outline: none;
        resize: none;
        min-height: 44px;
        line-height: 1.5;
        transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
        -webkit-appearance: none;
    }

    .mc-input::placeholder {
        color: var(--text-muted);
        font-style: italic;
        opacity: .7;
    }

    .mc-input:focus {
        border-color: rgba(192, 136, 48, .4);
        background: var(--gold-pale);
        box-shadow: 0 0 0 3px rgba(192, 136, 48, .1);
    }

    .mc-input:not(:placeholder-shown) {
        border-color: rgba(180, 140, 80, .2);
        background: rgba(253, 246, 238, .6);
    }

    /* 도시별 포커스 색상 */
    .mc-paris .mc-input:focus {
        border-color: rgba(96, 80, 200, .4);
        background: rgba(238, 235, 250, .6);
    }

    .mc-interlaken .mc-input:focus {
        border-color: rgba(40, 112, 176, .4);
        background: rgba(228, 239, 248, .6);
    }

    .mc-milan .mc-input:focus {
        border-color: rgba(192, 96, 32, .4);
        background: rgba(250, 238, 227, .6);
    }

    .mc-venice .mc-input:focus {
        border-color: rgba(176, 48, 96, .4);
        background: rgba(250, 228, 236, .6);
    }

    .mc-florence .mc-input:focus {
        border-color: rgba(106, 144, 48, .4);
        background: rgba(234, 242, 223, .6);
    }

    .mc-rome .mc-input:focus {
        border-color: rgba(176, 64, 32, .4);
        background: rgba(250, 234, 224, .6);
    }

    /* 도시 헤더 그라디언트 */
    .mch-paris {
        background: linear-gradient(to right, var(--paris), #8070d8);
    }

    .mch-interlaken {
        background: linear-gradient(to right, var(--interlaken), #4090d0);
    }

    .mch-milan {
        background: linear-gradient(to right, var(--milan), #d08040);
    }

    .mch-venice {
        background: linear-gradient(to right, var(--venice), #d05080);
    }

    .mch-florence {
        background: linear-gradient(to right, var(--florence), #8ab050);
    }

    .mch-rome {
        background: linear-gradient(to right, var(--rome), #d06040);
    }

    /* Day 레이블 배경 */
    .mc-paris .mc-day-label {
        background: var(--paris);
    }

    .mc-interlaken .mc-day-label {
        background: var(--interlaken);
    }

    .mc-milan .mc-day-label {
        background: var(--milan);
    }

    .mc-venice .mc-day-label {
        background: var(--venice);
    }

    .mc-florence .mc-day-label {
        background: var(--florence);
    }

    .mc-rome .mc-day-label {
        background: var(--rome);
    }

    /* 터치 타겟 최소 44px */
    .back-btn,
    .action-btn {
        min-height: 44px;
    }

    .save-indicator {
        display: none;
    }

    .logo {
        font-size: .88rem;
    }
}