/* Form inputs */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    outline: none;
}
.form-input:focus {
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}
.form-input::placeholder {
    color: #9ca3af;
}
.form-input[readonly] {
    cursor: pointer;
    background-color: #fafafa;
}

/* Custom datetime picker - mobile first */
.datetime-picker-wrapper {
    position: fixed;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    left: 50% !important;
    transform: translateX(-50%);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.datetime-picker-wrapper.active {
    display: flex;
}

/* Calendar */
.datetime-picker-wrapper .flatpickr-calendar {
    box-shadow: none !important;
    border-radius: 0;
    width: 100% !important;
    max-width: 100%;
}
.datetime-picker-wrapper .flatpickr-calendar .flatpickr-innerContainer {
    max-width: 100%;
}

/* Time picker - horizontal on mobile */
.time-picker-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
}

.time-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-column label {
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Scroll wheel */
.time-wheel {
    position: relative;
    height: 100px;
    overflow: hidden;
    width: 50px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    touch-action: none;
    user-select: none;
    cursor: grab;
}
.time-wheel:active {
    cursor: grabbing;
}
.time-wheel::before,
.time-wheel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    z-index: 1;
}
.time-wheel::before {
    top: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}
.time-wheel::after {
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}
.time-wheel-inner {
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    transition: transform 0.2s ease-out;
}
.time-wheel-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}
.time-wheel-item.selected {
    color: #e53935;
    font-weight: bold;
    font-size: 22px;
}

.time-wheel-highlight {
    position: absolute;
    top: 30px;
    left: 4px;
    right: 4px;
    height: 40px;
    background: rgba(229, 57, 53, 0.1);
    border-radius: 4px;
    pointer-events: none;
}

.time-confirm-btn {
    background: #e53935;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

/* Tablet and up - side by side layout */
@media (min-width: 500px) {
    .datetime-picker-wrapper {
        flex-direction: row;
        max-width: none;
        max-height: none;
        overflow-y: visible;
    }

    .time-picker-side {
        flex-direction: column;
        border-top: none;
        border-left: 1px solid #e0e0e0;
        padding: 10px 15px;
        gap: 8px;
    }

    .time-column {
        flex-direction: column;
    }

    .time-wheel {
        height: 120px;
        width: 55px;
    }
    .time-wheel::before,
    .time-wheel::after {
        height: 40px;
    }
    .time-wheel-inner {
        top: 40px;
    }
    .time-wheel-highlight {
        top: 40px;
    }
}

.date-input {
    cursor: pointer !important;
}

/* Mobile backdrop */
.datetime-picker-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
.datetime-picker-backdrop.active {
    display: block;
}
