@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
}

body {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0, #f3e5f5);
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

/* QUAN TRỌNG CHO MOBILE: KHÔNG DÙNG POSITION ABSOLUTE GÂY ĐÈ CHỒNG LÊN NHAU */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  flex-direction: column;
}

.screen.active {
  display: flex !important;
}

/* ==========================================
   1. MÀN HÌNH ĐĂNG NHẬP
   ========================================== */
#login-screen {
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, #f8bbd0, #ad1457);
  padding: 20px;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  padding: 35px 25px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 380px;
  width: 100%;
}

.login-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.login-card h2 {
  color: #c2185b;
  margin-bottom: 8px;
  font-size: 24px;
}

.login-card p {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #f8bbd0;
  background: #fff;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  text-align: center;
}

.login-card input:focus {
  border-color: #c2185b;
}

.login-card button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.error-msg {
  color: #d32f2f;
  font-size: 13px;
  margin-top: 12px;
  font-weight: bold;
}

/* ==========================================
   2. MÀN HÌNH HỘP QUÀ
   ========================================== */
#gift-screen {
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, #fce4ec, #ad1457);
  text-align: center;
  padding: 20px;
}

.gift-container {
  max-width: 400px;
  width: 100%;
}

.gift-container h1 {
  color: #fff;
  font-size: 26px;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.gift-container p {
  color: #fce4ec;
  font-size: 16px;
  margin-bottom: 30px;
}

.gift-box-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 25px auto;
  cursor: pointer;
  animation: giftFloat 3s ease-in-out infinite;
}

.gift-box {
  position: relative;
  width: 140px;
  height: 130px;
  margin: 25px auto 0 auto;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-lid {
  position: absolute;
  top: -18px;
  left: -10px;
  width: 160px;
  height: 40px;
  background: linear-gradient(135deg, #ff4081, #d81b60);
  border-radius: 8px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: bottom left;
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
}

.lid-bow {
  font-size: 26px;
  margin-top: -12px;
}

.gift-box-body {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 140px;
  height: 110px;
  background: linear-gradient(135deg, #e91e63, #ad1457);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  z-index: 3;
}

.ribbon-v {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 110px;
  background: linear-gradient(135deg, #ffe082, #ffb300);
  z-index: 4;
}

.sparkle-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.gift-box-wrapper.opening .gift-lid {
  transform: translateY(-100px) rotate(-35deg) scale(0.9);
  opacity: 0;
}

.gift-box-wrapper.opening .sparkle-particles {
  opacity: 1;
}

.gift-box-wrapper.opening .sparkle-particles span {
  position: absolute;
  font-size: 20px;
  animation: explode 0.8s ease-out forwards;
}

.gift-box-wrapper.opening .sparkle-particles span:nth-child(1) { top: 50%; left: 50%; --x: -70px; --y: -80px; }
.gift-box-wrapper.opening .sparkle-particles span:nth-child(2) { top: 50%; left: 50%; --x: 70px; --y: -90px; }
.gift-box-wrapper.opening .sparkle-particles span:nth-child(3) { top: 50%; left: 50%; --x: -80px; --y: 20px; }
.gift-box-wrapper.opening .sparkle-particles span:nth-child(4) { top: 50%; left: 50%; --x: 80px; --y: 20px; }
.gift-box-wrapper.opening .sparkle-particles span:nth-child(5) { top: 50%; left: 50%; --x: 0px; --y: -100px; }

.open-instruction {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  animation: pulseGlow 1.5s infinite;
}

/* ==========================================
   3. TRANG CHỦ
   ========================================== */
#home-screen {
  background: #fdf2f8;
}

.main-header {
  background: linear-gradient(135deg, #ad1457, #880e4f);
  color: white;
  text-align: center;
  padding: 30px 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.main-header h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.main-header p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.global-like-box button {
  background: #fff;
  color: #c2185b;
  border: none;
  padding: 10px 22px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  position: relative;
}

.content-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 25px 15px;
  width: 100%;
}

.video-section h2 {
  color: #880e4f;
  font-size: 20px;
  margin-bottom: 20px;
  border-left: 4px solid #e91e63;
  padding-left: 10px;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media(min-width: 600px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.video-thumb-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  cursor: pointer;
}

.thumb-preview-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.thumb-preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(233, 30, 99, 0.85);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 18px;
}

.thumb-info {
  padding: 15px;
}

.thumb-title {
  font-size: 15px;
  font-weight: bold;
  color: #333;
}

/* ==========================================
   4. TRANG XEM CHI TIẾT VIDEO
   ========================================== */
#watch-screen {
  background: #fdf2f8;
}

.watch-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 15px;
  width: 100%;
}

.back-btn {
  background: #fff;
  color: #c2185b;
  border: 2px solid #f8bbd0;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 15px;
  font-size: 13px;
}

.watch-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.watch-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.watch-info-section {
  background: #fff;
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media(min-width: 500px) {
  .watch-info-section {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.watch-info-section h1 {
  font-size: 17px;
  color: #880e4f;
}

.action-btn {
  background: #fce4ec;
  color: #c2185b;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  position: relative;
}

.watch-comment-section {
  background: #fff;
  padding: 20px 15px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.watch-comment-section h3 {
  color: #880e4f;
  font-size: 17px;
  margin-bottom: 15px;
  border-left: 3px solid #e91e63;
  padding-left: 8px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.comment-form input:focus, .comment-form textarea:focus {
  border-color: #e91e63;
}

.comment-form button {
  align-self: flex-end;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.comment-item {
  background: #fafafa;
  padding: 12px 15px;
  border-radius: 10px;
  border-left: 3px solid #e91e63;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comment-author {
  font-weight: bold;
  color: #880e4f;
  font-size: 14px;
}

.comment-date {
  font-size: 11px;
  color: #999;
}

.comment-body {
  color: #444;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.delete-comment-btn {
  background: none;
  border: none;
  color: #d32f2f;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  font-weight: 600;
}

.floating-heart {
  position: absolute;
  color: #e91e63;
  font-size: 20px;
  user-select: none;
  pointer-events: none;
  animation: floatUpHeart 0.8s ease-out forwards;
  z-index: 99;
}

footer {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 13px;
  background: #f3e5f5;
  margin-top: 30px;
}

/* Animations */
@keyframes giftFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes explode {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(1.3); opacity: 0; }
}

@keyframes floatUpHeart {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-60px) scale(1.3); opacity: 0; }
}
