/* Animated background blobs */
@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(20px, -30px); }
  50% { transform: translate(-10px, 20px); }
  75% { transform: translate(-30px, -10px); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-25px, 20px); }
  50% { transform: translate(15px, -25px); }
  75% { transform: translate(25px, 15px); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(30px, 10px); }
  50% { transform: translate(-20px, -15px); }
  75% { transform: translate(10px, 30px); }
}

.blob-1 {
  animation: float1 20s ease-in-out infinite;
}

.blob-2 {
  animation: float2 24s ease-in-out infinite;
}

.blob-3 {
  animation: float3 28s ease-in-out infinite;
}

/* Pulsing border for link box */
@keyframes pulse-border {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7), inset 0 0 0 1px rgba(79, 70, 229, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0), inset 0 0 0 1px rgba(79, 70, 229, 1);
  }
}

.link-box-pulse {
  animation: pulse-border 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Status indicator glow */
@keyframes glow-green {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

@keyframes glow-red {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

.status-dot-sender {
  animation: glow-green 2s ease-in-out infinite;
  background: #22c55e;
}

.status-dot-receiver {
  animation: glow-red 2s ease-in-out infinite;
  background: #ef4444;
}

/* App shell and workspace */
.dd-app {
  background:
    radial-gradient(130% 120% at 0% 6%, rgba(59, 130, 246, 0.2) 0%, rgba(2, 6, 23, 0) 50%),
    radial-gradient(110% 130% at 100% 0%, rgba(99, 102, 241, 0.16) 0%, rgba(2, 6, 23, 0) 55%),
    linear-gradient(180deg, #020617 0%, #020617 100%);
}

body.dd-tour-open {
  overflow: hidden;
}

body.dd-tour-open .dd-main,
body.dd-tour-open .dd-topbar,
body.dd-tour-open .dd-footer {
  z-index: auto !important;
}

.dd-main {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1rem 0.95rem !important;
}

.dd-workspace {
  align-items: start;
}

.dd-tour {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.dd-tour.is-hidden {
  display: none;
}

.dd-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.14);
}

.dd-tour-spot {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 0.85rem;
  border: 1px solid rgba(165, 180, 252, 0.95);
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.5),
    0 14px 34px rgba(15, 23, 42, 0.6),
    0 0 0 9999px rgba(2, 6, 23, 0.72);
  pointer-events: none;
  z-index: 61;
  transition:
    top 0.22s ease,
    left 0.22s ease,
    width 0.22s ease,
    height 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.dd-tour-spot.is-hidden {
  opacity: 0;
}

.dd-tour-card {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  width: min(24rem, calc(100vw - 2.2rem));
  z-index: 62;
  border: 1px solid rgba(165, 180, 252, 0.72);
  border-radius: 1rem;
  background: rgba(4, 8, 24, 0.98);
  padding: 1rem 1rem 0.95rem;
  box-shadow:
    0 22px 48px rgba(2, 6, 23, 0.72),
    inset 0 1px 0 rgba(224, 231, 255, 0.22);
}

.dd-tour-step-meta {
  margin: 0;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #94a3b8;
}

.dd-tour-title {
  margin: 0.34rem 0 0;
  font-size: 1.14rem;
  line-height: 1.24;
  font-weight: 700;
  color: #ffffff;
}

.dd-tour-text {
  margin: 0.45rem 0 0;
  font-size: 0.93rem;
  line-height: 1.52;
  color: #cbd5e1;
}

.dd-tour-actions {
  margin-top: 0.95rem;
  display: flex;
  gap: 0.5rem;
}

.dd-tour-btn {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  padding: 0.42rem 0.74rem;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.dd-tour-btn:hover:not(:disabled) {
  border-color: rgba(129, 140, 248, 0.72);
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.9);
}

.dd-tour-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.dd-tour-btn-primary {
  border-color: rgba(165, 180, 252, 0.88);
  color: #ffffff;
  background: linear-gradient(90deg, rgba(79, 70, 229, 1) 0%, rgba(99, 102, 241, 1) 100%);
}

.dd-tour-target {
  position: relative !important;
  z-index: 81 !important;
  border-radius: 0.9rem;
  filter: brightness(1.04) saturate(1.04);
  transition: filter 0.2s ease;
}

.dd-card {
  border: 1px solid rgba(99, 102, 241, 0.28) !important;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.9) 0%, rgba(2, 6, 23, 0.72) 100%) !important;
  color: #e2e8f0 !important;
  box-shadow:
    0 18px 42px rgba(2, 6, 23, 0.55),
    inset 0 1px 0 rgba(148, 163, 184, 0.07);
  backdrop-filter: blur(8px);
}

.dd-card-primary {
  padding: 1.45rem !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(226, 232, 240, 0.92) 100%) !important;
  color: #0f172a !important;
  box-shadow:
    0 18px 42px rgba(2, 6, 23, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dd-card-side {
  padding: 1.05rem !important;
  align-self: stretch;
}

.dd-card-primary h2,
.dd-card-primary .text-slate-900 {
  color: #0f172a !important;
}

.dd-card-primary .text-slate-700,
.dd-card-primary .text-slate-600 {
  color: #475569 !important;
}

.dd-card-primary .dd-dropzone {
  border-color: rgba(148, 163, 184, 0.45) !important;
  background: rgba(248, 250, 252, 0.65) !important;
}

.dd-card-primary .dd-dropzone p {
  color: #334155 !important;
}

.dd-card-primary .dd-dropzone:hover {
  border-color: rgba(99, 102, 241, 0.55) !important;
  background: rgba(238, 242, 255, 0.88) !important;
}

.dd-card-primary .dd-summary {
  background: rgba(241, 245, 249, 0.86) !important;
  border-color: rgba(148, 163, 184, 0.42) !important;
}

.dd-card-primary .dd-summary .text-slate-700 {
  color: #64748b !important;
}

.dd-card-primary .dd-summary .text-slate-900 {
  color: #0f172a !important;
}

.dd-card-primary .dd-btn-secondary {
  background: rgba(248, 250, 252, 0.72) !important;
  border-color: rgba(148, 163, 184, 0.5) !important;
  color: #334155 !important;
}

.dd-card-primary .dd-btn-secondary:hover {
  border-color: rgba(99, 102, 241, 0.55) !important;
  background: rgba(238, 242, 255, 0.92) !important;
  color: #0f172a !important;
}

.dd-dropzone {
  border-color: rgba(129, 140, 248, 0.4) !important;
  background: rgba(15, 23, 42, 0.56) !important;
}

.dd-dropzone p {
  color: #cbd5e1 !important;
}

.dd-dropzone:hover {
  border-color: rgba(129, 140, 248, 0.8) !important;
  background: rgba(30, 41, 59, 0.72) !important;
  transform: translateY(-1px);
}

.dd-summary {
  background: rgba(15, 23, 42, 0.54) !important;
  border-color: rgba(129, 140, 248, 0.24) !important;
}

.dd-summary .text-slate-700 {
  color: #94a3b8 !important;
}

.dd-summary .text-slate-900 {
  color: #e2e8f0 !important;
}

.dd-btn {
  letter-spacing: 0.01em;
}

.dd-btn-secondary {
  background: rgba(15, 23, 42, 0.55) !important;
  border-color: rgba(148, 163, 184, 0.38) !important;
  color: #cbd5e1 !important;
}

.dd-btn-secondary:hover {
  border-color: rgba(165, 180, 252, 0.68) !important;
  background: rgba(30, 41, 59, 0.72) !important;
  color: #f8fafc !important;
}

.dd-btn-primary {
  border: 1px solid rgba(165, 180, 252, 0.65) !important;
  background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%) !important;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.35) !important;
}

.dd-btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.dd-subcard {
  border-color: rgba(71, 85, 105, 0.65) !important;
  background: rgba(2, 6, 23, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.06);
}

#senderLogCard,
#receiverLogCard {
  min-height: 13.25rem;
  max-height: none;
  flex: 1 1 auto;
}

#statusSender,
#statusReceiver {
  white-space: pre-wrap !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  line-height: 1.42;
}

#statusSender::-webkit-scrollbar,
#statusReceiver::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.dd-linkbox {
  border-color: rgba(129, 140, 248, 0.62) !important;
  background: rgba(79, 70, 229, 0.14) !important;
}

#sendProgress,
#recvProgress {
  appearance: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
}

#sendProgress::-webkit-progress-bar,
#recvProgress::-webkit-progress-bar {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
}

#sendProgress::-webkit-progress-value,
#recvProgress::-webkit-progress-value {
  background: linear-gradient(90deg, #22d3ee, #6366f1);
  border-radius: 999px;
}

#sendProgress::-moz-progress-bar,
#recvProgress::-moz-progress-bar {
  background: linear-gradient(90deg, #22d3ee, #6366f1);
  border-radius: 999px;
}

/* App topbar layout */
.dd-topbar {
  position: relative;
  z-index: 10;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

.dd-topbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dd-topbar-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 0;
}

.dd-topbar-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.8);
  background: rgba(2, 6, 23, 0.8);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.dd-topbar-brand-text {
  min-width: 0;
}

.dd-topbar-kicker {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #64748b;
}

.dd-topbar-title {
  margin: 0.25rem 0 0;
  font-size: 1.14rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.dd-topbar-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dd-topbar-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.18s ease;
}

.dd-topbar-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.dd-topbar-link:hover {
  color: #a5b4fc;
}

.dd-tour-trigger {
  position: relative;
  border: 0;
  background: transparent;
  color: #94a3b8;
  padding: 0.12rem 0;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.18s ease;
}

.dd-tour-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  bottom: -0.45rem;
  height: 2px;
  background: rgba(226, 232, 240, 0.92);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0.82;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.dd-tour-trigger:hover,
.dd-tour-trigger:focus-visible {
  color: #f8fafc;
}

.dd-tour-trigger:hover::after,
.dd-tour-trigger:focus-visible::after {
  transform: scaleX(1);
}

.dd-tour-trigger:focus-visible {
  outline: none;
}

body.dd-tour-open .dd-tour-trigger {
  color: #f8fafc;
}

body.dd-tour-open .dd-tour-trigger::after {
  transform: scaleX(1);
}

.dd-topbar-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.5);
  background: rgba(2, 6, 23, 0.4);
  font-size: 0.8rem;
  color: #94a3b8;
}

.dd-topbar-mode-value {
  font-weight: 600;
  color: #f8fafc;
}

/* Portfolio-style footer layout (independent from Tailwind utility generation) */
.dd-footer {
  position: relative;
  z-index: 10;
  margin-top: 1.2rem;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.dd-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.dd-footer-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.75rem;
  align-items: start;
}

.dd-footer-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.8);
  background: rgba(2, 6, 23, 0.8);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.dd-footer-title {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.dd-footer-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #94a3b8;
}

.dd-footer-connect {
  justify-self: end;
}

.dd-footer-connect-label {
  margin: 0;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #64748b;
}

.dd-footer-links {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.dd-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.18s ease;
}

.dd-footer-link:hover {
  color: #a5b4fc;
}

.dd-footer-link-disabled {
  opacity: 0.48;
  pointer-events: none;
  cursor: default;
}

.dd-footer-icon {
  width: 1rem;
  height: 1rem;
}

.dd-footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}

@media (min-width: 640px) {
  .dd-main {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }

  .dd-topbar-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .dd-footer-inner {
    padding: 1.75rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .dd-workspace {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) !important;
    gap: 1.25rem !important;
    align-items: stretch;
  }

  .dd-card-side {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .dd-footer-top {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .dd-footer-badge {
    display: none;
  }

  .dd-footer-connect {
    justify-self: start;
  }

  .dd-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .dd-main {
    padding-top: 1.2rem !important;
  }

  .dd-card-primary,
  .dd-card-side {
    padding: 1rem !important;
  }

  .dd-topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .dd-topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dd-tour-card {
    right: 0.7rem;
    bottom: 0.7rem;
    width: calc(100vw - 1.4rem);
  }
}
