/* ==========================================================
   NSSC ACCORDION CALENDAR - COMPONENT STYLES
   ========================================================== */

/* --- Navigation Header --- */
.calendar-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

/* --- The Grid --- */
.custom-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 4px !important;
  width: 100%;
}

/* --- Solid Header Bar (#494959) --- */
.calendar-header-wrapper {
  grid-column: 1 / span 7;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: #494959;
  margin-bottom: 4px;
}

.day-header {
  color: #fff;
  text-align: center;
  padding: 12px 2px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.day-header .short-name { display: none; }

/* --- Day Cell --- */
.calendar-day-cell {
  background-color: rgba(225, 229, 234, 0.41);
  aspect-ratio: 1 / 1;
  padding: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  overflow: hidden; /* Clips the ripple effect */
}

.calendar-day-cell.empty {
  background-color: rgba(225, 229, 234, 0.1);
}

.calendar-day-cell.has-events { 
  cursor: pointer; 
}

.calendar-day-cell.has-events:hover {
  background-color: rgba(225, 229, 234, 0.7);
  z-index: 2;
}

.calendar-day-cell.is-active {
  background-color: rgba(149, 62, 181, 0.1);
  box-shadow: inset 0 0 0 3px #953EB5;
}

/* --- Date Number --- */
.day-number {
  position: absolute;
  top: 10px;
  right: 12px;
  font-weight: 700;
  color: #495057;
  font-size: 1.1rem;
}

/* --- Purple Bubble (Design Shadows Added) --- */
.event-bubble {
  background-color: #953EB5 !important;
  color: white !important;
  width: 33%;
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(0.7rem, 1.5vw, 1.2rem); 
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.calendar-day-cell.has-events:hover .event-bubble {
  transform: scale(1.2);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
}

.event-bubble::before { content: ""; display: block; padding-top: 100%; }
.event-bubble span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* --- Ripple Effect --- */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(149, 62, 181, 0.4);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to { transform: scale(4); opacity: 0; }
}

/* --- Expansion Tray --- */
.expansion-tray {
  grid-column: 1 / span 7 !important;
  background: #ffffff; 
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.expansion-tray.is-open {
  max-height: 2000px;
  opacity: 1;
  border-top: 4px solid #953EB5;
  border-bottom: 4px solid #953EB5;
}

.tray-content-target {
  padding: 30px 10px;
}

/* --- Event Card Styles --- */
.tray-event-item {
  display: flex;
  align-items: flex-start;
  gap: 15px; 
  margin-bottom: 25px; 
  opacity: 0;
}

.event-image-container {
  flex: 0 0 220px;
  aspect-ratio: 1 / 1;
  overflow: hidden; /* Essential for clipping the zoom effect */
  border-top-left-radius: 25px;
  border-bottom-left-radius: 25px;
  background-color: #f0f0f0;
}

.event-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease; /* Smoothness of the zoom */
}

/* Zoom Hover Effect */
.tray-event-item:hover .event-image {
  transform: scale(1.1);
}

.event-content-card {
  flex: 1;
  display: flex;
  justify-content: space-between;
  padding: 30px;
  background-color: rgba(225, 229, 234, 0.41) !important;
  border-top-right-radius: 25px;
  border-bottom-right-radius: 25px;
  min-height: 220px;
}

.event-info { flex: 1; padding-right: 20px; }
.event-actions {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

/* --- Pill Buttons --- */
.btn-pill {
  border-radius: 50px !important;
  padding: 10px 15px !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  background: transparent !important;
  border: 2px solid #1a73e8 !important;
  color: #1a73e8 !important;
}

.btn-pill:hover {
  background: #1a73e8 !important;
  color: #fff !important;
  transform: scale(1.05);
}

/* Close Button Style */
.close-tray-wrapper {
  display: flex;
  justify-content: flex-end;
  padding: 10px 10px 30px 10px;
}

.close-tray-btn {
  background-color: #6c757d !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 10px 24px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-tray-btn:hover {
  background-color: #495057 !important;
  transform: translateY(-2px);
}

/* --- Animations --- */
@keyframes trayContentFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.expansion-tray.is-open .animated-entry {
  animation: trayContentFadeIn 0.5s ease-out forwards;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .event-image-container {
    display: none; /* Hide images on mobile to save space */
  }
  .event-content-card {
    border-radius: 15px !important;
    flex-direction: column;
    padding: 20px;
  }
  .event-actions {
    flex: 1;
    margin-top: 15px;
    width: 100%;
  }
}