/*
* Custom Date Input Placeholder Solution
* Replaces browser default dd/mm/yyyy with custom text
*/

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

.appointment_form input[type="date"] {
    color: transparent;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 15px 25px 15px 50px;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
    height: 55px;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* Custom placeholder for date input */
.appointment_form .date-field::after {
    content: "Date of Meeting";
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Hide custom placeholder when input has focus or value */
.appointment_form input[type="date"]:focus + ::after,
.appointment_form input[type="date"]:valid + ::after,
.appointment_form .date-field:focus-within::after {
    opacity: 0;
}

/* Show actual date value when selected */
.appointment_form input[type="date"]:valid {
    color: #1a1a1a !important;
}

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

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

/* Ensure calendar picker indicator works */
.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;
}

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

/* Alternative approach using data attribute */
.appointment_form input[type="date"][value=""]:before {
    content: attr(data-placeholder);
    color: #adb5bd;
}

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