/**
 * Ekwa Vanilla Datepicker Styles
 * Light, clean calendar UI — no external dependencies.
 */

/* ── Input ─────────────────────────────────────────────────────────── */

.ekwa-datepicker,
.form-datepicker input[type="text"] {
    width: 100% !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    padding-right: 10px !important;
    padding-left: 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background: #fff !important;
    color: #333 !important;
    box-sizing: border-box !important;
    transition: border-color 0.3s ease !important;
    cursor: pointer !important;
}

.form-datepicker input[readonly] {
    background-color: #fff !important;
    color: #333 !important;
}

.form-datepicker input:focus,
.ekwa-datepicker:focus {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 1px #0073aa !important;
    outline: none !important;
}

/* ── Calendar container ────────────────────────────────────────────── */

.ekwa-dp-calendar {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    margin-top: 4px;
    width: 280px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    padding: 12px;
    box-sizing: border-box;
}

/* ── Header (prev / title / next) ──────────────────────────────────── */

.ekwa-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ekwa-dp-title {
    font-weight: 600;
    font-size: 15px;
    color: #222;
    user-select: none;
}

.ekwa-dp-prev,
.ekwa-dp-next {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.15s, color 0.15s;
}

.ekwa-dp-prev:hover,
.ekwa-dp-next:hover {
    background: #f5f5f5;
    color: #222;
}

/* ── Day-of-week labels ────────────────────────────────────────────── */

.ekwa-dp-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 4px;
}

.ekwa-dp-dow span {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    padding: 4px 0;
}

/* ── Days grid ─────────────────────────────────────────────────────── */

.ekwa-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ekwa-dp-blank {
    /* empty cells before the 1st */
}

.ekwa-dp-day {
    background: none;
    border: none;
    border-radius: 6px;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.ekwa-dp-day:hover:not(.ekwa-dp-disabled):not(.ekwa-dp-selected) {
    background: #f0f4ff;
    color: #0073aa;
}

.ekwa-dp-day:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
    z-index: 1;
}

/* Today */
.ekwa-dp-today {
    font-weight: 700;
    border: 1px solid #ccc;
}

/* Selected */
.ekwa-dp-selected {
    background: #0073aa !important;
    color: #fff !important;
    font-weight: 600;
}

/* Disabled */
.ekwa-dp-disabled {
    color: #ccc !important;
    cursor: default !important;
    pointer-events: none;
}

/* ── Warning ───────────────────────────────────────────────────────── */

.form-datepicker {
    position: relative;
}

.form-datepicker .date-warning {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1;
    margin-top: 2px;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 545px) {
    .ekwa-datepicker,
    .form-datepicker input {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        font-size: 16px !important; /* prevent iOS zoom */
    }

    .form-datepicker {
        width: 100% !important;
        display: block !important;
    }

    .ekwa-dp-calendar {
        width: 100% !important;
        max-width: calc(100vw - 20px) !important;
    }
}