/* Hide Native Picker */
input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    z-index: 1;
}

input[type="date"],
.custom-datepicker-input {
    position: relative;
    background-image: none !important; /* Removed background image */
    cursor: pointer;
    padding-right: 40px !important; /* Make space for icon */
}

.datepicker-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.datepicker-icon {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    pointer-events: none; /* Let clicks pass through to input */
    opacity: 0.8;
    z-index: 2;
}

/* Custom Date Picker Container */
.datepicker-container {
    position: fixed;
    background: var(--sidebar-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    width: 280px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    font-family: var(--font-main);
    backdrop-filter: blur(10px);
    animation: fadeIn var(--transition-normal, 0.2s) ease-out;
}

.datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.datepicker-title {
    font-weight: bold;
    color: var(--text-color);
}

.datepicker-nav {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.datepicker-nav:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-color);
}

.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.datepicker-day-header {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: bold;
    padding-bottom: 5px;
}

.datepicker-day {
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: background 0.2s;
}

.datepicker-day:hover:not(.empty):not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.datepicker-day.selected {
    background: var(--text-color);
    color: #000;
    font-weight: bold;
}

.datepicker-day.today {
    border: 1px solid var(--text-muted);
}

.datepicker-day.empty {
    cursor: default;
}

.datepicker-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
