/**
 * Time Picker Styles for Excelizer
 *
 * This file contains all the styles for the time picker component
 * used in the Excelizer plugin admin interface.
 *
 * @package    Excelizer
 * @subpackage Assets/CSS
 * @since      1.0.0
 * @author     VortixDesign <support@vortixdesign.com>
 * @link       https://vortixdesign.com/plugins/excelizer
 * @license    GPL-2.0+
 * @copyright  2025 VortixDesign
 */

.excelizer-time-picker-demo {
    max-width: 600px;
    margin: 20px;
}

.excelizer-demo-container {
    background: #fff;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.time-picker-container {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    transition: all 0.3s ease;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.time-picker-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.time-picker-container h2 {
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.time-picker-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-picker-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #23282d;
}

.time-picker-container select,
.time-picker-container input[type="text"] {
    display: block;
    width: 100%;
    max-width: 200px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    background-color: #fff;
    background-image: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-right: 8px;
}

.time-picker-container select:focus,
.time-picker-container input[type="text"]:focus {
    border-color: var(--pm-primary-color);
    box-shadow: 0 0 0 1px var(--pm-primary-color);
    outline: none;
}

/* Styles for the custom time picker */
.custom-time-picker {
    position: relative;
    width: 100%;
    display: inline-block;
    z-index: 1;
}

.custom-time-picker.open {
    z-index: 9;
}

.custom-time-picker .time-picker-display {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--pm-border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--pm-background-color);
}

.custom-time-picker .time-picker-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.custom-time-picker .time-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
    gap: 5px;
}

.custom-time-picker.open .time-picker-dropdown {
    display: flex;
}

.custom-time-picker .time-header {
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center;
    font-size: 12px;
    color: #555;
}

/* Contenedor principal del selector de tiempo */
.custom-time-picker .time-column {
    position: relative;
    overflow: hidden;
}

.custom-time-picker .time-content {
    overflow-y: auto;
    max-height: 210px;
    mask-image: linear-gradient(to bottom,
            transparent -10%,
            black 20%,
            black 80%,
            transparent 110%);
    -webkit-mask-image: linear-gradient(to bottom,
            transparent -10%,
            black 20%,
            black 80%,
            transparent 110%);
    height: 100%;
}

.period-column .time-list {
    height: 100%;
}

.custom-time-picker .time-content::-webkit-scrollbar {
    display: none;
}

.custom-time-picker .time-list {
    border-radius: 3px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

/* Estilo para el ítem activo */
.custom-time-picker .time-item.active {
    background: var(--pm-primary-color);
    color: #fff;
    font-weight: bold;
    z-index: 2;
    position: relative;
}

.custom-time-picker .time-item {
    padding: 5px 10px;
    cursor: pointer;
    text-align: center;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-time-picker .time-item:hover,
.custom-time-picker .time-item.active {
    background: var(--pm-primary-color);
    color: #fff;
}

.time-picker-display {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #dededf;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    gap: 3px;
}

.time-picker-display:hover {
    border-color: var(--pm-primary-color);
}

.time-display {
    margin-right: 4px;
    letter-spacing: .5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.time-picker-toggle {
    margin-left: auto;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.time-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    width: 210px;
    margin-top: 5px;
    border: 1px solid #dededf;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.time-column {
    flex: 1;
    max-height: 250px;
    overflow-y: auto;
    font-size: 14px;
}

.time-column.period-column {
    min-width: 62px;
}

.time-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    text-align: center;
    padding: 4px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}

.time-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.time-item {
    padding: 6px 8px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* Custom scrollbar styles */
.time-content::-webkit-scrollbar {
    width: 3px;
}

.time-content::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 2px;
}

.time-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 1.5px;
}

.time-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* For Firefox */
.time-content {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f8f9fa;
}

/* Hide period display for 24-hour format */
.custom-time-picker[data-format="24h"] .period-display {
    display: none;
}

/* Number container (hours and minutes)*/
.numInputWrapper {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 100%;
}

.numInputWrapper input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    color: #2c3338;
    -moz-appearance: textfield;
}

.numInputWrapper input::-webkit-outer-spin-button,
.numInputWrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    margin: 0;
}

/* Arrow Up and Down */
.numInputWrapper .arrowUp,
.numInputWrapper .arrowDown {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.numInputWrapper .arrowUp {
    top: 0;
    border-bottom: 1px solid #eee;
}

.numInputWrapper .arrowDown {
    bottom: 0;
}

.numInputWrapper:hover .arrowUp,
.numInputWrapper:hover .arrowDown {
    opacity: 0.3;
}

.numInputWrapper .arrowUp:hover,
.numInputWrapper .arrowDown:hover {
    opacity: 0.8;
}

/* Time separator */
.flatpickr-time-separator {
    margin: 0 2px;
    color: #2c3338;
    font-weight: bold;
}

/* AM/PM selector */
.flatpickr-am-pm {
    margin-left: 10px;
    padding: 0 8px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.flatpickr-am-pm:hover {
    background: #f0f0f0;
}

/* Description */
.time-picker-container .description {
    color: #646970;
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0 0;
    font-style: normal;
}

/* Styles for Flatpickr container */
.flatpickr-time {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 5px 10px;
}

/* Flexible container for time selectors */
.time-selector-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.time-selector-group .time-selector {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

/* Mobile improvements */
@media screen and (max-width: 782px) {
    .time-selector-group {
        flex-direction: column;
    }

    .time-selector-group .time-selector {
        max-width: 100%;
    }
}