/**
 * YachtFriends Custom Drum-Roll Timepicker (24-Hour Format)
 * Tooltip Popover with 24-Hour Hours (10-23) and Minutes (00-59)
 */

/* Trigger Input Box */
.yf-custom-timepicker-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.yf-custom-timepicker-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.yf-custom-timepicker-display:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.yf-custom-timepicker-display.is-active,
.yf-custom-timepicker-display:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
    outline: none;
}

.yf-custom-timepicker-display .yf-time-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #0f172a;
}

.yf-custom-timepicker-display .yf-time-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #64748b;
}

.yf-custom-timepicker-display .yf-time-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.yf-custom-timepicker-display .yf-time-arrow {
    display: inline-flex;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.yf-custom-timepicker-display.is-active .yf-time-arrow {
    transform: rotate(180deg);
}

/* Invisible Click-Outside Backdrop */
.yf-timepicker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 999998;
    display: none;
}

.yf-timepicker-backdrop.is-open {
    display: block;
}

/* Tooltip Popup (Attached to input like Calendar) */
.yf-timepicker-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 250px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    padding: 16px 16px 12px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease, visibility 0.18s ease;
    user-select: none;
    -webkit-user-select: none;
}

.yf-timepicker-popup.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Tooltip Arrow */
.yf-timepicker-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 24px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
    z-index: 4;
}

/* Header with Outlined Box and Floating Label */
.yf-tp-header {
    position: relative;
    margin-bottom: 14px;
}

.yf-tp-input-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 12px;
    border: 1.5px solid #38bdf8;
    border-radius: 8px;
    background: #ffffff;
    box-sizing: border-box;
}

.yf-tp-floating-label {
    position: absolute;
    top: -8px;
    left: 10px;
    padding: 0 5px;
    background: #ffffff;
    font-size: 11px;
    font-weight: 600;
    color: #0284c7;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    line-height: 1;
}

.yf-tp-current-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 1px;
}

.yf-tp-clock-icon {
    display: inline-flex;
    color: #1e293b;
}

.yf-tp-clock-icon svg {
    width: 18px;
    height: 18px;
}

.yf-tp-cursor {
    display: inline-block;
    width: 1.5px;
    height: 18px;
    background: #0284c7;
    margin-left: 1px;
    animation: yf-tp-blink 1s infinite;
}

@keyframes yf-tp-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Scoped Button Reset to Prevent Theme Overrides */
.yf-timepicker-popup button,
.yf-timepicker-popup .yf-tp-close-btn,
.yf-timepicker-popup .yf-tp-btn {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    min-height: unset !important;
    line-height: 1 !important;
    text-shadow: none !important;
}

.yf-tp-close-btn {
    padding: 4px !important;
    color: #64748b !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: background-color 0.15s !important;
}

.yf-tp-close-btn:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.yf-tp-close-btn svg {
    width: 16px;
    height: 16px;
}

/* Wheels Roller Container */
.yf-tp-wheels-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
    overflow: hidden;
    gap: 16px;
}

/* Colon Separator between Hour and Minute */
.yf-tp-colon-separator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: #e91e63;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* Center Row Highlight Indicator */
.yf-tp-selection-indicator {
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    height: 38px;
    transform: translateY(-50%);
    background: rgba(233, 30, 99, 0.06);
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}

/* Fading Gradient Masks on Top and Bottom */
.yf-tp-gradient-top,
.yf-tp-gradient-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 65px;
    pointer-events: none;
    z-index: 3;
}

.yf-tp-gradient-top {
    top: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 100%);
}

.yf-tp-gradient-bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 100%);
}

/* Individual Wheel Column */
.yf-tp-wheel-column {
    position: relative;
    height: 100%;
    width: 65px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    touch-action: pan-y;
    z-index: 2;
}

.yf-tp-wheel-column::-webkit-scrollbar {
    display: none;
}

.yf-tp-wheel-column.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Wheel Items */
.yf-tp-wheel-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s ease, font-size 0.15s ease, font-weight 0.15s ease;
}

.yf-tp-wheel-item.is-selected {
    color: #e91e63;
    font-size: 20px;
    font-weight: 700;
}

.yf-tp-wheel-padding {
    height: 71px; /* (180px container - 38px item) / 2 */
    width: 100%;
    pointer-events: none;
}

/* Footer Action Buttons */
.yf-tp-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
    padding-top: 6px;
}

.yf-tp-btn {
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    color: #e91e63 !important;
    cursor: pointer !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    transition: background-color 0.15s, color 0.15s !important;
}

.yf-tp-btn:hover {
    background-color: rgba(233, 30, 99, 0.08) !important;
}
