/* ===== Thai DateTime Picker Styles ===== */

/* Trigger button (the date display field) */
.tdp-trigger-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.tdp-trigger-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #D4A8F0;
    border-radius: 9px;
    background: #FAFAFA;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.95rem;
    color: #999;
    transition: all 0.2s;
    text-align: left;
}
.tdp-trigger-btn:hover,
.tdp-trigger-btn:focus {
    border-color: #8408CB;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(132,8,203,0.12);
    outline: none;
}
.tdp-trigger-btn .tdp-cal-icon {
    background: #8408CB;
    color: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.85rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tdp-trigger-btn .tdp-display-text {
    flex: 1;
}
.tdp-trigger-btn .tdp-display-text.tdp-has-value {
    color: #1A0033;
    font-weight: 600;
}
.tdp-trigger-btn .tdp-chevron {
    color: #8408CB;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ===== Overlay ===== */
.tdp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.25);
    align-items: center;
    justify-content: center;
}
.tdp-overlay.tdp-open {
    display: flex;
}

/* ===== Popup ===== */
.tdp-popup {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 60px rgba(132,8,203,0.25), 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 300px;
    font-family: 'Sarabun', sans-serif;
    animation: tdp-fade-in 0.15s ease;
}
@keyframes tdp-fade-in {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Navigation */
.tdp-nav {
    background: linear-gradient(135deg, #8408CB, #A030E0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
}
.tdp-month-label {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.tdp-nav-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.tdp-nav-btn:hover { background: rgba(255,255,255,0.32); }

/* Day headers */
.tdp-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #F3E5FF;
    padding: 6px 10px;
}
.tdp-day-headers span {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5A3080;
    padding: 4px 0;
}
.tdp-day-headers span.sun { color: #E53935; }
.tdp-day-headers span.sat { color: #1565C0; }

/* Days grid */
.tdp-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px 10px;
}
.tdp-day {
    background: none;
    border: none;
    border-radius: 8px;
    width: 36px; height: 36px;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    color: #1A0033;
    margin: auto;
    display: flex; align-items: center; justify-content: center;
}
.tdp-day:hover { background: #F3E5FF; color: #8408CB; }
.tdp-day.sun { color: #E53935; }
.tdp-day.sat { color: #1565C0; }
.tdp-day.today {
    border: 2px solid #8408CB;
    color: #8408CB;
    font-weight: 700;
}
.tdp-day.selected {
    background: #8408CB;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(132,8,203,0.35);
}
.tdp-day.selected.today { border-color: #fff; }

/* Time section */
.tdp-time-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: #FAF0FF;
    border-top: 1px solid #E8D0FF;
}
.tdp-clock-icon {
    font-size: 1.1rem;
    color: #8408CB;
}
.tdp-time-section select {
    border: 1.5px solid #D4A8F0;
    border-radius: 7px;
    padding: 6px 10px;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1A0033;
    background: #fff;
    cursor: pointer;
    outline: none;
    min-width: 62px;
    transition: border-color 0.2s;
}
.tdp-time-section select:focus { border-color: #8408CB; }
.tdp-sep {
    font-size: 1.2rem;
    font-weight: 700;
    color: #5A3080;
}
.tdp-unit {
    font-size: 0.88rem;
    font-weight: 600;
    color: #5A3080;
}

/* Close button */
.tdp-close-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #E53935, #EF5350);
    color: #fff;
    border: none;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 0.5px;
}
.tdp-close-btn:hover { opacity: 0.88; }
