/* =====================================================
   Nepali BS Date Picker Custom Modern CSS
   Theme: Purple  #4c1d95 / #343a40 / #f8f9fa
   ===================================================== */

/* ----- Popup container ----- */
.ndp-popup {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: none;
    border: 1px solid rgba(0,0,0,.12);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 12.5px;
    overflow: hidden;
    min-width: 250px;
    max-width: 270px;
    animation: ndpIn .14s cubic-bezier(.22,.68,0,1.2);
    transform-origin: top center;
}

@keyframes ndpIn {
    from { opacity: 0; transform: scale(.95) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ----- Header ----- */
.ndp-hd {
    background: #4c1d95;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

.ndp-nav {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s;
    line-height: 1;
}
.ndp-nav:hover { background: rgba(255,255,255,.28); }

.ndp-ym {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.ndp-mbtn,
.ndp-ybtn {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
    letter-spacing: .01em;
}
.ndp-mbtn:hover,
.ndp-ybtn:hover { background: rgba(255,255,255,.28); }

/* ----- Body ----- */
.ndp-bd { padding: 8px 8px 3px; }

.ndp-wrow {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    margin-bottom: 4px;
}

.ndp-wname {
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    color: #9ca3af;
    padding: 3px 0;
    letter-spacing: .04em;
}
.ndp-wname.ndp-wkend { color: #f87171; }

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

/* ----- Cells ----- */
.ndp-cell {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 500;
    color: #1f2937;
    transition: background .12s, color .12s, transform .1s, box-shadow .1s;
    user-select: none;
    -webkit-user-select: none;
}
.ndp-cell:not(.ndp-empty):hover {
    background: #f3eeff;
    color: #4c1d95;
    transform: scale(1.08);
}
.ndp-cell.ndp-wkend   { color: #ef4444; }
.ndp-cell.ndp-empty   { cursor: default; pointer-events: none; }

/* Today ring */
.ndp-cell.ndp-today-cell {
    font-weight: 700;
    color: #4c1d95;
    box-shadow: none;
    background: #f8f9fa;
}
.ndp-cell.ndp-today-cell:hover {
    background: #f8f9fa;
}

/* Selected */
.ndp-cell.ndp-sel {
    background: #4c1d95 !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: none;
    transform: scale(1.1);
}
.ndp-cell.ndp-sel:hover {
    background: #3b0764 !important;
    transform: scale(1.12);
}

/* Today+Selected */
.ndp-cell.ndp-sel.ndp-today-cell {
    box-shadow: none;
}

/* ----- Footer ----- */
.ndp-ft {
    padding: 5px 10px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
}

.ndp-today {
    background: none;
    border: none;
    color: #4c1d95;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .13s;
}
.ndp-today:hover { background: #f3eeff; }

.ndp-ad {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

/* ----- Month / Year Overlays ----- */
.ndp-ov {
    display: none;
    flex-direction: column;
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 20;
    padding: 14px;
    border-radius: 14px;
    animation: ndpIn .12s ease;
}
.ndp-ov.ndp-ov-on { display: flex; }

.ndp-ovhd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}
.ndp-ovhd span {
    font-weight: 700;
    font-size: 14px;
    color: #1f2937;
}

.ndp-ovcls {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 15px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
    line-height: 1;
}
.ndp-ovcls:hover {
    background: #f3f4f6;
    color: #111827;
}

.ndp-ovgrid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 6px;
    flex: 1;
    align-content: start;
}

/* Year grid 4 cols + scroll */
.ndp-ygrid {
    grid-template-columns: repeat(4,1fr);
    overflow-y: auto;
    max-height: 210px;
    padding-right: 2px;
}

.ndp-ov-item {
    text-align: center;
    padding: 9px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    border: 1px solid #e5e7eb;
    transition: background .12s, border-color .12s, color .12s;
    user-select: none;
    -webkit-user-select: none;
}
.ndp-ov-item:hover {
    background: #f3eeff;
    border-color: #adb5bd;
    color: #4c1d95;
}
.ndp-ov-item.ndp-ov-sel {
    background: #4c1d95;
    border-color: #4c1d95;
    color: #fff;
    font-weight: 700;
}

/* Custom scrollbar for year grid */
.ndp-ygrid::-webkit-scrollbar       { width: 4px; }
.ndp-ygrid::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 2px; }
.ndp-ygrid::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 2px; }
.ndp-ygrid::-webkit-scrollbar-thumb:hover { background: #4c1d95; }

/* ----- Input field icon hint ----- */
input.np-cal {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%236536b1' stroke-width='1.8'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    padding-right: 34px !important;
    cursor: pointer;
}
