:root {
  --hot-pink: #ff1493;
  --bubblegum: #ff69b4;
  --pastel-pink: #ffb6c1;
  --gold: #ffd700;
  --white: #ffffff;
  --light-gold: #ffeb84;
  --dark-pink: #c71585;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Quicksand', sans-serif;
  background-image: url('pinkglitter.png');
  background-repeat: repeat;
  background-attachment: fixed;
  color: #333;
  min-height: 100vh;
}

.glow-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.4), transparent 25%),
              radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.4), transparent 25%);
  z-index: 1;
}

.container {
  max-width: 950px;
  margin: 0 auto;
  padding: 2rem;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 30px;
  box-shadow: 0 10px 40px rgba(255, 20, 147, 0.4);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border: 5px solid var(--pastel-pink);
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-family: 'Pacifico', cursive;
  font-size: 4rem;
  margin: 0;
  text-shadow: 3px 3px 0px var(--gold), 6px 6px 0px var(--hot-pink);
  transform: rotate(-2deg);
}

.rainbow-text {
  background: linear-gradient(to right, #ff2a2a, #ff7a2a, #e6c615, #2cc931, #2a88ff, #a632ff, #ff32b5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  animation: rainbow 5s infinite linear;
}

@keyframes rainbow {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

.subtitle {
  font-size: 1.5rem;
  color: var(--dark-pink);
  font-weight: 700;
  margin-top: 1rem;
}

/* Buttons */
.sparkle-btn {
  background: linear-gradient(45deg, var(--hot-pink), var(--bubblegum));
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: bold;
  font-family: 'Quicksand', sans-serif;
  color: var(--white);
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(255, 20, 147, 0.5);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sparkle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 20, 147, 0.7);
  background: linear-gradient(45deg, var(--bubblegum), var(--hot-pink));
}

.sparkle-btn.secondary {
  background: linear-gradient(45deg, #ff2a2a, #ff7a2a, #e6c615, #2cc931, #2a88ff, #a632ff, #ff32b5);
  background-size: 300% 300%;
  animation: rainbow 5s infinite linear;
  box-shadow: 0 5px 15px rgba(255, 42, 42, 0.5);
}

.sparkle-btn.secondary:hover {
  box-shadow: 0 8px 25px rgba(255, 42, 42, 0.7);
}

/* Dashboard Events List */
.events-container {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: rgba(255, 182, 193, 0.2);
  border-radius: 20px;
  border: 2px dashed var(--bubblegum);
}

#events-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 1rem;
}

.event-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 15px;
  border: 2px solid var(--pastel-pink);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: all 0.2s;
}

.event-card:hover {
  transform: scale(1.02);
  border-color: var(--hot-pink);
}

.event-info h4 {
  margin: 0 0 5px 0;
  color: var(--dark-pink);
  font-size: 1.3rem;
}

.event-info p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.event-actions {
  display: flex;
  gap: 10px;
}

.join-btn {
  background: var(--hot-pink);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
}
.delete-btn {
  background: #ff4757;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
}

/* Event Creator Area */
.create-event-box {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  border: 3px solid var(--bubblegum);
  box-shadow: 0 10px 30px rgba(255, 20, 147, 0.1);
  text-align: center;
}

.date-inputs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.date-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: bold;
  color: var(--dark-pink);
}

input[type="date"] {
  padding: 0.8rem 1.2rem;
  border-radius: 30px;
  border: 3px solid var(--pastel-pink);
  font-size: 1.1rem;
  font-family: 'Quicksand', sans-serif;
  color: var(--dark-pink);
  outline: none;
  transition: all 0.3s;
  background-color: #fff0f5;
  margin-top: 5px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input[type="text"] {
  padding: 0.8rem 1.2rem;
  border-radius: 30px;
  border: 3px solid var(--pastel-pink);
  font-size: 1.1rem;
  font-family: 'Quicksand', sans-serif;
  color: var(--dark-pink);
  outline: none;
  transition: all 0.3s;
  background-color: #fff0f5;
  margin-top: 5px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  display: block;
  margin: 1rem auto;
}

input:focus {
  border-color: var(--hot-pink);
  box-shadow: 0 0 15px var(--pastel-pink);
}

.create-btn {
  width: 100%;
  max-width: 300px;
}

/* Mode toggler */
.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 1rem 0 2rem 0;
}

.radio-label {
  cursor: pointer;
  position: relative;
}

.radio-label input {
  display: none;
}

.radio-label span {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 30px;
  border: 3px solid #ccc;
  background: #f8f8f8;
  font-weight: bold;
  transition: all 0.3s;
}

.available-mode input:checked + span {
  border-color: var(--hot-pink);
  background: #ffd1eb;
  color: var(--dark-pink);
  box-shadow: 0 0 10px var(--hot-pink);
}

.ifneeded-mode input:checked + span {
  border-color: #e5b300;
  background: #fff6cc;
  color: #8c6d00;
  box-shadow: 0 0 10px var(--gold);
}

/* Table */
.table-container {
  overflow-x: auto;
  border-radius: 20px;
  border: 4px solid var(--bubblegum);
  background: white;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  white-space: nowrap;
}

table {
  border-collapse: collapse;
  min-width: 100%;
}

th, td {
  border: 1px solid var(--pastel-pink);
  text-align: center;
  padding: 0;
  height: 40px;
  min-width: 80px; /* Keep cells from squishing */
}

th {
  background: var(--bubblegum);
  color: white;
  padding: 10px;
  font-size: 1.1rem;
}

.time-label {
  font-weight: bold;
  color: var(--dark-pink);
  font-size: 0.9rem;
  border-right: 3px solid var(--bubblegum);
  background: #fff0f5;
  position: sticky;
  left: 0;
  z-index: 2;
}

th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
}

/* Cell Status */
.cell {
  cursor: pointer;
  transition: all 0.2s;
  background-color: #f8f8f8; /* default */
}

/* Logged in interaction */
.interactive .cell:hover {
  filter: brightness(0.9);
}

/* Heatmap base logic */
.score-1 { background-color: #ffe6f2 !important; }
.score-2 { background-color: #ffb3d9 !important; }
.score-3 { background-color: #ff80bf !important; }
.score-max { background-color: var(--hot-pink) !important; color: white; font-weight: bold; }

/* My selections over heatmap */
.interactive .cell.my-available {
  background-image: linear-gradient(45deg, var(--hot-pink) 25%, var(--bubblegum) 25%, var(--bubblegum) 50%, var(--hot-pink) 50%, var(--hot-pink) 75%, var(--bubblegum) 75%, var(--bubblegum) 100%) !important;
  background-size: 20px 20px;
  color: white;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

.interactive .cell.my-ifneeded {
  background-image: linear-gradient(45deg, #ffe066 25%, #ffeb99 25%, #ffeb99 50%, #ffe066 50%, #ffe066 75%, #ffeb99 75%, #ffeb99 100%) !important;
  background-size: 20px 20px;
  color: #8c6d00;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

/* Header & Sections */
.hidden { display: none !important; }
.instruction { text-align: center; font-size: 1.2rem; color: var(--dark-pink); font-weight: bold; margin-bottom: 0.5rem; }
.event-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.event-title { flex-grow: 1; text-align: center; font-size: 3rem; margin: 0; }
.back-btn { padding: 0.5rem 1rem; font-size: 1rem; }

/* Legend */
.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  background: #fff0f5;
  padding: 15px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.legend-item { display: flex; align-items: center; gap: 8px; font-weight: bold; color: var(--dark-pink); }
.legend-box { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--pastel-pink); }
.legend-spacer { width: 2px; background: var(--pastel-pink); height: 20px; }

/* Legend colors matching CSS */
.cur-available { background-image: linear-gradient(45deg, var(--hot-pink) 25%, var(--bubblegum) 25%, var(--bubblegum) 50%, var(--hot-pink) 50%, var(--hot-pink) 75%, var(--bubblegum) 75%, var(--bubblegum) 100%); background-size: 10px 10px; }
.cur-ifneeded { background-image: linear-gradient(45deg, #ffe066 25%, #ffeb99 25%, #ffeb99 50%, #ffe066 50%, #ffe066 75%, #ffeb99 75%, #ffeb99 100%); background-size: 10px 10px; }
.heat-max { background-color: var(--hot-pink); }
.heat-mid { background-color: #ffb3d9; }

/* User Info */
#user-info { display: flex; align-items: center; justify-content: center; gap: 15px; background: #fff0f5; padding: 10px 20px; border-radius: 30px; border: 2px dashed var(--hot-pink); width: fit-content; margin: 0 auto; }
#user-name-display { font-weight: bold; font-size: 1.2rem; color: var(--hot-pink); }
#save-msg { color: var(--hot-pink); font-weight: bold; font-size: 1.2rem; margin-top: 10px; animation: popIn 0.3s ease; text-align: center; }

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.actions { text-align: center; margin-top: 1rem; }

#guests-list { margin-top: 30px; padding: 20px; background: rgba(255, 182, 193, 0.3); border-radius: 20px; border: 2px dashed var(--bubblegum); }
#guests-list h3 { color: var(--dark-pink); margin-top: 0; text-align: center; }
#guests-ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
#guests-ul li { background: var(--white); padding: 5px 15px; border-radius: 20px; font-weight: bold; color: var(--hot-pink); box-shadow: 0 2px 5px rgba(0,0,0,0.1); border: 1px solid var(--bubblegum); }
.main-photo {
  width: 100%;
  max-width: 300px;
  border-radius: 20px;
  border: 4px solid var(--bubblegum);
  display: block;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 5px 15px rgba(255, 20, 147, 0.4);
}

.sparkle-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.5rem;
  animation: fall 1s linear forwards;
}

@keyframes fall {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, 50px) scale(0); opacity: 0; }
}

/* Responsive Mobile Styles 📱💅 */
@media screen and (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
    margin: 1rem;
    border-width: 3px;
    border-radius: 20px;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  .subtitle {
    font-size: 1.1rem;
  }
  
  .main-photo {
    max-width: 180px;
    margin-bottom: 1rem;
  }
  
  .event-card {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .date-inputs {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .date-control {
    width: 100%;
  }

  .date-control input[type="date"] {
    width: 100%;
    box-sizing: border-box;
  }
  
  input[type="text"], 
  #display-name, 
  #new-event-name {
    width: 100%;
    box-sizing: border-box;
  }
  
  .event-header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .mode-toggle {
    flex-direction: column;
    gap: 10px;
  }

  .radio-label span {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .legend-spacer {
    display: none !important;
  }

  .table-container {
    margin: 1rem 0;
    border-radius: 10px;
    border-width: 2px;
  }

  th, td {
    min-width: 65px;
    height: 35px;
    font-size: 0.85rem;
  }

  .sparkle-btn {
    width: 100%;
    margin: 5px 0;
    font-size: 1rem;
    padding: 1rem;
  }

  #user-info {
    flex-direction: column;
    gap: 10px;
  }
}
