:root {
  --ndp-primary: #1976d2;
  --ndp-primary-dark: #115293;
  --ndp-primary-light: #e3f2fd;
  --ndp-surface: #ffffff;
  --ndp-on-surface: #212121;
  --ndp-on-surface-muted: #757575;
  --ndp-ripple: rgba(25, 118, 210, 0.12);
  --ndp-shadow-1: 0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --ndp-shadow-2: 0 6px 20px rgba(0, 0, 0, 0.15);
  --ndp-radius-sm: 4px;
  --ndp-radius-md: 8px;
  --ndp-radius-full: 9999px;
  --ndp-font: 'Roboto', sans-serif;
  --ndp-font-np: 'Noto Sans Devanagari', sans-serif;
  --ndp-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --ndp-cell-size: 36px;
  --ndp-width: 280px;
}

.ndp-container {
  position: relative;
  display: inline-block;
  font-family: var(--ndp-font);
}

.ndp-panel {
  width: var(--ndp-width);
  background: var(--ndp-surface);
  color: var(--ndp-on-surface);
  border-radius: var(--ndp-radius-md);
  box-shadow: var(--ndp-shadow-2);
  position: absolute;
  padding: 12px;
  transform: scale(0.95);
  opacity: 0;
  transform-origin: top left;
  transition: transform var(--ndp-transition), opacity var(--ndp-transition);
}

.ndp-panel:empty {
  display: none;
}

.ndp-panel:not(:empty) {
  opacity: 1;
  transform: scale(1);
}

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

.ndp-header__nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--ndp-radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ndp-on-surface);
  position: relative;
  overflow: hidden;
}

.ndp-header__nav-btn svg,
.ndp-header__title svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ndp-header__nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ndp-header__title {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ndp-on-surface);
}

.ndp-grid {
  display: grid;
  grid-template-columns: repeat(7, var(--ndp-cell-size));
  grid-auto-rows: var(--ndp-cell-size);
  gap: 4px;
  justify-content: center;
}

.ndp-weekday {
  font-size: 12px;
  color: var(--ndp-on-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ndp-cell {
  position: relative;
  border: none;
  background: transparent;
  border-radius: var(--ndp-radius-full);
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ndp-transition), color var(--ndp-transition);
  overflow: hidden;
}

.ndp-cell::after,
.ndp-header__nav-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ndp-ripple);
  opacity: 0;
  transition: opacity var(--ndp-transition);
}

.ndp-cell:hover::after,
.ndp-header__nav-btn:hover::after {
  opacity: 1;
}

.ndp-cell--today {
  box-shadow: inset 0 0 0 2px var(--ndp-primary);
}

.ndp-cell--selected {
  background: var(--ndp-primary);
  color: white;
}

.ndp-cell--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.ndp-cell--outside {
  color: var(--ndp-on-surface-muted);
}

.ndp-cell--in-range {
  background: var(--ndp-primary-light);
  color: var(--ndp-on-surface);
}

/* Range endpoints must override in-range styles when both classes are present */
.ndp-cell--range-start,
.ndp-cell--range-end,
.ndp-cell--range-start.ndp-cell--in-range,
.ndp-cell--range-end.ndp-cell--in-range {
  background: var(--ndp-primary) !important;
  color: white !important;
  border-radius: var(--ndp-radius-full) !important;
}

.ndp-cell--hover {
  background: var(--ndp-primary-light);
}

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

.ndp-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.ndp-footer__btn {
  border: none;
  background: transparent;
  color: var(--ndp-primary);
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--ndp-radius-sm);
}

.ndp-input-wrapper {
  position: relative;
}

.ndp-input {
  border: 1px solid #d0d0d0;
  padding: 8px 10px;
  border-radius: var(--ndp-radius-sm);
  font-family: var(--ndp-font);
}

@keyframes ndp-slide-in-left {
  from {
    transform: translateX(-8px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes ndp-slide-in-right {
  from {
    transform: translateX(8px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}