/* =========================================
   New Trip Modal - 新建行程模态框样式
   设计语言：超圆角 + 禅绿配色 + 微交互
   ========================================= */

/* CSS 变量 */
:root {
    /* User Requested Palette */
    --ntm-theme-sage: #626F47;
    /* Deep Green */
    --ntm-theme-leaf: #A4B465;
    /* Light Green */
    --ntm-theme-cream: #F5ECD5;
    /* Beige Background */
    --ntm-theme-sun: #F0BB78;
    /* Warm Orange Accent */

    /* Semantic Mapping */
    --ntm-zen-green: var(--ntm-theme-sage);
    --ntm-zen-green-light: rgba(98, 111, 71, 0.1);
    /* Sage with opacity */

    /* Neutrals - Warm Tints */
    --ntm-slate-50: #F9F8F4;
    /* Warm White */
    --ntm-slate-100: #F2F0E9;
    /* Light Beige */
    --ntm-slate-200: #E6E2D6;
    --ntm-slate-300: #CBC6B5;
    --ntm-slate-400: #9F9985;
    --ntm-slate-500: #746F5C;
    --ntm-slate-600: #5C5847;
    --ntm-slate-700: #423F33;
    --ntm-slate-800: #2D2B22;
    --ntm-slate-900: #1A1913;
}

/* ===== 动画定义 ===== */
@keyframes ntm-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ntm-zoom-slide-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes ntm-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ntm-stagger-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 蒙层 ===== */
.new-trip-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.new-trip-overlay.show {
    display: flex;
    animation: ntm-fade-in 0.5s ease forwards;
}

/* ===== 模态框容器 ===== */
.new-trip-modal {
    background: white;
    width: 100%;
    max-width: 980px;
    border-radius: 32px;
    box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    animation: ntm-zoom-slide-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ===== 左侧配置面板 ===== */
.ntm-config-panel {
    width: 320px;
    min-width: 320px;
    padding: 24px;
    /* 32px -> 24px */
    border-right: 1px solid var(--ntm-slate-200);
    /* Darker border for contrast on cream */
    background: var(--ntm-theme-cream);
    /* Apply cream background */
    display: flex;
    flex-direction: column;
}

.ntm-header {
    margin-bottom: 24px;
    /* 40px -> 24px */
}

.ntm-header h2 {
    font-size: 1.875rem;
    font-weight: 900;
    color: var(--ntm-theme-sage);
    /* Use Sage instead of Slate-800 */
    line-height: 1.2;
    margin: 0;
}

.ntm-header-deco {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.ntm-header-deco .bar-primary {
    height: 6px;
    width: 32px;
    border-radius: 9999px;
    background: var(--ntm-theme-sage);
}

.ntm-header-deco .bar-secondary {
    height: 6px;
    width: 8px;
    border-radius: 9999px;
    background: var(--ntm-theme-leaf);
    /* Use lighter green */
}

/* ===== 表单区域 ===== */
.ntm-form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* 24px -> 16px */
    flex: 1;
}

.ntm-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* 12px -> 6px */
}

.ntm-field-group:focus-within .ntm-label {
    color: var(--ntm-zen-green);
}

.ntm-label {
    font-size: 10px;
    font-weight: 900;
    color: var(--ntm-slate-300);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-left: 4px;
    transition: color 0.2s;
}

/* 目的地标签 */
.ntm-dest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.ntm-dest-tag {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    background: white;
    /* Contrast against cream bg */
    color: var(--ntm-slate-500);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    animation: ntm-stagger-in 0.3s ease forwards;
    opacity: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ntm-dest-tag:hover {
    background: white;
    color: var(--ntm-theme-sage);
    border-color: var(--ntm-theme-leaf);
    transform: translateY(-1px);
}

.ntm-dest-tag.active {
    background: var(--ntm-theme-sage);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(98, 111, 71, 0.4);
}

/* 输入框 */
.ntm-input {
    width: 100%;
    padding: 14px 20px;
    background: white;
    /* White for input fields on cream card */
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ntm-slate-700);
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.ntm-input::placeholder {
    color: var(--ntm-slate-300);
}

.ntm-input:focus {
    background: white;
    border-color: var(--ntm-theme-sun);
    /* Warm Orange focus ring */
    box-shadow: 0 4px 16px rgba(240, 187, 120, 0.2);
}

/* ===== 日期显示区 ===== */
.ntm-date-preview {
    margin-top: 24px;
    /* 40px -> 24px */
    padding: 16px;
    /* 24px -> 16px */
    background: rgba(255, 255, 255, 0.6);
    /* Translucent white on cream */
    border-radius: 24px;
    /* Slightly smaller radius */
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.ntm-date-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    /* 16px -> 12px */
}

.ntm-date-preview-label {
    font-size: 10px;
    font-weight: 900;
    color: var(--ntm-slate-400);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.ntm-duration-badge {
    font-size: 10px;
    font-weight: 900;
    color: var(--ntm-slate-800);
    background: var(--ntm-theme-leaf);
    /* Light Green badge */
    padding: 2px 8px;
    border-radius: 6px;
    display: none;
}

.ntm-duration-badge.show {
    display: inline-block;
    animation: ntm-fade-in 0.3s ease, ntm-stagger-in 0.3s ease;
}

.ntm-date-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* 12px -> 8px */
}

.ntm-date-row {
    display: flex;
    align-items: center;
    gap: 10px;
    /* 12px -> 10px */
}

.ntm-date-icon {
    width: 28px;
    /* 32px -> 28px */
    height: 28px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    color: var(--ntm-theme-sage);
    /* Sage Icon */
    font-size: 12px;
    /* 14px -> 12px */
}

.ntm-date-icon.rotate {
    transform: rotate(180deg);
}

.ntm-date-info {
    display: flex;
    flex-direction: column;
}

.ntm-date-type {
    font-size: 9px;
    font-weight: 700;
    color: var(--ntm-slate-400);
    /* Muted label */
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 4px;
}

.ntm-date-value {
    font-size: 14px;
    font-weight: 900;
    color: var(--ntm-slate-300);
    transition: color 0.3s;
}

.ntm-date-value.set {
    color: var(--ntm-theme-sage);
    /* Highlight set dates */
}

/* ===== 提交按钮 ===== */
.ntm-submit-btn {
    margin-top: 20px;
    /* 32px -> 20px */
    width: 100%;
    padding: 16px;
    /* 20px -> 16px */
    border-radius: 20px;
    /* 24px -> 20px */
    font-size: 0.9rem;
    font-weight: 900;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.15);
}

.ntm-submit-btn.disabled {
    background: rgba(255, 255, 255, 0.5);
    color: var(--ntm-slate-300);
    cursor: not-allowed;
    box-shadow: none;
}

.ntm-submit-btn.enabled {
    background: var(--ntm-theme-sage);
    /* Deep Green Button */
    color: white;
    box-shadow: 0 16px 32px -8px rgba(98, 111, 71, 0.4);
}

.ntm-submit-btn.enabled:hover {
    transform: translateY(-2px);
    background: var(--ntm-theme-leaf);
    /* Lighter on hover */
    box-shadow: 0 20px 40px -8px rgba(164, 180, 101, 0.4);
}

.ntm-submit-btn.enabled:active {
    transform: translateY(0) scale(0.98);
}

/* ===== 右侧日历面板 ===== */
.ntm-calendar-panel {
    flex: 1;
    min-width: 520px;
    background: rgba(248, 250, 252, 0.5);
    padding: 24px 32px;
    /* 28px 40px -> 24px 32px */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 关闭按钮 */
.ntm-close-btn {
    position: absolute;
    top: 24px;
    /* 32px -> 24px */
    right: 24px;
    /* 32px -> 24px */
    width: 36px;
    /* 44px -> 36px */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 12px;
    /* 16px -> 12px */
    color: var(--ntm-slate-400);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 30;
    font-size: 16px;
    /* 18px -> 16px */
}

.ntm-close-btn:hover {
    background: white;
    color: var(--ntm-slate-600);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.ntm-close-btn:active {
    transform: scale(0.95);
}

/* 月份导航 */
.ntm-month-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* space-between -> flex-start */
    gap: 12px;
    /* Bring arrows closer to title */
    margin-bottom: 48px;
    padding: 0 8px;
    padding-right: 48px;
    position: relative;
    z-index: 20;
}

.ntm-month-title-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.ntm-month-title-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ntm-month-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--ntm-slate-800);
}

.ntm-month-title-arrow {
    color: var(--ntm-slate-300);
    transition: transform 0.3s, color 0.2s;
    font-size: 12px;
}

.ntm-month-title-btn:hover .ntm-month-title-arrow {
    color: var(--ntm-zen-green);
}

.ntm-month-title-arrow.rotated {
    transform: rotate(180deg);
}

.ntm-nav-btns {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.4);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.ntm-nav-btn {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--ntm-slate-500);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.ntm-nav-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ntm-nav-btn:active {
    transform: scale(0.95);
}

/* 星期标识 */
.ntm-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    /* 16px -> 8px */
}

.ntm-weekday {
    text-align: center;
    font-size: 10px;
    font-weight: 900;
    color: var(--ntm-slate-300);
    text-transform: uppercase;
    padding: 8px 0;
}

/* 日历网格 */
.ntm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px 4px;
    /* Row Gap 2px, Col Gap 4px */
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.ntm-day-cell {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 0.75;
    /* Even shorter: 1/0.75 */
    border-radius: 8px;
    /* Slightly tighter radius */
    font-size: 12px;
    /* 13px -> 12px */
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4px;
    /* 6px -> 4px */
    color: var(--ntm-slate-600);
    transition: all 0.2s;
    z-index: 100;
}

.ntm-day-cell:hover:not(.empty):not(.start):not(.end) {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ntm-day-cell.empty {
    cursor: default;
}

/* Today Dot: 1.5px Zen Green dot at top */
.ntm-day-cell.today::before {
    content: '';
    position: absolute;
    top: 3px;
    /* Adjusted for tighter spacing */
    width: 3px;
    /* Slightly smaller dot */
    height: 3px;
    border-radius: 50%;
    background: var(--ntm-zen-green);
    pointer-events: none;
}

/* Selected State */
.ntm-day-cell.start,
.ntm-day-cell.end {
    background: var(--ntm-zen-green);
    color: white;
    box-shadow: 0 4px 16px -2px rgba(91, 99, 77, 0.4);
    /* Reduced shadow intensity */
    z-index: 10;
    transform: scale(1.02);
    /* Reduced scale pop */
    justify-content: center;
    /* Re-center for layout with marker */
    padding-top: 0;
}

/* Labels: START / END using pseudos */
.ntm-day-cell.start::after {
    content: 'START';
    display: block;
    font-size: 6px;
    /* 7px -> 6px */
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 0px;
    /* Tighter */
    opacity: 0.9;
    line-height: 1;
}

.ntm-day-cell.end::after {
    content: 'END';
    display: block;
    font-size: 6px;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 0px;
    /* Tighter */
    opacity: 0.9;
    line-height: 1;
}

/* Range Coloring: 5B634D/10 (Zen Green 10%) */
.ntm-day-cell.in-range {
    background: rgba(91, 99, 77, 0.1);
    /* 5B634D equivalent */
    color: var(--ntm-zen-green);
    border-radius: 0;
    /* Connects the range */
}

/* Round the ends of the range */
.ntm-day-cell.in-range:first-of-type,
/* Not perfect selector for range but okay */
.ntm-day-cell.start+.ntm-day-cell.in-range {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

/* This connecting logic is tricky with grid gaps. 
   Actually, 'gap: 4px' in parent (.ntm-calendar-grid) makes continuous background hard without removing gap.
   User requirement: "区间着色：中间日期...". 
   With 'gap: 4px', each cell is distinct.
   If I want continuous look, I should remove gap or use negative margins.
   However, "range coloring" usually implies coloring the cells themselves. 
   With gap, it looks like separate blocks. That fits the "Cell" metaphor.
   I will keep the gap and just color the cells. distinct blocks are fine.
*/

.ntm-day-cell.preview {
    background: rgba(226, 232, 240, 0.5);
    /* Previsit gray */
    color: var(--ntm-slate-400);
}

.ntm-day-num {
    position: relative;
    z-index: 10;
}

/* Hide manual marker if using pseudo */
.ntm-day-marker {
    display: none;
}

/* ===== 快选面板 ===== */
.ntm-quick-select {
    display: none;
    position: absolute;
    inset: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    /* Increased blur as per requirement */
    -webkit-backdrop-filter: blur(20px);
    border-radius: 40px;
    z-index: 40;
    box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.2);
    padding: 40px;
    flex-direction: column;
    border: 1px solid var(--ntm-slate-100);
}

.ntm-quick-select.show {
    display: flex;
    animation: ntm-fade-in 0.3s ease, ntm-slide-up 0.3s ease;
    pointer-events: auto;
}

.ntm-qs-section {
    margin-bottom: 24px;
}

.ntm-qs-label {
    font-size: 10px;
    font-weight: 900;
    color: var(--ntm-slate-300);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    display: block;
}

.ntm-qs-years {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.ntm-qs-years::-webkit-scrollbar {
    display: none;
}

.ntm-qs-year-btn,
.ntm-qs-month-btn {
    padding: 10px 20px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 900;
    background: var(--ntm-slate-50);
    color: var(--ntm-slate-400);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ntm-qs-year-btn:hover,
.ntm-qs-month-btn:hover {
    background: var(--ntm-slate-100);
}

.ntm-qs-year-btn.active,
.ntm-qs-month-btn.active {
    background: var(--ntm-zen-green);
    color: white;
    box-shadow: 0 8px 24px -4px rgba(91, 99, 77, 0.3);
}

.ntm-qs-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    flex: 1;
}

.ntm-qs-month-btn {
    padding: 16px;
}

.ntm-qs-confirm {
    margin-top: 24px;
    width: 100%;
    padding: 16px;
    background: var(--ntm-slate-800);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s;
}

.ntm-qs-confirm:hover {
    background: var(--ntm-slate-900);
}

.ntm-qs-confirm:active {
    transform: scale(0.98);
}

/* ===== 快捷天数预设 ===== */
.ntm-quick-days {
    margin-top: 24px;
    /* 40px -> 24px */
    padding-top: 20px;
    /* 40px -> 20px */
    border-top: 1px solid var(--ntm-slate-100);
}

.ntm-quick-days-row {
    display: flex;
    gap: 8px;
}

.ntm-quick-day-btn {
    flex: 1;
    padding: 12px;
    background: white;
    border: 1px solid var(--ntm-slate-100);
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ntm-slate-400);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ntm-quick-day-btn:hover {
    border-color: var(--ntm-zen-green);
    color: var(--ntm-zen-green);
}

.ntm-quick-day-btn:active {
    transform: scale(0.95);
}

/* ===== 响应式 ===== */
@media (max-width: 860px) {
    .new-trip-modal {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 32px;
    }

    .ntm-config-panel {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid var(--ntm-slate-100);
        padding: 32px;
    }

    .ntm-calendar-panel {
        padding: 32px;
    }

    .ntm-date-preview {
        margin-top: 24px;
    }
}