/* =========================================================
   NVA PREMIUM POPUP CALENDAR SYSTEM
   Theme: #0098FF (primary) | #ffa704 (accent) | #03204B (dark)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* =========================================================
   1. FLOATING CALENDAR BUTTON
   ========================================================= */
.nva-cal-fab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999999;
}

.nva-cal-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50% 0 0 50%;
  background: linear-gradient(135deg, #0098FF 0%, #0049D0 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -4px 4px 20px rgba(0,152,255,0.45);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  outline: none;
}

.nva-cal-fab-btn:hover {
  width: 62px;
  height: 62px;
  box-shadow: -6px 6px 28px rgba(0,152,255,0.6);
}

.nva-cal-fab-btn:hover .nva-cal-fab-tooltip {
  opacity: 1;
  pointer-events: none;
}

.nva-cal-fab-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nva-cal-fab-btn::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50% 0 0 50%;
  background: rgba(0,152,255,0.22);
  animation: nva-pulse 2.4s ease-in-out infinite;
}

@keyframes nva-pulse {
  0%,100% { opacity:0.7; transform:scale(1); }
  50%      { opacity:0;   transform:scale(1.35); }
}

.nva-cal-fab-tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  background: #03204B;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.nva-cal-fab-tooltip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right: none;
  border-left-color: #03204B;
}

/* =========================================================
   2. OVERLAY
   ========================================================= */
.nva-cal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,32,75,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1000000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.nva-cal-overlay.nva-active { opacity:1; visibility:visible; }

/* =========================================================
   3. SIDEBAR PANEL
   ========================================================= */
.nva-cal-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 380px;
  max-width: 100vw;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1000001;
  transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.22,1,0.36,1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 60px rgba(0,73,208,0.18);
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}
.nva-cal-panel.nva-active { transform: translateX(0); }

.nva-cal-header {
  background: linear-gradient(135deg, #0049D0 0%, #0098FF 100%);
  padding: 22px 24px 18px;
  flex-shrink: 0;
}
.nva-cal-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.nva-cal-header-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.nva-cal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none; cursor: pointer;
  color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.nva-cal-close:hover { background: rgba(255,255,255,0.35); transform: rotate(90deg); }

.nva-cal-title-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.nva-cal-month-title { font-size: 22px; font-weight: 700; color: #fff; }

.nva-cal-nav { display: flex; gap: 6px; }
.nva-cal-nav-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  border: none; cursor: pointer;
  color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.nva-cal-nav-btn:hover { background: rgba(255,255,255,0.38); transform: scale(1.08); }

.nva-cal-today-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.18);
  border-radius: 20px; padding: 4px 10px;
  font-size: 12px; color: rgba(255,255,255,0.9);
  margin-top: 10px; font-weight: 500;
}
.nva-cal-today-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%; background: #ffa704;
  display: inline-block;
}

/* =========================================================
   4. CALENDAR GRID
   ========================================================= */
.nva-cal-body {
  flex: 1; overflow-y: auto;
  padding: 18px 20px 16px;
  scrollbar-width: thin;
  scrollbar-color: #0098FF22 transparent;
}
.nva-cal-body::-webkit-scrollbar { width: 4px; }
.nva-cal-body::-webkit-scrollbar-thumb { background: #0098FF44; border-radius: 2px; }

.nva-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}
.nva-cal-weekday {
  text-align: center; font-size: 11px;
  font-weight: 600; color: #0098FF;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 6px 0;
}

.nva-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  animation: nva-fadeSlide 0.3s ease both;
}
@keyframes nva-fadeSlide {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.nva-cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  color: #03204B; cursor: pointer;
  position: relative;
  transition: background 0.18s, color 0.18s, transform 0.15s;
  user-select: none;
}
.nva-cal-day:hover { background: rgba(0,152,255,0.1); transform: scale(1.06); }
.nva-cal-day.empty { cursor: default; pointer-events: none; }

.nva-cal-day.today {
  background: linear-gradient(135deg, #0098FF, #0049D0);
  color: #fff !important; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,152,255,0.4);
}
.nva-cal-day.today:hover { transform: scale(1.1); }

/* Red circle for holidays */
.nva-cal-day.has-event::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 10px;
  border: 2px solid #F05454;
  background: rgba(240,84,84,0.08);
  pointer-events: none;
}
.nva-cal-day.has-event { color: #c0392b; font-weight: 700; }
.nva-cal-day.today.has-event::after { border-color: #ffa704; background: rgba(255,167,4,0.15); }
.nva-cal-day.sunday { color: #e74c3c; }
.nva-cal-day.sunday.today { color: #fff !important; }

/* =========================================================
   5. EVENTS LIST
   ========================================================= */
.nva-cal-events-section {
  border-top: 1px solid rgba(0,0,0,0.07);
  padding: 14px 20px 20px;
  flex-shrink: 0;
}
.nva-cal-events-title {
  font-size: 11px; font-weight: 700;
  color: #8fa0b8; text-transform: uppercase;
  letter-spacing: 1.2px; margin-bottom: 10px;
}
.nva-cal-event-list {
  display: flex; flex-direction: column; gap: 7px;
  max-height: 150px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #0098FF22 transparent;
}
.nva-cal-event-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: #f5f8ff; border-radius: 10px;
  border-left: 3px solid #F05454;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}
.nva-cal-event-item:hover { background: #edf2ff; transform: translateX(3px); }
.nva-cal-event-date-badge {
  background: #F05454; color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 6px; padding: 3px 7px;
  white-space: nowrap; flex-shrink: 0;
}
.nva-cal-event-name {
  font-size: 12px; font-weight: 600; color: #03204B;
  flex: 1; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* =========================================================
   6. DETAIL POPUP
   ========================================================= */
.nva-cal-detail-popup {
  position: fixed;
  z-index: 1000002;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,40,120,0.22), 0 2px 10px rgba(0,0,0,0.1);
  min-width: 240px; max-width: 280px;
  opacity: 0; visibility: hidden;
  transform: scale(0.88) translateY(8px);
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
  font-family: 'DM Sans', sans-serif;
  pointer-events: none;
}
.nva-cal-detail-popup.nva-active {
  opacity: 1; visibility: visible;
  transform: scale(1) translateY(0);
  pointer-events: all;
}
.nva-cal-detail-close {
  position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #f0f4ff; border: none; cursor: pointer;
  font-size: 12px; display: flex;
  align-items: center; justify-content: center;
  color: #666; transition: background 0.2s;
}
.nva-cal-detail-close:hover { background: #e0e8ff; }
.nva-cal-detail-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #FF6B6B, #F05454);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.nva-cal-detail-date { font-size: 11px; font-weight: 600; color: #0098FF; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.nva-cal-detail-name { font-size: 16px; font-weight: 700; color: #03204B; margin-bottom: 6px; padding-right: 20px; }
.nva-cal-detail-desc { font-size: 12px; color: #607080; line-height: 1.6; }
.nva-cal-detail-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #FFF0F0; color: #F05454;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  margin-top: 10px; text-transform: uppercase; letter-spacing: 0.8px;
}

/* =========================================================
   7. RESPONSIVE
   ========================================================= */
@media (max-width: 480px) {
  .nva-cal-panel {
    width: 100vw; border-radius: 20px 20px 0 0;
    top: auto; bottom: 0; height: 92vh;
    transform: translateY(100%);
  }
  .nva-cal-panel.nva-active { transform: translateY(0); }
  .nva-cal-detail-popup {
    left: 50% !important; right: auto !important;
    top: auto !important; bottom: 110px !important;
    transform: translateX(-50%) scale(0.88);
  }
  .nva-cal-detail-popup.nva-active { transform: translateX(-50%) scale(1); }
}
