/* =========================
   Components (global)
   ========================= */

/* Header */
.svt-topbar{
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(8, 12, 22, .75);
  border-bottom: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.svt-topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height: 64px;
}

.svt-brand{
  color: rgba(255,255,255,.95);
  text-decoration:none;
  font-weight:800;
  letter-spacing:.2px;
}

.svt-topnav{
  display:flex;
  gap: 10px;
  align-items:center;
}

.svt-iconbtn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.92);
}

.svt-iconbtn:hover{
  transform: translateY(-1px);
}

/* Buttons (global) */
.svt-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.svt-btn--primary{
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.95);
}

.svt-btn--glass{
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
}

.svt-btn:hover{
  transform: translateY(-1px);
}

.svt-iconbtn { position: relative; }

.svt-unread-dot{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:#ff3b30;
  color:#fff;
  font-size:12px;
  line-height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  box-shadow:0 2px 10px rgba(0,0,0,.25);
}

/* =========================
   Messages: “live” polish
   ========================= */

/* Blå glow rundt tråd når det kommer ny melding */
.svt-msg-thread.svt-msg-thread--new{
  position: relative;
  border-color: rgba(0, 170, 255, 0.70) !important;
  box-shadow:
    0 0 0 2px rgba(0, 170, 255, 0.22),
    0 0 26px rgba(0, 170, 255, 0.18) !important;
}

.svt-msg-thread.svt-msg-thread--new::after{
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    120% 140% at 20% 0%,
    rgba(0,170,255,0.30),
    rgba(0,170,255,0.08) 55%,
    rgba(0,170,255,0.00) 75%
  );
  filter: blur(10px);
  opacity: 0.95;
  animation: svtMsgGlowPulse 1.35s ease-in-out infinite;
}

@keyframes svtMsgGlowPulse{
  0%   { opacity: 0.55; transform: scale(0.995); }
  50%  { opacity: 1.00; transform: scale(1.010); }
  100% { opacity: 0.55; transform: scale(0.995); }
}

/* Typing-indikator (vi legger inn elementet via JS i neste steg) */
.svt-msg-typing{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  gap: 8px;
}

.svt-msg-typing .svt-typing-dots{
  display: inline-flex;
  gap: 4px;
}

.svt-msg-typing .svt-typing-dots span{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0,170,255,0.75);
  animation: svtTypingDot 1.0s infinite ease-in-out;
  opacity: 0.35;
}

.svt-msg-typing .svt-typing-dots span:nth-child(2){ animation-delay: .15s; }
.svt-msg-typing .svt-typing-dots span:nth-child(3){ animation-delay: .30s; }

@keyframes svtTypingDot{
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50%      { transform: translateY(-3px); opacity: 1; }
}

/* Respekter “reduced motion” */
@media (prefers-reduced-motion: reduce){
  .svt-msg-thread.svt-msg-thread--new::after{ animation: none; }
  .svt-msg-typing .svt-typing-dots span{ animation: none; opacity: .9; }
}

/* Messages: pop-in animation for new messages */
.svt-msg-row.is-new {
  animation: svtMsgPopIn .18s ease-out;
}

@keyframes svtMsgPopIn {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}