/* Container that holds everything */
.custom-calendar-container {
    position: relative; /* so we can place it in the upper-left */
    top: 60px;
    left: 20px;
    width: 320px;  /* narrower width */
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    color: #fff;
    padding: 0.5rem;     /* less padding if you want a smaller look */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 50;         /* ensure it's above the 3D canvas */
    /* Remove margin: auto so it doesn't center itself */
    margin: 0;
  }
  
  /* Header with month-year and arrows */
  .calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
  }
  
  .calendar-prev,
  .calendar-next {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
  }
  .calendar-prev:hover,
  .calendar-next:hover {
    color: #ccc;
  }
  
  .calendar-month-label {
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
  }
  
  /* Row for the day-of-week labels */
  .calendar-weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-bottom: 0.5rem;
  }
  .calendar-weekday-name {
    padding: 0.5rem 0;
    font-weight: bold;
  }
  
  /* Days grid (5-6 rows of days) */
  .calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 10px;
    column-gap: 5px;
    text-align: center;
  }
  
  /* Each day cell */
  .calendar-day {
    background: rgba(255,255,255,0.1);
    padding: 0.8rem 0;
    border-radius: 4px;
    transition: background 0.2s ease;
    cursor: pointer;
  }
  .calendar-day:hover {
    background: rgba(255,255,255,0.2);
  }
  
  /* Today highlight */
  .calendar-day-today {
    background: #ffdd44; /* or your highlight color */
    color: #000;
    font-weight: bold;
  }
  
  /* Empty cells that come before the 1st day of the month */
  .calendar-day-empty {
    background: transparent;
    cursor: default;
  }

  
  .event-popup h3 {
    margin-top: 0;
  }
  
  .event-popup ul {
    list-style: none;
    padding-left: 0;
  }
  
  .event-popup-close {
    float: right;
    cursor: pointer;
    font-size: 1.2rem;
    margin-top: -10px;
  }

  #event-popup ul {
    list-style: none;
    padding-left: 0;
  }
  
  .event-card {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.8rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
  }
  
  .event-card:hover {
    transform: scale(1.02);
  }
  
  .event-time {
    font-weight: bold;
    font-size: 1rem;
    width: 60px;
    text-align: center;
    color: #ffd;
  }
  
  .event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .event-title {
    font-weight: bold;
    font-size: 1rem;
    color: white;
  }
  
  .event-location {
    font-size: 0.9rem;
    color: #ccc;
  }

  .calendar-container-wrapper {
    display: flex;
    flex-direction: row;
    gap: 50px;
    margin-top: 30px;
    position: relative; /* NOT absolute */
    z-index: 10;
  }
  
  

.event-popup {
  position: relative; 
  transform: none !important;
  top: 0;
  margin-top: 56px; 
  left: 0;
  width: 380px;
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 1rem;
  border-radius: 8px;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

/* OUTER BACKGROUND — dark base behind */
.event-details-popup {
  position: relative;
  width: 400px;
  background: rgba(0,0,0,0.85);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  display: none;
  margin-top: 60px;
  transition: all 0.3s ease; /* smooth transition */
}

/* INNER PANEL */
.event-detail-inner {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  color: #f0f0f0;
  font-family: 'Segoe UI', sans-serif;
}

/* HEADER WITH TITLE + CLOSE */
.event-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.event-detail-header h2 {
  font-size: 1.3rem;
  margin: 0;
  font-weight: bold;
}

.event-detail-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 1.4rem;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s ease;
  z-index: 10;
}

.event-detail-close:hover {
  color: #fff;
}

/* TEXT BODY */
.event-detail-body {
  font-size: 1rem;
  line-height: 1.6;
}

.event-detail-label {
  font-weight: 600;
  color: #ffffff;
}

/* Switcher container */
.eventi-switcher {
  display: flex;
  gap: 10px;
  margin: 40px 20px 20px;
  z-index: 100;
}

/* Switcher buttons */
.switcher-btn {
  background-color: rgba(0, 0, 0, 0.6);
  border: 2px solid transparent;
  color: white;
  font-weight: bold;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.switcher-btn:hover {
  background-color: rgba(0, 0, 0, 0.75);
}

.switcher-btn.active {
  border: 2px solid #ffdd44;
  background-color: rgba(0, 0, 0, 0.85);
  color: #ffdd44;
}

.calendar-and-popup {
  display: flex;
  flex-direction: row;
  align-items: flex-start;   /* ← ensures each child sizes independently */
  gap: 30px;
  position: relative;
  z-index: 100;
  padding: 20px;
}

.custom-calendar-container,
.event-popup,
.event-details-popup {
  align-self: flex-start; 
}

.upcoming-events-box {
  position: absolute;
  top: 190px;
  left: 20px;
  width: 320px;
  background: rgba(0,0,0,0.85); 
  color: white;
  padding: 1rem 1.2rem;
  border-radius: 12px; /* less rounded */
  box-shadow: 0 8px 20px rgba(0,0,0,0.6); 
  font-family: 'Segoe UI', sans-serif;
  z-index: 10;
}

.upcoming-events-box h3 {
  margin-top: 0;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.event-card-mini {
  background: rgba(255, 255, 255, 0.05); 
  padding: 0.9rem 0.8rem;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
  cursor: pointer;
}

.event-card-mini:hover {
  transform: scale(1.02);
}

.event-card-mini .event-title {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.event-card-mini .event-meta {
  font-size: 0.85rem;
  color: #ccc;
  display: flex;
  gap: 1rem;
}

.event-switcher-modern {
  display: flex;
  gap: 10px;
  background: linear-gradient(to right, #12064d, #0a071f);
  padding: 10px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  width: fit-content;
  margin: 40px 20px 10px;
}

.switcher-modern-btn {
  background: transparent;
  border: none;
  color: #ccc;
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease-in-out;
}

.switcher-modern-btn i {
  font-size: 1.2rem;
}

.switcher-modern-btn.active {
  background-color: #5f1fff; /* neon purple */
  color: white;
  font-weight: bold;
}

.calendar-day {
  position: relative;
}

.event-count-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background-color: #5f1fff;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 12px;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

#event-popup-carousel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carousel-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  gap: 6px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  background-color: #666;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-dot.active {
  background-color: white;
}

/* The parent flex container */
.upcoming-wrapper {
  display: flex;
  flex-direction: row; 
  align-items: flex-start;
  gap: 1.5rem;  /* space between the two panels */
  margin-top: 30px; /* optional top margin */
}

/* Make the details block come FIRST (left) */
#event-details-upcoming {
  width: 380px;   /* or match your other popups */
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  display: none;  /* Show it with JS after a click */
  margin-left: 380px; /* Move the block further to the right */
  margin-top: 60px; /* Move the block slightly down */
}

#event-details-upcoming .event-detail-inner {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 2rem 1.5rem;
  color: #f0f0f0;
  font-family: 'Segoe UI', sans-serif;
}

/* The event list on the RIGHT */
#upcoming-events-box {
  width: 300px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

/* ───── calendar clean‑up overrides ────────────────────────── */

/* make the little dark box transparent and lose its shadow   */
.custom-calendar-container{
  background:transparent!important;
  box-shadow:none!important;
}

/* header & nav arrows use brand colour                        */
.calendar-header,
.calendar-prev,
.calendar-next,
.calendar-month-label,
.calendar-weekday-name,
.calendar-day{
  color:#143CF0!important;
}

/* remove grey fill that was inside every day cell             */
.calendar-day,
.calendar-day-empty{
  background:transparent!important;
}

/* keep today highlight subtle (optional)                      */
.calendar-day-today{
  background:#143CF015!important;   /* 1.5 % tint */
}

/* ─── CENTER CALENDAR + TEXT IN THE WHITE CARD ───────────────── */
#calendar-section {
  /* make the white card a flex-box */
  display: flex;
  flex-direction: column;    /* stack calendar above the list */
  align-items: center;       /* center them horizontally */
  justify-content: center;   /* center them vertically (if you give this card a fixed height) */
}

/* your inner wrapper already holds the grid + the list: center its children */
.calendar-container-wrapper {
  display: flex;             /* you may already have this */
  flex-direction: column;    /* ensure stacked */
  align-items: center;       /* center calendar + list container */
  gap: 22px;                 /* space between calendar and events */
}

/* center the events “cards” and heading inside their box */
#calendar-events-list {
  display: flex;
  flex-direction: column;
  align-items: center;       /* center the <h4> and each .event-block */
  text-align: center;        /* center any inline text, like "Eventi per…" */
  width: 100%;
  max-width: 320px;          /* match your calendar width if you like */
}

/* --- override previous offsets so the grid can truly center --- */
.custom-calendar-container {
  top: auto !important;          /* cancel the 60 px push‑down      */
  left: 0 !important;            /* cancel the 20 px side offset    */
  margin-inline: auto;           /* let it auto‑center horizontally */
}
