/* ═══════════════════════════════════════════════
   NEPALI DATE PICKER  —  nepali_date app
   Uses CSS variables defined in base.html :root
════════════════════════════════════════════════ */

.ndp-wrapper { position: relative; display: inline-block; width: 100%; }

.ndp-input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: var(--white);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.ndp-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.ndp-text-input {
    flex: 1;
    padding: 9px 12px;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    min-width: 0;
}

.ndp-text-input::placeholder { color: #9ca3af; }

.ndp-cal-trigger {
    flex-shrink: 0;
    padding: 0 12px;
    height: 38px;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    transition: color .15s, background .15s;
}

.ndp-cal-trigger:hover { color: var(--primary); background: var(--primary-lt); }

/* ── Popup ── */
.ndp-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 9999;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14);
    width: 310px;
    overflow: hidden;
    animation: ndp-in .15s ease;
}

@keyframes ndp-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ndp-popup.open { display: block; }

/* ── Header ── */
.ndp-popup-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ndp-month-label {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    padding: 3px 8px;
    border-radius: 6px;
    transition: background .15s;
}

.ndp-month-label:hover { background: rgba(255,255,255,.2); }

.ndp-arrow {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    line-height: 1;
}

.ndp-arrow:hover { background: rgba(255,255,255,.3); }

/* ── AD strip ── */
.ndp-ad-strip {
    background: #f8f7ff;
    border-bottom: 1px solid var(--border);
    padding: 6px 16px;
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Weekdays ── */
.ndp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 10px 14px 2px;
}

.ndp-wday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    padding: 4px 0;
}

.ndp-wday.sat { color: #ef4444; }

/* ── Day grid ── */
.ndp-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 2px 14px 10px;
    gap: 1px;
}

.ndp-day {
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: #374151;
    border-radius: 7px;
    cursor: pointer;
    user-select: none;
    transition: background .12s, color .12s;
}

.ndp-day:hover              { background: var(--primary-lt); color: var(--primary); }
.ndp-day.is-today           { color: var(--primary); font-weight: 800; position: relative; }
.ndp-day.is-today::after {
    content: '';
    display: block;
    width: 4px; height: 4px;
    background: var(--primary);
    border-radius: 50%;
    margin: 2px auto 0;
}
.ndp-day.is-selected        { background: var(--primary); color: #fff; font-weight: 700; }
.ndp-day.is-selected:hover  { background: var(--primary-dk); color: #fff; }
.ndp-day.is-selected.is-today::after { background: rgba(255,255,255,.7); }
.ndp-day.is-sat             { color: #ef4444; }
.ndp-day.is-sat.is-selected { color: #fff; }
.ndp-day.is-empty           { cursor: default; pointer-events: none; }

/* ── Footer ── */
.ndp-popup-footer {
    padding: 10px 14px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ndp-btn-today {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-lt);
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
}
.ndp-btn-today:hover { background: #e0e7ff; }

.ndp-btn-clear {
    font-size: 12px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
}
.ndp-btn-clear:hover { background: var(--bg); }

/* ── Month / Year selector ── */
.ndp-selector { display: none; padding: 14px; }
.ndp-selector.open { display: block; }

.ndp-year-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ndp-year-lbl { font-size: 18px; font-weight: 800; color: var(--text); }

.ndp-year-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    width: 32px; height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
}

.ndp-year-btn:hover { background: var(--primary-lt); color: var(--primary); }

.ndp-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.ndp-mon-item {
    text-align: center;
    padding: 9px 4px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 7px;
    cursor: pointer;
    color: #374151;
    border: 1px solid transparent;
    transition: all .12s;
}

.ndp-mon-item:hover  { background: var(--primary-lt); color: var(--primary); border-color: #c7d2fe; }
.ndp-mon-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }
