/* Custom Style Reset and Layout overrides for GroupMe App Simulator */
#groupme-app {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: #0d0e10;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  color: #f2f2f2;
  box-sizing: border-box;
}

#groupme-app * {
  box-sizing: border-box;
}

/* --- Responsive Background Images --- */
@media (min-width: 768px) {
  #groupme-app {
    background-image: url('/img/julie-engagement-party/groupme_desktop.png');
  }
  .desktop-only {
    display: block;
  }
  .mobile-only {
    display: none;
  }
}

@media (max-width: 767px) {
  #groupme-app {
    background-image: url('/img/julie-engagement-party/groupme_mobile.png');
    background-position: center bottom;
  }
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
}

/* --- Backdrop Overlay for Modal --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.modal-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

/* --- The Event Creator Modal --- */
.event-modal {
  position: relative;
  z-index: 20;
  width: 460px;
  max-width: 90vw;
  background-color: #252628;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.15);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.event-modal.hide {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

/* Modal Header */
.modal-header {
  margin-bottom: 16px;
  padding-bottom: 4px;
}
.modal-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.2px;
}

/* Inputs & Containers Styling */
.field-container {
  background-color: #1a1b1d;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.modal-input {
  background: transparent;
  border: none;
  outline: none;
  color: #e3e3e3;
  font-size: 14px;
  width: 100%;
  padding: 0;
  font-family: inherit;
}

.text-white {
  color: #ffffff;
}

.font-bold {
  font-weight: 700;
}

/* Upper Section: Photo & Meta fields */
.details-section {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.event-photo-container {
  position: relative;
  width: 110px;
  height: 110px;
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.event-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  display: block;
}

/* Crop overlay mimicking GroupMe editor circles */
.crop-ring-overlay {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  pointer-events: none;
}

/* Pencil Button over image */
.edit-photo-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #1a1b1d;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}
.edit-photo-btn:hover {
  transform: scale(1.1);
}

/* Right hand metadata fields */
.event-meta-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.title-field {
  padding: 8px 12px;
}

.datetime-row {
  display: flex;
  align-items: center;
  height: 32px;
}

.field-label {
  width: 48px;
  font-size: 13px;
  color: #9da0a5;
}

.datetime-inputs {
  display: flex;
  gap: 8px;
  flex-grow: 1;
}

.datetime-inputs .modal-input {
  background-color: #1a1b1d;
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
}

.date-input {
  flex-grow: 1.3;
}

.time-input {
  flex-grow: 0.7;
}

/* All Day switch row */
.allday-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  padding-left: 2px;
}

.allday-label {
  font-size: 13px;
  color: #9da0a5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-icon-sun {
  color: #9da0a5;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1a1b1d;
  transition: .3s;
  border-radius: 20px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #5d6065;
  transition: .3s;
  border-radius: 50%;
}

/* --- Middle Section: Location and Video Call --- */
.location-section {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.location-field {
  flex-grow: 1;
  padding: 8px 10px;
}

.location-link {
  flex-grow: 1;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.location-input {
  cursor: pointer;
  color: #00aff0; /* Highlighted location link blue */
}
.location-input:hover {
  text-decoration: underline;
}

.location-marker-icon {
  color: #9da0a5;
  margin-right: 8px;
  font-size: 13px;
}

.clear-icon {
  color: #5d6065;
  cursor: pointer;
  font-size: 12px;
  margin-left: 6px;
}
.clear-icon:hover {
  color: #9da0a5;
}

.video-call-btn {
  background-color: #1a1b1d;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9da0a5;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.video-call-btn:hover {
  color: #ffffff;
  background-color: #2c2d30;
}

.video-icon {
  font-size: 13px;
}

/* --- Description Section (Scrollable) --- */
.description-section {
  background-color: #1a1b1d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.description-scroll-pane {
  max-height: 105px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Description Custom Scrollbar */
.description-scroll-pane::-webkit-scrollbar {
  width: 4px;
}

.description-scroll-pane::-webkit-scrollbar-track {
  background: transparent;
}

.description-scroll-pane::-webkit-scrollbar-thumb {
  background: #3e4044;
  border-radius: 4px;
}

.description-scroll-pane::-webkit-scrollbar-thumb:hover {
  background: #5d6065;
}

.desc-line {
  margin: 0 0 6px 0;
  font-size: 13px;
  line-height: 1.45;
  color: #cccccc;
}
.desc-line:last-child {
  margin-bottom: 0;
}

.phone-link {
  color: #00aff0;
  text-decoration: none;
}
.phone-link:hover {
  text-decoration: underline;
}

/* --- Lower Section: Reminder --- */
.reminder-section {
  background-color: #1a1b1d;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.bell-icon {
  color: #9da0a5;
  margin-right: 8px;
  font-size: 13px;
}

.reminder-input {
  color: #9da0a5;
}

.reminder-chevrons {
  display: flex;
  flex-direction: column;
  color: #5d6065;
  font-size: 10px;
  gap: 1px;
}

/* --- Modal Footer Controls --- */
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.icon-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background-color: #38393c;
  color: #ffffff;
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s ease;
  outline: none;
}
.icon-circle-btn:hover {
  background-color: #4b4c50;
  transform: scale(1.05);
}
.icon-circle-btn:active {
  transform: scale(0.95);
}

.send-event-btn {
  background-color: #ffffff;
  color: #1a1b1d;
  border: none;
  outline: none;
  padding: 10px 22px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.08);
}
.send-event-btn:hover {
  background-color: #f0f0f0;
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.15);
}
.send-event-btn:active {
  transform: scale(0.97);
}

/* --- THE PANIC EASTER EGG OVERLAY --- */
.panic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.panic-overlay.show {
  opacity: 1;
}

.panic-card {
  background: #190a0d;
  border: 2px solid #ff4d4f;
  border-radius: 18px;
  width: 380px;
  max-width: 85vw;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(255, 77, 79, 0.25);
  color: #ffffff;
}

.panic-icon {
  font-size: 46px;
  color: #ff4d4f;
  margin-bottom: 16px;
  animation: glow-pulse 1.5s infinite alternate;
}

.panic-title {
  font-size: 22px;
  font-weight: 800;
  color: #ff4d4f;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
}

.panic-message {
  font-size: 17px;
  margin: 0 0 24px 0;
  color: #e3e3e3;
  line-height: 1.4;
  font-weight: 500;
}

.panic-close-btn {
  background-color: #ff4d4f;
  color: #ffffff;
  border: none;
  outline: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  box-shadow: 0 4px 10px rgba(255, 77, 79, 0.3);
}
.panic-close-btn:hover {
  background-color: #ff7875;
  transform: scale(1.04);
  box-shadow: 0 6px 14px rgba(255, 77, 79, 0.4);
}
.panic-close-btn:active {
  transform: scale(0.96);
}

/* Animations */
@keyframes glow-pulse {
  from {
    filter: drop-shadow(0 0 2px rgba(255, 77, 79, 0.4));
  }
  to {
    filter: drop-shadow(0 0 12px rgba(255, 77, 79, 0.9));
  }
}

.shake-anim {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* --- Floating Action Button (FAB) --- */
.reopen-invitation-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  background-color: #00aff0; /* GroupMe blue */
  color: #ffffff;
  border: none;
  outline: none;
  padding: 14px 22px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 5px 18px rgba(0, 175, 240, 0.4);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s;
}
.reopen-invitation-fab:hover {
  background-color: #009de0;
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(0, 175, 240, 0.55);
}
.reopen-invitation-fab:active {
  transform: translateY(1px);
}
.reopen-invitation-fab.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- Simulated Plus Triggers overlaid on backgrounds --- */
.simulated-plus-trigger {
  position: absolute;
  border: none;
  outline: none;
  cursor: pointer;
  z-index: 5;
  background-color: rgba(255, 255, 255, 0.001); /* Invisible but clickable */
  border-radius: 50%;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.simulated-plus-trigger:hover {
  background-color: rgba(0, 175, 240, 0.08);
  box-shadow: 0 0 10px rgba(0, 175, 240, 0.3);
}

/* Desktop coordinate placement */
@media (min-width: 768px) {
  .simulated-plus-trigger.desktop-only {
    bottom: 24px;
    left: 8.4%;
    width: 42px;
    height: 42px;
  }
}

/* Mobile coordinate placement */
@media (max-width: 767px) {
  .simulated-plus-trigger.mobile-only {
    bottom: 25px;
    left: 4.5vw;
    width: 44px;
    height: 44px;
  }
}

/* --- Mobile-specific adjustments for modal --- */
@media (max-width: 767px) {
  .event-modal {
    padding: 16px;
    border-radius: 16px;
  }
  .details-section {
    gap: 12px;
    margin-bottom: 12px;
  }
  .event-photo-container {
    width: 90px;
    height: 90px;
    border-radius: 10px;
  }
  .field-label {
    width: 42px;
    font-size: 12px;
  }
  .datetime-inputs {
    gap: 6px;
  }
  .datetime-inputs .modal-input {
    padding: 5px 8px;
    font-size: 13px;
  }
  .location-section {
    margin-bottom: 12px;
  }
  .description-section {
    margin-bottom: 12px;
  }
  .description-scroll-pane {
    max-height: 95px;
  }
  .reopen-invitation-fab {
    bottom: 16px;
    right: 16px;
    padding: 12px 18px;
    font-size: 13px;
  }
}
