﻿/* ===== Custom Datepicker ===== */

.dp-input-card {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 14px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    width: 100%;
}

    .dp-input-card:hover, .dp-input-card.active {
        border-color: #845EC2;
        box-shadow: 0 0 0 3px rgba(132,94,194,0.12);
    }

.dp-input-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.dp-input-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.dp-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, #845EC2, #D65F8E);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dp-popup {
    width: 100%;
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    display: none;
    position: absolute;
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 0.5px solid #eee;
    animation: dpPopIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
    left: 0;
    top: auto;
    bottom: auto;
    height: auto; /* grows with content */
    /* no overflow property — let it grow freely */
}

    .dp-popup.open {
        display: block;
    }

@keyframes dpPopIn {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(-8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dp-nav {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    color: #333;
}

    .dp-nav:hover {
        background: #ede9f8;
        color: #845EC2;
    }

.dp-month-label {
    font-size: 10px;
    font-weight: 600;
    color: #333;
}

.dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}

.dp-weekday {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    padding: 3px 0;
    font-weight: 500;
}

.dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.dp-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.12s, transform 0.1s;
    position: relative;
    color: #333;
}

    .dp-day:hover:not(.dp-other-month):not(.dp-selected) {
        background: #f0ebff;
        transform: scale(1.1);
    }

    .dp-day.dp-other-month {
        color: #ccc;
        cursor: default;
    }

    .dp-day.dp-today {
        color: #845EC2;
        font-weight: 700;
    }

        .dp-day.dp-today::after {
            content: '';
            position: absolute;
            bottom: 2px;
            left: 50%;
            transform: translateX(-50%);
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: #845EC2;
        }

    .dp-day.dp-selected {
        background: linear-gradient(135deg, #845EC2, #D65F8E) !important;
        color: white !important;
        font-weight: 600;
        transform: scale(1.12);
        box-shadow: 0 4px 12px rgba(132,94,194,0.4);
    }

        .dp-day.dp-selected::after {
            display: none;
        }

.dp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

    .dp-footer button {
        font-size: 12px;
        border: none;
        background: none;
        cursor: pointer;
        padding: 4px 10px;
        border-radius: 8px;
        font-weight: 500;
        transition: background 0.15s;
    }

.dp-today-btn {
    color: #845EC2;
    background: rgba(132,94,194,0.08) !important;
}

    .dp-today-btn:hover {
        background: rgba(132,94,194,0.18) !important;
    }

.dp-clear-btn {
    color: #999;
}

    .dp-clear-btn:hover {
        background: #f5f5f5 !important;
    }

/* ===== Month/Year Picker Overlay ===== */
.dp-month-year-picker {
    display: none;
    position: relative; /* flows in document — no overlay */
    background: #fff;
    border-radius: 0;
    padding: 0;
    z-index: 10;
    animation: dpPopIn 0.15s cubic-bezier(0.34,1.56,0.64,1);
    overflow: visible; /* no scroll ever */
}

    .dp-month-year-picker.open {
        display: flex;
        flex-direction: column;
    }

.dp-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

    .dp-picker-header span {
        font-size: 14px;
        font-weight: 600;
        color: #333;
    }

.dp-back-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.15s;
}

    .dp-back-btn:hover {
        background: #ede9f8;
        color: #845EC2;
    }

.dp-year-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

    .dp-year-nav span {
        font-size: 13px;
        font-weight: 600;
        color: #555;
    }

.dp-year-nav-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.15s;
}

    .dp-year-nav-btn:hover {
        background: #ede9f8;
        color: #845EC2;
    }

.dp-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.dp-year-item {
    padding: 6px 4px;
    text-align: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
    transition: background 0.12s, color 0.12s, transform 0.1s;
    border: 1.5px solid transparent;
}

    .dp-year-item:hover {
        background: #f0ebff;
        color: #845EC2;
        transform: scale(1.05);
    }

    .dp-year-item.dp-year-selected {
        background: linear-gradient(135deg, #845EC2, #D65F8E);
        color: white !important;
        border-color: transparent;
        box-shadow: 0 3px 10px rgba(132,94,194,0.35);
    }

    .dp-year-item.dp-year-current {
        border-color: #845EC2;
        color: #845EC2;
        font-weight: 700;
    }

        .dp-year-item.dp-year-current.dp-year-selected {
            color: white !important;
        }

.dp-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.dp-month-item {
    padding: 8px 4px;
    text-align: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
    transition: background 0.12s, color 0.12s, transform 0.1s;
    border: 1.5px solid transparent;
}

    .dp-month-item:hover {
        background: #f0ebff;
        color: #845EC2;
        transform: scale(1.05);
    }

    .dp-month-item.dp-month-selected {
        background: linear-gradient(135deg, #845EC2, #D65F8E);
        color: white !important;
        border-color: transparent;
        box-shadow: 0 3px 10px rgba(132,94,194,0.35);
    }

    .dp-month-item.dp-month-current {
        border-color: #845EC2;
        color: #845EC2;
        font-weight: 700;
    }

        .dp-month-item.dp-month-current.dp-month-selected {
            color: white !important;
        }

/* ===== End Custom Datepicker ===== */
