html {
  scroll-behavior: smooth;
}
body {
  background: linear-gradient(to bottom, #0f1115, #1a1c22);
  font-family: 'Segoe UI', sans-serif;
  color: #e0e0e0;
  padding-bottom: 50px;
}

/* Tiêu đề */
h2.text-center {
  color: #90caf9;
}

/* Timeline Container */
.timeline-container {
  max-width: 800px;
  margin: auto;
  padding: 40px 20px;
}

/* Timeline Item */
.timeline-item {
  background: #1e2129;
  border-left: 5px solid #3949ab;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s, opacity 0.6s ease, transform 0.6s ease;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
}
.timeline-item.revealed {
  opacity: 1;
  transform: translateY(0);
}
.timeline-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(63, 81, 181, 0.3);
}
.timeline-item h5 {
  font-weight: bold;
  color: #bbdefb;
}
.timeline-item .date {
  font-size: 0.9em;
  color: #999;
  margin-bottom: 10px;
}
.timeline-item .date::before {
  content: "🕒 ";
  color: #64b5f6;
}

/* Media Layout */
.timeline-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.media-wrapper {
  flex: 1 1 calc(50% - 10px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  max-width: 100%;
  border-radius: 6px;
}

/* Loading hiệu ứng */
.media-wrapper.loading img,
.media-wrapper.loading video {
  opacity: 0.3;
  filter: grayscale(100%) blur(5px);
}

/* Sau khi load hoàn tất */
.media-wrapper img,
.media-wrapper video {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  border: 2px solid transparent;
  opacity: 0;
  transition: opacity 0.4s ease-in-out, border-color 0.2s ease, box-shadow 0.2s ease;
}
.media-wrapper.loaded img,
.media-wrapper.loaded video {
  opacity: 1;
}

/* Hover effect cho media */
.media-wrapper img:hover,
.media-wrapper video:hover {
  border-color: #7c4dff;
  box-shadow: 0 0 12px #7c4dff, 0 0 24px #7c4dff;
}

/* Spinner khi loading */
.spinner {
  position: absolute;
  top: 45%;
  left: 45%;
  z-index: 5;
  width: 30px;
  height: 30px;
  border: 4px solid #888;
  border-top: 4px solid #3949ab;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive media layout */
@media (max-width: 600px) {
  .media-wrapper {
    flex: 1 1 calc(50% - 10px);
  }
}
@media (max-width: 400px) {
  .media-wrapper {
    flex: 1 1 100%;
  }
}

/* Nút xóa */
.delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.9em;
}

/* Nút đăng nhập/logout */
#authButtons {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#authButtons div {
  width: 30px;
  height: 30px;
  background-color: #3949ab;
  color: #fff;
  font-size: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
#authButtons div:hover {
  transform: scale(1.1);
}
/* Nút mạng xã hội */
.social-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1060;
}

.social-main-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #0d6efd;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  transform: rotate(0deg);
}

.social-main-btn.open {
  background-color: #dc3545;
  transform: rotate(135deg); /* Xoay + thành x */
}

.social-main-btn:hover {
  transform: scale(1.1);
}

.social-links {
  position: fixed;
  bottom: 90px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 0.3s ease;
  z-index: 1060;
}

.social-links.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.social-main-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1060;
}

.social-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.social-item:hover {
  transform: scale(1.15);
}
.timeline-item.fade-out {
  opacity: 0 !important;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

#lightboxContent img,
#lightboxContent video {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

#lightboxClose {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 2001;
}

#lightboxOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease;
  z-index: 2000;
}

#lightboxOverlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  color: white;
  padding: 0 20px;
  cursor: pointer;
  z-index: 2001;
  user-select: none;
}
#lightboxPrev {
  left: 10px;
}
#lightboxNext {
  right: 10px;
}
.lightbox-nav:hover {
  color: #90caf9;
  transform: scale(1.15);
}
.feedback-box {
  position: fixed;
  bottom: 150px;
  right: 80px;
  width: 250px;
  background: #2c2f3a;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.5);
  display: none;
  z-index: 1061;
}
.feedback-box form input,
.feedback-box form textarea {
  background: #1f1f1f;
  color: white;
  border: 1px solid #555;
  font-size: 14px;
}
.feedback-box form button {
  font-size: 14px;
}
.timeline-item button {
  margin-top: 10px;
  margin-right: 5px;
}
