/* File: assets/todayword.css */
/* Version: v2.0 - 2025-05-05 */
/* Mục đích: Giao diện khung hiển thị từ khóa, giữ lại phần không liên quan đến hiệu ứng love */

.todayword-container {
  position: relative;
  padding: 20px;
  background: #fff;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  max-width: 600px;
}

.todayword-keyword {
  font-weight: bold;
  font-size: 24px;
  margin-bottom: 10px;
}

.tw-btn {
  display: inline-block;
  cursor: pointer;
  margin-right: 12px;
  user-select: none;
  font-size: 20px;
}

.tw-count {
  margin-left: 5px;
  font-size: 16px;
  color: #888;
}

.tw-suggestion-note {
  margin-top: 8px;
  background: #f3f3f3;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  display: inline-block;
  color: #333;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tw-share-options {
  display: none;
  margin-top: 10px;
}

.tw-share-options button {
  margin-right: 8px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
}

/* Các hiệu ứng mốc giữ lại */
.tw-flash {
  animation: flash 1s ease-out;
}
@keyframes flash {
  0%, 100% { background-color: #fff; }
  50% { background-color: #f5f5f5; }
}

.tw-shake {
  animation: shake 0.4s;
}
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.tw-heart-rain,
.tw-money,
.tw-star {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  font-size: 20px;
}

#tw-save-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 16px;
}

#tw-save-popup .tw-popup-content {
  background: #fff;
  max-width: 420px;
  width: 90%;
  padding: 24px;
  border-radius: 10px;
  position: relative;
  color: #333;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Tạm layout chuẩn 800x900 khi render ảnh */
.tw-render-fixed {
  width: 800px;
  height: 900px;
  overflow: hidden;
  padding: 40px;
  font-size: 17px;
  position: relative;
  background: #fff;
}

#todayword-screenshot img.qr,
#tw-preview img.qr {
  width: 50px;
  height: auto !important;
}

/* ✅ Chỉ áp dụng khi chụp hình */
.tw-mode-surface.tw-mode-pc {
  max-width: 390px;
  padding: 10px;
  font-size: 19px;
  background: #fff;
  box-sizing: border-box;
  margin: 0 auto;
}
.tw-mode-surface.tw-mode-pc .todayword-qrcode img {
  width: 50px;
  height: auto; /* đảm bảo không bị dẹp hình */
}


.tw-mode-surface.tw-mode-mobile {
  min-width: 420px;
  padding: 10px;
  font-size: 17px;
  background: #fff;
  box-sizing: border-box;
  margin: 0 auto;
}
.tw-mode-surface.tw-mode-mobile .todayword-qrcode img {
  width: 50px;
  height: auto; /* đảm bảo không bị dẹp hình */
}

.tw-btn.zoom-bounce {
  transform: scale(1.3);
  transition: transform 0.2s ease;
}
.highlight-error {
  border: 2px solid red !important;
  background: #ffecec !important;
}

/* Tooltip cho icon log */
.log-icon {
  position: relative;
  cursor: pointer;
}

.log-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 120%;
  left: 0;
  z-index: 99;
  display: none;
  white-space: normal;
  max-width: 250px;
  padding: 8px 12px;
  background: #f9f9f9;
  border: 1px solid #ccc;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.log-icon:hover::after {
  display: block;
}

