/* Custom Three-Column Time Picker Styles */

.custom-timepicker-trigger {
    width: 100%;
    padding: 0.7857em 1.4286em;
    border: solid 2px #f3f5f8 !important;
    border-radius: 0;
    background-color: #f3f5f8 !important;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    height: 3.6429em;
    display: flex;
    align-items: center;
    transition: border-color 0.3s;
    box-sizing: border-box;
    line-height: 1.7857em;
    box-shadow: none !important;
}

.custom-timepicker-trigger:hover {
    border-color: #48c7de !important;
}

.custom-timepicker-trigger .time-display {
    flex: 1;
}

.custom-timepicker-trigger::after {
    content: '🕐';
    margin-left: 10px;
    opacity: 0.6;
}

.custom-timepicker-picker {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.custom-timepicker-picker.open {
    display: flex;
}

.custom-timepicker-container {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.custom-timepicker-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.custom-timepicker-header .picker-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.custom-timepicker-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 250px;
}

/* Reuse picker column styles from datepicker */
.custom-timepicker-picker .picker-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
    overflow: hidden;
}

.custom-timepicker-picker .picker-column:last-child {
    border-right: none;
}

.custom-timepicker-picker .picker-column-header {
    padding: 10px;
    text-align: center;
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.custom-timepicker-picker .picker-column-content {
    flex: 1;
    overflow-y: auto;
    padding: 120px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.custom-timepicker-picker .picker-item {
    padding: 14px;
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    transition: background-color 0.2s, color 0.2s;
    user-select: none;
    -webkit-user-select: none;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(33, 150, 243, 0.2);
}

.custom-timepicker-picker .picker-item:hover {
    background-color: #f0f0f0;
}

.custom-timepicker-picker .picker-item.selected {
    background-color: #2196F3;
    color: #fff;
    font-weight: 600;
}

.custom-timepicker-picker .picker-column-content::-webkit-scrollbar {
    width: 4px;
}

.custom-timepicker-picker .picker-column-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-timepicker-picker .picker-column-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.custom-timepicker-picker .picker-column-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.custom-timepicker-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.custom-timepicker-picker .picker-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.custom-timepicker-picker .picker-btn:active {
    transform: scale(0.98);
}

.custom-timepicker-picker .picker-btn-cancel {
    background-color: #f5f5f5;
    color: #666;
}

.custom-timepicker-picker .picker-btn-cancel:hover {
    background-color: #e0e0e0;
}

.custom-timepicker-picker .picker-btn-confirm {
    background-color: #2196F3;
    color: #fff;
}

.custom-timepicker-picker .picker-btn-confirm:hover {
    background-color: #1976D2;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .custom-timepicker-container {
        width: 95%;
        max-height: 60vh;
    }
    
    .custom-timepicker-header {
        padding: 10px 15px;
    }
    
    .custom-timepicker-header .picker-title {
        font-size: 16px;
    }
    
    .custom-timepicker-body {
        height: 200px;
    }
    
    .custom-timepicker-picker .picker-item {
        font-size: 15px;
        padding: 10px;
        min-height: 40px;
        touch-action: manipulation;
    }
    
    .custom-timepicker-picker .picker-column-header {
        font-size: 12px;
        padding: 8px;
    }
    
    .custom-timepicker-picker .picker-column-content {
        padding: 100px 0;
    }
    
    .custom-timepicker-footer {
        padding: 10px;
    }
    
    .custom-timepicker-picker .picker-btn {
        min-height: 44px;
        font-size: 15px;
        padding: 10px;
    }
}

/* Hide native time input when using custom picker */
input[type="time"].custom-timepicker-active {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
