/* ===== Bee Data Fetcher Plugin Styles ===== */

/* ===== Responsive form ===== */
@media (max-width: 480px) {
  #bdf-form div {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1rem; /* spacing between form rows */
  }

  #bdf-form label {
    width: auto;
    margin-bottom: 4px;
  }

  #bdf-form input,
  #bdf-form select {
    width: 100%;
    padding: 0.5rem; /* padding to prevent touching edges */
    box-sizing: border-box;
  }
}

#bdf-form button[type="submit"] {
  margin-top: 1rem; /* spacing above submit button */
}

.bdf-form-wrapper {
  padding: 1.5rem;
  box-sizing: border-box;
  background-color: #f9f9f9;
  border-radius: 8px;
}

/* ===== Submit button styling ===== */
#bdf-form button {
  padding: 6px 12px;
  border: none;
  background-color: #ffe078;
  color: #000;
  border-radius: 4px;
  cursor: pointer;
}

#bdf-form button:hover {
  background-color: #daa92d;
}

/* ===== Result container spacing ===== */
#bdf-result {
  font-family: Arial, sans-serif;
}

/* ===== Timeline container and arrows ===== */
.bdf-timeline-container-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.bdf-timeline-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 10rem;
  padding: 1rem 5rem;
}

.bdf-timeline-container::-webkit-scrollbar {
  display: none;
}

.bdf-timeline-card {
  flex: 0 0 100%;
  max-width: 500px;
  min-height: 500px;
  scroll-snap-align: center;
  margin: 0 auto;
  box-sizing: border-box;
}

.bdf-timeline-card svg {
  width: 100%;
  height: 100%;
}

/* ===== Minimalist navigation buttons ===== */
.bdf-timeline-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  transition: color 0.2s, transform 0.1s;
}

.bdf-timeline-btn:hover {
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

#bdf-timeline-prev { left: 10px; }
#bdf-timeline-next { right: 10px; }

.bdf-timeline-icon {
  width: 28px;
  height: 28px;
}

/* ===== Popup styling ===== */
.bdf-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex; 
  align-items: center; 
  justify-content: center;
  z-index: 1000;
}

.bdf-popup.hidden { display: none; }

.bdf-popup-content {
  background: #fff;
  padding: 1em;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  width: 300px;
}

/* ===== Card styling ===== */
.bdf-card-wrapper {
  position: relative;
  padding: 1rem;
}

.bdf-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bdf-card-date {
  position: absolute;
  top: 10%;
  left: 7%;
  color: black;
  font-size: 34px;
  font-weight: bold;
}

.bdf-card-event {
  position: absolute;
  top: 40%;
  left: 7%;
  width: 85%;
  max-height: 50%;
  overflow-y: auto;
  color: black;
  font-size: 25px;
  line-height: 1.3;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  border-radius: 8px;
  padding: 0.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.bdf-scroll-text {
  flex: 1;
}

.bdf-expand-btn {
  position: absolute;
  top: 12%; /* above scroll area */
  right: 7%;
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  padding: 0;
}

.bdf-expand-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ===== Mobile-specific adjustments ===== */
@media (max-width: 600px) {
  .bdf-timeline-container {
    gap: 1rem;
    padding: 0 1rem;
  }

  .bdf-timeline-card {
    flex: 0 0 80%;
    max-width: none;
    min-height: 300px;
    margin-right: 0;
  }

  #bdf-timeline-prev,
  #bdf-timeline-next {
    display: none !important;
  }

  #bdf-date {
    font-size: 1.2rem;
    padding: 0.6rem;
    width: 100%;
    box-sizing: border-box;
  }

  .bdf-card-date {
    font-size: 22px;
    left: 7%;
  }

  .bdf-card-event {
    font-size: 18px;
    top: 30%;
    max-height: 50%;
    padding: 0.4rem;
    cursor: pointer; /* mobile expand button intent */
  }

  .bdf-expand-btn {
    top: calc(30% - 4rem);
    right: 7%;
  }
}
