/*************************************************** MEMORIES ***************************************************/

/* --- Global Styles --- */ 
#TKULogo {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px; /* adjust if using emoji */
  transition: transform 0.2s;
}

#TKULogo:hover {
  transform: scale(1.1);
}

/* --- Events Panels (Left & Right) --- */
#leftEventsPanel, #rightEventsPanel {
  position: absolute;
  left: 20px;
  top: 80px;
  width: 260px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  display: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  z-index: 10;
}

#leftEventsPanel {
  pointer-events: auto;
}

canvas {
pointer-events: auto;
}

#leftEventsPanel { left: 20px; }
#rightEventsPanel { right: 20px; }

.event-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.date-box{
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(155, 93, 229, 0.25);
  border: 1px solid rgba(155, 93, 229, 0.6);
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.event-title{
  font-size: 14px;
  color: #fff;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.event-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

/* --- Event Modal --- */
#eventModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, -50%);
  width: min(500px, 90vw);
  padding: 24px;
  border-radius: 16px;
  color: #fff;
  background: rgba(20, 20, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(155, 93, 229, 0.4);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(155, 93, 229, 0.25);
  z-index: 2000;
  font-family: Orbitron, sans-serif;
}

#eventModal h2 {
  font-size: 22px;
  margin-bottom: 10px;
  color: #a855f7;
}

.memory-image{
  width:100%;
  max-height:300px;
  object-fit: contain;
  border-radius:12px;
  margin-bottom:15px;
}

#eventModal p {
  font-size: 14px;
  color: #00ff9d;
  line-height: 1.5;
  margin-bottom: 20px;
}

.memory-navigation {
  display:flex;
  justify-content:center;
  gap:15px;
  margin:15px 0;
}

.memory-navigation button {
  background:rgba(168,85,247,0.7);
  color:white;
  border:none;
  padding:8px 14px;
  border-radius:10px;
  font-family:Orbitron,sans-serif;
  cursor:pointer;
}

.memory-navigation button:hover:not(:disabled){
  transform:scale(1.05);
}

.memory-navigation button:disabled {
  opacity:0.35;
  cursor:not-allowed;
}

#closeModal {
  display: block;
  margin: 16px auto 0 auto;
  background: rgba(155, 93, 229, 0.8);
  font-family: Orbitron, sans-serif;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

#closeModal:hover {
  background: rgba(155, 93, 229, 1);
  transform: scale(1.05);
}

@media screen and (min-width: 769px) and (max-width: 1370px) {

  /* Panels medium width */
  #leftEventsPanel, #rightEventsPanel {
    width: 270px;
  }

  #leftEventsPanel { left: 15px; }
  #rightEventsPanel { right: 15px; }

  /* Slightly compact rows */
  .event-row {
    gap: 9px;
  }

  .date-box {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .event-title {
    font-size: 13.5px;
  }

  /* Modal */
  #eventModal {
    width: 420px;
    padding: 20px;
  }

  #eventModal h2 {
    font-size: 20px;
  }

  #eventModal p {
    font-size: 13.5px;
  }
}

@media (max-width: 768px) {

  #leftEventsPanel,
  #rightEventsPanel {
      width: min(85vw, 300px);
      top: 70px;
  }
  
  .event-row {
      align-items: flex-start;
  }

  .event-title {
      white-space: normal !important;
      overflow: visible !important;
      text-overflow: unset !important;
      word-break: break-word;
  }

  .date-box {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  #eventModal {
      width: min(92vw, 600px) !important; 
      max-width: 600px;
      overflow-y: auto;
      word-wrap: break-word;
  }
  
  #eventModal h2 {
    font-size: 16px;
  }
  
  .memory-image{
      width:100%;
      max-height:40vh;
      object-fit:contain;
      border-radius:12px;
      margin-bottom:15px;
  }

  #eventModal p {
    font-size: 12px;
  }

  #closeModal {
    font-size: 12px;
    padding: 8px 12px;
  }

  #TKULogo {
    width: 36px;
    height: 36px;
  }
}

