/* ═══════════════════════════════════════════════════════════════
   Nepali-English Dual Date Calendar — Premium UI
   ═══════════════════════════════════════════════════════════════ */

/* Overlay backdrop */
.nec-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nec-overlay.nec-visible {
    opacity: 1;
}

/* Calendar container */
.nec-calendar {
    position: fixed;
    z-index: 9999;
    width: 380px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.18),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    background: #ffffff;
    transform: translateY(10px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.25s ease;
    pointer-events: none;
}
.nec-calendar.nec-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* ═══ Header ═══ */
.nec-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 18px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Animated bus in header */
.nec-header::before {
    content: '🚌';
    position: absolute;
    font-size: 28px;
    top: 8px;
    animation: necBusDrive 8s linear infinite;
    opacity: 0.15;
    filter: brightness(0) invert(1);
}
@keyframes necBusDrive {
    0% { left: -40px; opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { left: calc(100% + 40px); opacity: 0; }
}

/* Decorative road line - lighter for blue background */
.nec-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.2) 0px,
        rgba(255,255,255,0.2) 12px,
        transparent 12px,
        transparent 24px
    );
    animation: necRoadScroll 3s linear infinite;
}
@keyframes necRoadScroll {
    from { background-position: 0 0; }
    to { background-position: 24px 0; }
}

.nec-nav {
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}
.nec-nav:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.05);
}
.nec-nav:active {
    transform: scale(0.95);
}

.nec-title {
    text-align: center;
    flex: 1;
}
.nec-title-bs {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    letter-spacing: 0.5px;
}
.nec-title-ad {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-top: 2px;
    letter-spacing: 0.3px;
}

/* ═══ Calendar Body ═══ */
.nec-body {
    padding: 8px 12px 12px;
    background: #fff;
}

/* ═══ Table ═══ */
.nec-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
}

.nec-table th {
    padding: 8px 2px 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nec-table th.nec-saturday {
    color: #f87171;
}

/* ═══ Day Cells ═══ */
.nec-table td {
    padding: 0;
    text-align: center;
    vertical-align: middle;
    position: relative;
    height: 50px;
    width: 48px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nec-table td.nec-empty {
    background: transparent;
}

.nec-table td.nec-day {
    cursor: pointer;
    border-radius: 12px;
    background: transparent;
    transition: all 0.2s ease;
}
.nec-table td.nec-day:hover:not(.nec-past) {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}
.nec-table td.nec-day:active:not(.nec-past) {
    transform: scale(0.95);
}
.nec-table td.nec-day.nec-past {
    opacity: 0.25;
    cursor: not-allowed;
}

/* BS date (main Nepali number) */
.nec-bs {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    padding-top: 6px;
    line-height: 1.15;
}

/* AD date (small English subscript) */
.nec-ad {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: #cbd5e1;
    line-height: 1;
    margin-top: 1px;
    transition: color 0.2s;
}

/* Saturday */
.nec-day.nec-saturday .nec-bs {
    color: #ef4444;
}
.nec-day.nec-saturday .nec-ad {
    color: #fca5a5;
}

/* Today */
.nec-day.nec-today {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%) !important;
    border: 2px solid #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
.nec-day.nec-today .nec-bs {
    color: #4f46e5;
}
.nec-day.nec-today .nec-ad {
    color: #818cf8;
}

/* Selected */
.nec-day.nec-selected {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%) !important;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(58, 123, 213, 0.35);
    transform: scale(1.05);
}
.nec-day.nec-selected .nec-bs {
    color: #fff;
    font-weight: 800;
}
.nec-day.nec-selected .nec-ad {
    color: rgba(255,255,255,0.9);
}

/* ═══ Footer ═══ */
.nec-footer {
    padding: 10px 16px 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, #fff, #fafbff);
}
.nec-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}
.nec-footer-bus {
    font-size: 16px;
    animation: necBusBounce 2s ease-in-out infinite;
}
@keyframes necBusBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
.nec-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nec-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}
.nec-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    display: inline-block;
}
.nec-legend-dot.nec-legend-today {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}
.nec-legend-dot.nec-legend-selected {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}
.nec-legend-dot.nec-legend-sat {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

/* ═══ Month/Year Picker Mode ═══ */
.nec-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px 16px;
}
.nec-month-btn {
    padding: 10px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
}
.nec-month-btn:hover {
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border-color: #818cf8;
    color: #4f46e5;
    transform: scale(1.05);
}
.nec-month-btn.nec-active-month {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ═══ Year Picker ═══ */
.nec-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 12px 16px 16px;
    max-height: 280px;
    overflow-y: auto;
}
.nec-year-grid::-webkit-scrollbar {
    width: 4px;
}
.nec-year-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}
.nec-year-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}
.nec-year-btn {
    padding: 8px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
}
.nec-year-btn:hover {
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border-color: #818cf8;
    color: #4f46e5;
}
.nec-year-btn.nec-active-year {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* ═══ Today button ═══ */
.nec-today-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2ff, #eff6ff);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #4f46e5;
    transition: all 0.2s;
}
.nec-today-btn:hover {
    background: linear-gradient(135deg, #e0e7ff, #dbeafe);
    border-color: #818cf8;
    transform: scale(1.05);
}

/* ═══ Responsive ═══ */
@media (max-width: 480px) {
    .nec-calendar {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px !important;
        border-radius: 16px;
    }
    .nec-header {
        padding: 14px 16px 12px;
    }
    .nec-table td {
        height: 44px;
        width: 42px;
    }
}
