/* NDK Calendar Display Styles */

.ndk-calendar-wrapper {
  max-width: 100%;
  margin: 20px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.ndk-calendar-header {
  background: #2d7e3e;
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ndk-calendar-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.ndk-calendar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 300;
  min-width: 150px;
  text-align: center;
  color: #ffffff;
  background: transparent;
  border: none;
  text-shadow: none;
}

.ndk-calendar-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.ndk-calendar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ndk-calendar-view-selector {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px;
}

.ndk-calendar-view-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.ndk-calendar-view-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ndk-calendar-view-btn.active {
  background: white;
  color: #2d7e3e;
  font-weight: 600;
}

.ndk-calendar-container {
  padding: 15px;
  min-height: 400px;
  overflow-x: auto;
  position: relative;
  touch-action: pan-x pan-y;
}

/* Smooth scrolling for mobile swipe */
@media (max-width: 768px) {
  .ndk-calendar-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  
  .ndk-calendar-week-view,
  .ndk-calendar-day-view {
    scroll-snap-align: start;
  }
}

.ndk-calendar-loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

/* Loading Spinner */
.ndk-calendar-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2d7e3e;
  border-radius: 50%;
  animation: ndk-spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes ndk-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Snackbar for date display */
.ndk-calendar-snackbar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(45, 126, 62, 0.95);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.ndk-calendar-snackbar.show {
  opacity: 1;
}

/* Month View */
.ndk-calendar-month-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e0e0e0;
  border: 1px solid #e0e0e0;
  min-width: 600px;
}

.ndk-calendar-day-header {
  background: #f5f5f5;
  padding: 8px;
  text-align: center;
  font-weight: 400;
  font-size: 12px;
  color: #666;
}

.ndk-calendar-day-cell {
  background: white;
  min-height: 80px;
  padding: 6px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.ndk-calendar-day-cell:hover {
  background: #f8f8f8;
}

.ndk-calendar-day-cell.other-month {
  background: #fafafa;
  color: #999;
}

.ndk-calendar-day-cell.today {
  background: #e3f2fd;
  border: 2px solid #0078d4;
}

.ndk-calendar-day-number {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}

.ndk-calendar-day-cell.other-month .ndk-calendar-day-number {
  color: #999;
}

.ndk-calendar-event {
  background: #0078d4;
  color: white;
  padding: 2px 4px;
  margin: 2px 0;
  border-radius: 3px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s;
}

.ndk-calendar-event:hover {
  background: #005a9e;
}

.ndk-calendar-event.event-busy {
  background: #d83b01;
}

/* Calendar color variations - More distinct and saturated colors with opacity */
.ndk-calendar-event.calendar-0,
.ndk-calendar-timed-event.calendar-0 { 
  background: rgba(45, 126, 62, 0.92) !important; /* Green */
  border-left: 5px solid #1e5a2a !important;
} 

.ndk-calendar-event.calendar-1,
.ndk-calendar-timed-event.calendar-1 { 
  background: rgba(0, 120, 212, 0.92) !important; /* Blue */
  border-left: 5px solid #005a9e !important;
}

.ndk-calendar-event.calendar-2,
.ndk-calendar-timed-event.calendar-2 { 
  background: rgba(231, 72, 86, 0.92) !important; /* Red */
  border-left: 5px solid #c42b37 !important;
}

.ndk-calendar-event.calendar-3,
.ndk-calendar-timed-event.calendar-3 { 
  background: rgba(255, 140, 0, 0.92) !important; /* Orange */
  border-left: 5px solid #d97400 !important;
}

.ndk-calendar-event.calendar-4,
.ndk-calendar-timed-event.calendar-4 { 
  background: rgba(135, 100, 184, 0.92) !important; /* Purple */
  border-left: 5px solid #6b4c94 !important;
}

.ndk-calendar-event.calendar-5,
.ndk-calendar-timed-event.calendar-5 { 
  background: rgba(0, 164, 164, 0.92) !important; /* Teal */
  border-left: 5px solid #008080 !important;
}

.ndk-calendar-event.calendar-6,
.ndk-calendar-timed-event.calendar-6 { 
  background: rgba(216, 59, 1, 0.92) !important; /* Dark Orange */
  border-left: 5px solid #a82e01 !important;
}

.ndk-calendar-event-calendar-name {
  font-size: 10px;
  opacity: 0.8;
  display: block;
}

/* Week View (7-day full week) */
.ndk-calendar-week-view {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  background: #e0e0e0;
  border: 1px solid #e0e0e0;
  min-width: 700px;
  overflow-x: auto;
}

.ndk-calendar-week-header {
  background: #f5f5f5;
  padding: 8px 4px;
  text-align: center;
  font-weight: 400;
  font-size: 11px;
  color: #666;
  position: sticky;
  top: 0;
  z-index: 10;
  min-width: 80px;
  border-right: 2px solid #ddd;
}

.ndk-calendar-week-header.today {
  background: #e3f2fd;
  font-weight: 600;
  color: #0078d4;
}

.ndk-calendar-week-time-header {
  background: #f5f5f5;
}

.ndk-calendar-week-hour-slot {
  background: white;
  position: relative;
  min-height: 60px;
  border-right: 2px solid #ddd;
}

/* Day Views */
.ndk-calendar-day-view,
.ndk-calendar-day-view {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1px;
  background: #e0e0e0;
  border: 1px solid #e0e0e0;
}

.ndk-calendar-time-column {
  background: #f5f5f5;
}

.ndk-calendar-time-slot {
  padding: 5px;
  text-align: right;
  font-size: 12px;
  color: #666;
  height: 60px;
  border-bottom: 1px solid #e0e0e0;
}

.ndk-calendar-events-column {
  background: white;
  position: relative;
}

.ndk-calendar-hour-row {
  height: 60px;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
}

.ndk-calendar-timed-event {
  position: absolute;
  left: 5px;
  right: 5px;
  background: #0078d4;
  color: white;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 13px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  z-index: 1;
  opacity: 0.92;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ndk-calendar-timed-event:hover {
  opacity: 1;
  z-index: 2;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
}

.ndk-calendar-event-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.ndk-calendar-event-time {
  font-size: 11px;
  opacity: 0.9;
}

/* Event Modal */
.ndk-calendar-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.ndk-calendar-modal.active {
  display: flex;
}

.ndk-calendar-modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
}

.ndk-calendar-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.ndk-calendar-modal-close:hover {
  background: #f0f0f0;
}

.ndk-calendar-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #0078d4;
  padding-right: 30px;
}

.ndk-calendar-modal-detail {
  margin-bottom: 12px;
  color: #333;
}

.ndk-calendar-modal-label {
  font-weight: 600;
  margin-right: 8px;
  color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ndk-calendar-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .ndk-calendar-nav {
    justify-content: space-between;
  }
  
  .ndk-calendar-view-selector {
    justify-content: center;
  }
  
  .ndk-calendar-month-view {
    font-size: 12px;
  }
  
  .ndk-calendar-day-cell {
    min-height: 80px;
    padding: 5px;
  }
  
  .ndk-calendar-event {
    font-size: 10px;
    padding: 2px 4px;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ndk-calendar-container > * {
  animation: fadeIn 0.3s ease-out;
}

