/* TND WooCommerce Order Notification - Frontend Styles
   Tamil Nadu Digital | tamilnadudigital.com
*/

:root {
  --tnd-bg:     #ffffff;
  --tnd-accent: #e84040;
  --tnd-text:   #1a1a1a;
}

#tnd-on-wrapper {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
}

#tnd-on-wrapper.tnd-bottom-left  { bottom: 24px; left: 20px; }
#tnd-on-wrapper.tnd-bottom-right { bottom: 24px; right: 20px; }
#tnd-on-wrapper.tnd-top-left     { top: 24px; left: 20px; }
#tnd-on-wrapper.tnd-top-right    { top: 24px; right: 20px; }

/* ── Notification Card ── */
#tnd-on-popup {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--tnd-bg);
  color: var(--tnd-text);
  border-radius: 14px;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.06),
    0 12px 32px rgba(0,0,0,0.12);
  padding: 14px 18px 14px 14px;
  max-width: 320px;
  min-width: 240px;
  position: relative;
  border-left: 4px solid var(--tnd-accent);

  /* Hidden by default */
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition:
    opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#tnd-on-popup.tnd-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Top-positioned: slide down */
.tnd-top-left  #tnd-on-popup,
.tnd-top-right #tnd-on-popup {
  transform: translateY(-20px) scale(0.96);
}
.tnd-top-left  #tnd-on-popup.tnd-show,
.tnd-top-right #tnd-on-popup.tnd-show {
  transform: translateY(0) scale(1);
}

/* ── Product Image ── */
#tnd-on-img-wrap {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f4f4f4;
  border: 1px solid rgba(0,0,0,0.06);
}

#tnd-on-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Icon fallback when no image */
#tnd-on-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--tnd-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

/* ── Content ── */
#tnd-on-content {
  flex: 1;
  min-width: 0;
}

#tnd-on-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tnd-accent);
  margin-bottom: 4px;
}

#tnd-on-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--tnd-accent);
  border-radius: 50%;
  animation: tnd-pulse 1.4s ease-in-out infinite;
}

@keyframes tnd-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

#tnd-on-message {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--tnd-text);
  margin: 0 0 4px;
  word-break: break-word;
}

#tnd-on-time {
  font-size: 11px;
  color: #999;
  font-weight: 400;
}

/* ── Close Button ── */
#tnd-on-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

#tnd-on-close:hover {
  color: #555;
  background: rgba(0,0,0,0.06);
}

/* ── Progress Bar ── */
#tnd-on-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--tnd-accent);
  border-radius: 0 0 0 10px;
  width: 100%;
  transform-origin: left;
  opacity: 0.5;
}

#tnd-on-progress.tnd-progress-run {
  animation: tnd-shrink linear forwards;
}

@keyframes tnd-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  #tnd-on-wrapper.tnd-bottom-left,
  #tnd-on-wrapper.tnd-bottom-right {
    bottom: 16px;
    left: 12px;
    right: 12px;
  }
  #tnd-on-wrapper.tnd-top-left,
  #tnd-on-wrapper.tnd-top-right {
    top: 16px;
    left: 12px;
    right: 12px;
  }
  #tnd-on-popup {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}
