/* ============================================================
 * TimePicker – polished AM/PM time-picker styles
 * ============================================================ */

/* ---------- Wrapper ---------- */
.tp-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* ---------- Input ---------- */
.tp-input {
    cursor: pointer;
    background-color: #fff;
}

/* ---------- Panel ---------- */
.tp-panel {
    display: none;
    position: absolute;
    z-index: 99999;
    top: calc(100% + 6px);
    left: 0;
    width: 272px;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 12px;
    box-shadow:
        0 6px 16px rgba(0, 0, 0, .08),
        0 3px 6px rgba(0, 0, 0, .06),
        0 1px 2px rgba(0, 0, 0, .04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: #303133;
    user-select: none;
    overflow: hidden;
}

.tp-panel.open {
    display: block;
    animation: tpFadeIn .22s cubic-bezier(.23, 1, .32, 1);
}

@keyframes tpFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Header ---------- */
.tp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tp-header-time {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.tp-header-period {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tp-period-btn {
    display: block;
    width: 48px;
    padding: 5px 0;
    border: 1.5px solid rgba(255, 255, 255, .45);
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, .8);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all .2s ease;
    line-height: 1.2;
    letter-spacing: .5px;
}

.tp-period-btn:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .7);
    color: #fff;
}

.tp-period-btn.active {
    background: #fff;
    color: #764ba2;
    border-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* ---------- Body (scrollable columns) ---------- */
.tp-body {
    display: flex;
    height: 220px;
}

.tp-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-width: 0;
    min-height: 0;
}

.tp-column + .tp-column {
    border-left: 1px solid #f0f0f0;
}

.tp-column-title {
    padding: 8px 0;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #a8abb2;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: #fafbfc;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.tp-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
    position: relative;
    scroll-behavior: smooth;
}

/* Scrollbar */
.tp-list::-webkit-scrollbar {
    width: 3px;
}

.tp-list::-webkit-scrollbar-track {
    background: transparent;
}

.tp-list::-webkit-scrollbar-thumb {
    background: #dcdfe6;
    border-radius: 3px;
}

.tp-list::-webkit-scrollbar-thumb:hover {
    background: #c0c4cc;
}

/* ---------- List item ---------- */
.tp-item {
    padding: 8px 0;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    color: #606266;
    transition: all .15s ease;
    font-variant-numeric: tabular-nums;
    position: relative;
}

.tp-item:hover {
    background: #f5f0ff;
    color: #764ba2;
}

.tp-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    margin: 2px 8px;
    padding: 6px 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, .35);
}

/* ---------- Footer ---------- */
.tp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fafbfc;
    border-top: 1px solid #f0f0f0;
}

.tp-btn {
    padding: 6px 20px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    line-height: 1.5;
    letter-spacing: .3px;
}

.tp-btn:active {
    transform: scale(.96);
}

.tp-btn-clear {
    background: #f4f4f5;
    color: #909399;
}

.tp-btn-clear:hover {
    background: #e9e9eb;
    color: #606266;
}

.tp-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(102, 126, 234, .3);
}

.tp-btn-confirm:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, .45);
    transform: translateY(-1px);
}

.tp-btn-confirm:active {
    transform: translateY(0) scale(.96);
}
