/* ========================================
   LINE Add Friend - Floating Button & Popup
   ======================================== */

/* Floating Action Button */
.line-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #06C755;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(6, 199, 85, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.line-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(6, 199, 85, 0.5);
}

.line-fab:active {
  transform: scale(0.96);
}

/* LINE icon inside FAB */
.line-fab svg {
  width: 34px;
  height: 34px;
  fill: #fff;
}

/* Subtle pulse ring on first load */
.line-fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(6, 199, 85, 0.5);
  animation: line-fab-ping 2s ease-out 3;
  pointer-events: none;
}

@keyframes line-fab-ping {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Tooltip on hover */
.line-fab-tooltip {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.line-fab-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #333;
  border-right: none;
}

.line-fab:hover .line-fab-tooltip {
  opacity: 1;
}

/* ========================================
   Popup Modal
   ======================================== */

.line-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.line-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.line-popup-card {
  background: #fff;
  border-radius: 20px;
  width: 360px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.3s ease;
  position: relative;
}

.line-popup-overlay.active .line-popup-card {
  transform: translateY(0) scale(1);
}

/* Close button */
.line-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.line-popup-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

.line-popup-close .material-icons {
  font-size: 18px;
  color: #666;
}

/* Header with profile */
.line-popup-header {
  background: linear-gradient(135deg, #06C755 0%, #00B74A 100%);
  border-radius: 20px 20px 0 0;
  padding: 32px 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
.line-popup-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.line-popup-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.line-popup-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.line-popup-bot-name {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.line-popup-bot-desc {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* Body */
.line-popup-body {
  padding: 24px;
  text-align: center;
}

/* QR code section */
.line-popup-qr-section {
  margin-bottom: 20px;
}

.line-popup-qr-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.line-popup-qr-label::before,
.line-popup-qr-label::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: #e0e0e0;
}

.line-popup-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid #eee;
  padding: 8px;
  background: #fff;
}

/* Features list */
.line-popup-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  text-align: left;
}

.line-popup-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #444;
}

.line-popup-feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f0faf3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.line-popup-feature-icon .material-icons {
  font-size: 16px;
  color: #06C755;
}

/* CTA button */
.line-popup-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: #06C755;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  font-family: inherit;
}

.line-popup-cta:hover {
  background: #05b34c;
}

.line-popup-cta:active {
  transform: scale(0.98);
}

.line-popup-cta svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .line-fab {
    bottom: 76px; /* above mobile nav */
    right: 16px;
    width: 52px;
    height: 52px;
  }

  .line-fab svg {
    width: 28px;
    height: 28px;
  }

  .line-fab-tooltip {
    display: none;
  }

  .line-popup-card {
    width: 100%;
    max-width: 340px;
  }

  .line-popup-qr-img {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 380px) {
  .line-popup-card {
    border-radius: 16px;
  }

  .line-popup-header {
    padding: 24px 16px 20px;
    border-radius: 16px 16px 0 0;
  }

  .line-popup-body {
    padding: 16px;
  }

  .line-popup-avatar {
    width: 72px;
    height: 72px;
  }
}
