/*
* Enhanced Date and Time Picker Fix
* Ensures proper display of both date and time inputs
*/

/* Force time input to display as time picker */
.appointment_form input[type="time"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 15px 25px 15px 50px;
    font-size: 16px;
    color: #1a1a1a;
    transition: all 0.3s ease;
    width: 100%;
    height: 55px;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* Force date input to display as date picker */
.appointment_form input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 15px 25px 15px 50px;
    font-size: 16px;
    color: #1a1a1a;
    transition: all 0.3s ease;
    width: 100%;
    height: 55px;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* Hide the default date format when empty */
.appointment_form input[type="date"]:invalid {
    color: transparent;
}

.appointment_form input[type="date"]:invalid:before {
    content: "Date of Meeting";
    color: #adb5bd;
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.appointment_form input[type="date"]:focus:invalid {
    color: #1a1a1a;
}

.appointment_form input[type="date"]:focus:invalid:before {
    display: none;
}

/* When date has value, show it normally */
.appointment_form input[type="date"]:valid {
    color: #1a1a1a !important;
}

/* Reset and restore native functionality */
.appointment_form input[type="time"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: 100%;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 3;
}

.appointment_form input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: 100%;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 3;
}

/* Firefox specific */
.appointment_form input[type="time"]::-moz-focus-inner,
.appointment_form input[type="date"]::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Enhanced visual indicators */
.appointment_form .time-field::before {
    content: "🕐";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
    color: #6c757d;
}

.appointment_form .date-field::before {
    content: "📅";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
    color: #6c757d;
}

/* Alternative text labels for better clarity */
.appointment_form .time-field {
    position: relative;
}

.appointment_form .date-field {
    position: relative;
}

/* Add placeholder-like text when empty */
.appointment_form input[type="time"]:invalid {
    color: #adb5bd;
}

.appointment_form input[type="date"]:invalid {
    color: #adb5bd;
}

/* Focused states */
.appointment_form input[type="time"]:focus,
.appointment_form input[type="date"]:focus {
    border-color: #4A90E2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
}

/* Valid states */
.appointment_form input[type="time"]:valid,
.appointment_form input[type="date"]:valid {
    color: #1a1a1a !important;
}

/* Remove spinners on webkit browsers */
.appointment_form input[type="time"]::-webkit-inner-spin-button,
.appointment_form input[type="date"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    display: none;
}

/* Remove clear button */
.appointment_form input[type="time"]::-webkit-clear-button,
.appointment_form input[type="date"]::-webkit-clear-button {
    -webkit-appearance: none;
    display: none;
}

/* Safari specific fixes */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .appointment_form input[type="time"],
        .appointment_form input[type="date"] {
            -webkit-appearance: none;
        }
    }
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .appointment_form input[type="time"],
    .appointment_form input[type="date"] {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 20px 12px 45px;
        height: 50px;
    }
    
    .appointment_form .time-field::before,
    .appointment_form .date-field::before {
        font-size: 18px;
        left: 15px;
    }
}

/* Ensure proper stacking order */
.appointment_form .input-field {
    position: relative;
    z-index: 1;
}

/* Override any conflicting styles */
.appointment_form input[type="time"] {
    background-color: #fff !important;
}

.appointment_form input[type="date"] {
    background-color: #fff !important;
}
