/* =====================================================================
   BONDA - dizajn. Sve boje su varijable, lako za mijenjati.
   ===================================================================== */
:root {
  --bg-1:        #f7edf4;   /* svijetlo roza */
  --bg-2:        #ece6f3;   /* svijetla lila */
  --magenta:     #c1198f;   /* brend magenta (logo, prsten) */
  --magenta-2:   #e0559f;
  --heading:     #38356b;   /* tamni indigo naslovi */
  --purple-1:    #6a5aa0;   /* gumb gradijent svijetli */
  --purple-2:    #3f2f6b;   /* gumb gradijent tamni */
  --ai-bubble:   #493d80;   /* AI mjehurić (indigo) */
  --text-dark:   #2f2b40;
  --text-muted:  #9a93a8;
  --card:        rgba(255,255,255,0.55);
  --radius:      18px;
  --shadow:      0 10px 30px rgba(90,60,120,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
  background: #d9d2e4;
  display: flex; justify-content: center; align-items: stretch;
  min-height: 100vh; min-height: 100dvh;
}
.hidden { display: none !important; }

/* Mobitel: telefon puni cijeli ekran (bez ruba gore/dolje). Okvir se pojavi na desktopu. */
.phone {
  position: relative;
  width: 100%; max-width: 430px; height: 100vh; height: 100dvh;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 55%, #e6ddef 100%);
  overflow: hidden;
}

/* --- Ekrani (s fade prijelazom) --- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none; transform: scale(1.015);
  transition: opacity .4s ease, visibility .4s ease, transform .4s ease;
}
.screen.active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: 40px 20px 28px; }

/* --- Brend --- */
.brand-logo {
  background: url('bonda_logo.svg') center/contain no-repeat;
  height: 41px; width: 100%;
  font-size: 0; color: transparent;   /* sakrij tekst "bonda", prikaži SVG */
  text-align: center; margin-bottom: 28px;
}
.brand-logo.small { height: 31px; }
.brand-logo.footer { height: 29px; margin-top: 34px; margin-bottom: 6px; opacity: .9; }

.title {
  font-size: 27px; font-weight: 800; line-height: 1.15;
  text-align: center; color: var(--heading); margin-bottom: 24px;
}

/* --- Polja / gumbi --- */
.field { margin-bottom: 16px; }
input {
  width: 100%; border: none; outline: none;
  background: rgba(255,255,255,.65);
  padding: 18px 22px; border-radius: 16px;
  font-family: inherit; font-size: 15px; color: var(--text-dark);
  box-shadow: var(--shadow);
}
input::placeholder { color: #8a8398; }

.btn-primary {
  display: block; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--purple-1), var(--purple-2));
  color: #fff; font-family: inherit; font-weight: 700; letter-spacing: .5px;
  font-size: 15px; padding: 16px 34px; border-radius: 26px;
  box-shadow: 0 12px 24px rgba(63,47,107,.35);
}
.btn-primary.center { margin: 26px auto 0; }
.btn-primary:active { transform: translateY(1px); }

.btn-text {
  display: block; margin: 16px auto 0; background: none; border: none;
  color: var(--heading); font-family: inherit; font-size: 13px; cursor: pointer; opacity: .8;
}

.switch { text-align: center; margin-top: 22px; color: var(--text-muted); font-size: 13px; line-height: 1.9; }
.switch a { color: var(--heading); font-weight: 700; cursor: pointer; }
.error { color: #d63384; font-size: 13px; min-height: 18px; margin-top: 10px; }
.center { text-align: center; }

/* --- Carousel persona --- */
.carousel {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin: 10px 0 8px;
}
.avatar-ring {
  position: relative;
  width: 250px; height: 250px; border-radius: 50%;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(193,25,143,.28);
}
.avatar-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 0deg,
     var(--magenta), var(--magenta-2), #f0a5cf, #d63aa0, var(--purple-1), var(--magenta));
  animation: ringspin 12s linear infinite;
  animation-delay: var(--ring-delay, 0s);
}
.avatar-photo {
  position: relative; z-index: 1;
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--magenta) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 72px; font-weight: 700;
  border: 5px solid var(--bg-1);
}
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 40px; color: #b8a9c9; line-height: 1; padding: 10px;
}
.nav-arrow.left { left: -6px; }
.nav-arrow.right { right: -6px; }

.persona-name { text-align: center; color: var(--heading); font-size: 32px; font-weight: 800; margin-top: 22px; }
.persona-sub { text-align: center; color: var(--text-dark); font-size: 16px; margin-top: 4px; }
.persona-desc { text-align: center; color: #5a5468; font-size: 15px; line-height: 1.55; margin-top: 18px; padding: 0 6px; }

/* --- Chat --- */
/* chat koristi zajednički .screen layout (flex + fade) */
.chat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; padding-top: 8px;
}
.chat-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--magenta) center/cover no-repeat;
  border: 3px solid var(--magenta);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
  flex-shrink: 0; cursor: pointer;
}
.chat-name { font-size: 24px; font-weight: 700; color: var(--heading); flex: 1; }
.hamburger { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 5.5px; padding: 6px; }
.hamburger span { width: 29px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--magenta), var(--purple-2)); }

.messages { flex: 1; overflow-y: auto; padding: 10px 20px 8px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.date-sep { text-align: center; color: #a79fb5; font-size: 13px; margin: 8px 0; }
.msg { max-width: 78%; padding: 14px 18px; font-size: 15px; line-height: 1.45; border-radius: 22px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: #fff; color: var(--text-dark); border-bottom-right-radius: 6px; box-shadow: var(--shadow); }
.msg.assistant { align-self: flex-start; background: var(--ai-bubble); color: #fff; border-bottom-left-radius: 6px; }
.msg.typing { opacity: .7; font-style: italic; }

.composer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.6);
}
.composer-media { display: flex; align-items: center; gap: 6px; }
.composer-media-menu {
  display: flex; gap: 6px; align-items: center;
}
.composer-media-menu button {
  background: var(--bg-1); border: none; cursor: pointer; width: 38px; height: 38px;
  border-radius: 11px; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
}
.composer-media-menu button svg { width: 20px; height: 20px; }
.composer-media-menu button:hover { background: #f3e6f2; }
.composer input {
  flex: 1; min-width: 0; background: #fff; box-shadow: none; padding: 14px 18px; border-radius: 24px; font-size: 15px;
}
.composer-media-btn {
  background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.send-btn {
  background: linear-gradient(135deg, var(--magenta), var(--purple-2));
  border: none; cursor: pointer; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.send-btn svg { margin-left: -2px; }
.send-btn:hover { filter: brightness(1.05); }
.send-btn:active { transform: scale(.94); }

/* --- Pretplata --- */
.price-card {
  position: relative; background: var(--card); border-radius: 20px;
  padding: 30px 24px 26px; margin-bottom: 30px; text-align: center; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.price-card:hover, .price-card:focus-within, .price-card:active {
  border-color: var(--magenta); transform: translateY(-2px);
}
.price-card h3 { color: var(--heading); font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.price-card p { color: #5a5468; font-size: 15px; line-height: 1.5; }
.price { color: var(--heading); font-size: 30px; font-weight: 800; margin-top: 16px; }
.badge {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--magenta), var(--magenta-2));
  color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .5px;
  padding: 7px 18px; border-radius: 16px; white-space: nowrap;
}
.fine { text-align: center; color: #7a7488; font-size: 13px; line-height: 1.6; margin-bottom: 14px; }

/* --- Izbornik --- */
.menu {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--magenta) 0%, var(--magenta) 28%, var(--purple-2) 92%);
  background-size: 180% 180%;
  animation: menuFlow 16s ease-in-out infinite;
}
@keyframes menuFlow {
  0%   { background-position: 50% 0%; }
  50%  { background-position: 50% 100%; }
  100% { background-position: 50% 0%; }
}
@media (prefers-reduced-motion: reduce) {
  .menu { animation: none; }
}
.menu-topbar { display: flex; justify-content: flex-end; padding: 18px 28px 0; }
.menu-close {
  background: none; border: none; cursor: pointer; color: #fff;
  font-size: 34px; line-height: 1; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.menu-close:hover { opacity: .8; }
.menu-items { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 24px 60px; }
.menu-card { position: relative; background: #fff; border-radius: 22px; padding: 22px 14px 14px; width: 78%; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.menu-x { position: absolute; top: 8px; right: 12px; background: none; border: none; cursor: pointer;
  color: var(--magenta); font-size: 26px; font-weight: 700; line-height: 1; padding: 4px 8px; }
.menu-x:hover { opacity: .75; }
.menu-item { display: block; width: 100%; max-width: 320px; text-align: center; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 20px; font-weight: 600; color: #fff; padding: 16px; border-radius: 14px; }
.menu-item:hover { background: rgba(255,255,255,.15); }
.menu-item.danger { color: #ffd6ea; }
.menu-item.close { color: rgba(255,255,255,.7); font-size: 14px; }

/* --- Modali za registraciju / prijavu --- */
.modal { position: absolute; inset: 0; background: rgba(40,30,60,.55);
  display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px; }
.modal-card {
  background: linear-gradient(160deg, #ffffff, #f6eef7);
  border-radius: 24px; padding: 30px 26px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35); text-align: center;
}
.modal-card .brand-logo { height: 26px; margin-bottom: 12px; }
.modal-title { color: var(--heading); font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.modal-note { color: #6a6480; font-size: 14px; margin-bottom: 20px; }
.modal-card .field input { background: rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(90,60,120,.08); }
.modal-card .switch { margin-top: 16px; }

/* Gumb unutar kartice pretplate */
.price-card .btn-primary { margin-top: 18px; }

/* --- Traka s preostalim riječima --- */
.words-bar {
  margin: 0 18px 6px; align-self: center;
  background: rgba(255,255,255,.7); color: var(--heading);
  font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 14px;
  box-shadow: var(--shadow);
}

/* --- Animacije --- */
@keyframes ringspin { to { transform: rotate(360deg); } }

/* meki prijelaz kod promjene osobe (swipe) */
.swap { animation: swapfade .32s ease; }
@keyframes swapfade { from { opacity: .15; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* poruke se blago pojave */
.msg { animation: bubblein .25s ease; }
@keyframes bubblein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* carousel: povlačenje lijevo/desno mišem ili prstom */
.carousel { touch-action: pan-y; user-select: none; cursor: grab; }
.carousel:active { cursor: grabbing; }
.avatar-photo { -webkit-user-drag: none; user-select: none; }

/* poštuj korisnike koji ne žele animacije */
@media (prefers-reduced-motion: reduce) {
  .avatar-ring::before { animation: none; }
  .screen, .msg, .swap { transition: none; animation: none; }
}

/* Chat: zaglavlje i unos su fiksni, samo poruke skrolaju */
.chat-header, .composer, #words-bar { flex-shrink: 0; }
.screen.chat { overflow: hidden; }

/* =====================================================================
   DESKTOP RASPORED (lista osoba + chat). Ispod 900px = mobilni izgled.
   ===================================================================== */
.sidebar { display: none; }          /* skriven na mobitelu */
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-muted); text-align: center; padding: 30px;
}
.chat-empty .brand-logo { margin: 0 0 6px; }

@media (min-width: 900px) {
  body { align-items: center; }
  .phone {
    max-width: 1080px; width: 94%; height: 88vh; height: 88dvh; max-height: 860px;
    display: flex; flex-direction: row; border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
  }

  /* --- Sidebar --- */
  .sidebar {
    display: flex; flex-direction: column; width: 320px; flex-shrink: 0;
    background: rgba(255,255,255,.45); border-right: 1px solid rgba(0,0,0,.06);
    padding: 24px 16px; backdrop-filter: blur(4px);
  }
  .sidebar-brand { height: 34px; margin-bottom: 18px; }
  .sidebar-title {
    font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-muted); font-weight: 600; margin: 0 6px 10px;
  }
  .sidebar-personas { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
  .sidebar-persona {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 16px; cursor: pointer; transition: background .2s ease;
  }
  .sidebar-persona:hover { background: rgba(255,255,255,.6); }
  .sidebar-persona.active { background: rgba(255,255,255,.85); box-shadow: var(--shadow); }
  .mini-avatar {
    width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
    background: var(--magenta) center/cover no-repeat;
    border: 2px solid var(--magenta);
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
  }
  .sp-meta { overflow: hidden; }
  .sp-name { font-weight: 700; color: var(--heading); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sp-sub  { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-footer { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
  .sidebar-btn {
    background: none; border: none; cursor: pointer; font-family: inherit;
    color: var(--heading); font-size: 14px; font-weight: 600; padding: 12px; border-radius: 12px; text-align: left;
  }
  .sidebar-btn:hover { background: rgba(255,255,255,.6); }

  /* --- Carousel ekran se skriva; zamjenjuje ga sidebar --- */
  #screen-personas { display: none !important; }

  /* --- Chat postaje glavni panel desno (uvijek vidljiv) --- */
  #screen-chat {
    position: relative; inset: auto; flex: 1; min-width: 0;
    opacity: 1 !important; visibility: visible !important; transform: none !important;
  }
  .chat-header .hamburger, .chat-header .chat-back, .chat-header .notif-btn { display: none; }   /* radnje su u sidebaru */
  .chat-header { padding-left: 26px; }

  /* Pretplata na desktopu ostaje preko cijelog prozora kad je aktivna */
  #screen-pricing .scroll { max-width: 560px; margin: 0 auto; }
}

/* =====================================================================
   STATUS "NA MREŽI" / notifikacije
   ===================================================================== */
.status-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #b7b0c2; margin-right: 6px; vertical-align: middle;
}
.status-dot.online { background: #37c26b; box-shadow: 0 0 0 3px rgba(55,194,107,.18); }

/* Carousel status */
.pstatus { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.pstatus.online { color: #2ea85e; }

/* Chat zaglavlje */
.chat-headtext { flex: 1; min-width: 0; }
.chat-status { font-size: 12px; color: var(--text-muted); margin-top: -5px; }
.chat-status.online { color: #2ea85e; }

/* Sistemska poruka u chatu (npr. "nije na mreži") */
.msg.system {
  align-self: center; background: rgba(255,255,255,.7); color: var(--text-muted);
  font-size: 13px; font-style: italic; box-shadow: var(--shadow);
}

/* Sidebar: status i bedž nepročitanih (desktop) */
.sp-name-row { display: flex; align-items: center; gap: 6px; }
.unread-badge {
  margin-left: auto; background: var(--magenta); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 10px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
}

/* Toast obavijest */
.toast {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(10px);
  background: var(--heading); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-size: 14px; max-width: 84%; box-shadow: 0 12px 30px rgba(0,0,0,.35);
  opacity: 0; transition: opacity .3s ease, transform .3s ease; z-index: 60; pointer-events: none;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =====================================================================
   PROFIL
   ===================================================================== */
.section-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted); font-weight: 700; margin: 22px 6px 8px;
}
.profile-card {
  background: var(--card); border-radius: 18px; padding: 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 6px;
}
.profile-name { font-size: 20px; font-weight: 700; color: var(--heading); }
.profile-email { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.pr-line { font-size: 15px; color: var(--text-dark); margin-bottom: 8px; }
.pr-line b { color: var(--heading); }
.profile-card .btn-primary { margin-top: 8px; width: 100%; }
.pr-msg { font-size: 13px; color: #2ea85e; min-height: 16px; margin-top: 8px; text-align: center; }
.pr-msg.err { color: #d63384; }
.btn-danger {
  display: block; margin: 22px auto 0; border: none; cursor: pointer;
  background: #d63384; color: #fff; font-family: inherit; font-weight: 700;
  font-size: 15px; padding: 15px 34px; border-radius: 26px;
  box-shadow: 0 10px 22px rgba(214,51,132,.3);
}

/* Profil kao modal */
.profile-modal-card {
  position: relative; max-width: 420px; max-height: 86vh; max-height: 86dvh;
  overflow-y: auto; text-align: left;
}
.profile-modal-card .modal-title { text-align: center; margin-bottom: 14px; }
.profile-modal-card .btn-danger { margin-top: 20px; }

/* =====================================================================
   PRETPLATA: mobilni ostaje puni ekran; desktop = popup s dva stupca
   ===================================================================== */
.pricing-x { display: none; }   /* X samo na desktopu */

@media (min-width: 900px) {
  #screen-pricing {
    background: rgba(40,30,60,.55);
    align-items: center; justify-content: center; padding: 24px; z-index: 38;
  }
  #screen-pricing .scroll {
    position: relative; flex: 0 1 auto; width: 100%; max-width: 780px;
    background: linear-gradient(160deg, #ffffff, #f6eef7);
    border-radius: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
    max-height: 88dvh; padding: 34px 34px 26px;
  }
  #screen-pricing .brand-logo { height: 31px; margin-bottom: 10px; }
  #screen-pricing .title { font-size: 28px; margin-bottom: 6px; }
  #screen-pricing .price-cards { display: flex; gap: 20px; align-items: stretch; margin-top: 26px; }
  #screen-pricing .price-card { flex: 1; margin-bottom: 6px; }
  #screen-pricing .fine { margin-top: 4px; }
  #screen-pricing .pricing-x { display: block; }
}

/* =====================================================================
   ADMIN: osobe
   ===================================================================== */
.mini-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: var(--magenta) center/cover no-repeat; border: 2px solid var(--magenta);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}
.admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.admin-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow);
}
.ar-meta { flex: 1; min-width: 0; }
.ar-name { font-weight: 700; color: var(--heading); font-size: 15px; }
.ar-sub { font-size: 12px; color: var(--text-muted); }
.btn-text.danger { color: #d63384; }

.admin-form {
  background: var(--card); border-radius: 18px; padding: 20px; margin-top: 18px; box-shadow: var(--shadow);
}
.admin-form h3 { color: var(--heading); margin-bottom: 14px; }
.admin-form textarea, .admin-form select {
  width: 100%; background: rgba(255,255,255,.85); border: none; outline: none;
  padding: 14px 16px; border-radius: 14px; font-family: inherit; font-size: 15px;
  color: var(--text-dark); box-shadow: var(--shadow); margin-bottom: 10px; resize: vertical;
}
.af-label { display: block; font-size: 13px; color: var(--text-muted); font-weight: 600; margin: 6px 0 6px; }
.af-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dark); margin: 12px 0; }
.af-check input { width: auto; box-shadow: none; }
.af-avatar { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.af-avatar-prev {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: var(--magenta) center/cover no-repeat; border: 3px solid var(--magenta);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; font-weight: 700;
}
.btn-outline {
  display: inline-block; cursor: pointer; background: none; border: 2px solid var(--primary, var(--purple-1));
  color: var(--heading); font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 20px;
}
.af-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 6px; }

/* Admin kao modal (široka, skrolabilna kartica) */
.admin-modal-card {
  position: relative; max-width: 560px; width: 100%;
  max-height: 88vh; max-height: 88dvh; overflow-y: auto; text-align: left;
}
.admin-modal-card .modal-title { text-align: center; }
.admin-modal-card .btn-primary.center { margin-top: 8px; }

/* Oznaka tipa razgovora u galeriji */
.pvibe { text-align: center; font-size: 15px; margin-top: 4px; min-height: 18px; }

/* Swipe po cijeloj kartici osobe + klizni prijelaz */
.persona-swipe { position: relative; }
.slide-clip { position: relative; overflow: hidden; touch-action: pan-y; user-select: none; cursor: grab; }
.slide-clip:active { cursor: grabbing; }
.persona-slide-temp { position: absolute; top: 0; left: 0; width: 100%; }
.persona-swipe .nav-arrow { position: absolute; top: 130px; transform: translateY(-50%); z-index: 3; }
.persona-swipe .nav-arrow.left { left: 2px; }
.persona-swipe .nav-arrow.right { right: 2px; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideInLeft  { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.persona-slide.from-right { animation: slideInRight .34s cubic-bezier(.22,.61,.36,1); }
.persona-slide.from-left  { animation: slideInLeft  .34s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) {
  .persona-slide.from-right, .persona-slide.from-left { animation: none; }
}

/* Trepćući kursor dok AI "tipka" */
.msg.assistant.caret::after {
  content: "▋"; margin-left: 1px; opacity: .55;
  animation: caretblink 1s steps(1) infinite;
}
@keyframes caretblink { 50% { opacity: 0; } }

/* Bedž s tipom razgovora na avataru */
.avatar-badge {
  position: absolute; top: 12px; right: 12px;
  z-index: 2; background: var(--magenta);
  border-radius: 50%; width: 54px; height: 54px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(90,60,120,.22);
}
.avatar-badge svg { width: 26px; height: 26px; }
.avatar-badge:empty { display: none; }

/* Gornja traka na galeriji (prijavljeni korisnik): logo lijevo, meni desno */
.top-bar {
  display: none; align-items: center; justify-content: space-between;
  margin: -20px 0 32px;
}
.topbar-logo { width: 132px; height: 31px; margin: 0; background-position: left center; }
.top-bar .hamburger { position: static; }

/* Pretplata: gornja traka (logo+meni) na mobitelu; skrivena na desktopu (tamo je popup s X) */
.pricing-top { display: flex; }
@media (min-width: 900px) {
  #screen-pricing .top-bar { display: none; }
}

/* Zvonce obavijesti + panel */
.top-actions { display: flex; align-items: center; gap: 14px; }
.notif-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--magenta); padding: 2px; display: flex; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; background: #d63384; color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.notif-panel {
  position: absolute; top: 62px; left: 20px; right: 20px; width: auto; max-width: none;
  background: #fff; border-radius: 16px; box-shadow: 0 18px 44px rgba(60,40,90,.28);
  z-index: 55; overflow: hidden;
}
.notif-head { padding: 12px 16px; font-weight: 700; color: var(--heading); border-bottom: 1px solid #eee; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #f3f0f5; }
.notif-item:hover { background: #faf5fb; }
.notif-name { font-weight: 700; color: var(--heading); font-size: 15px; }
.notif-snippet { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.notif-empty { padding: 22px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Profil i Admin: mobitel = pune stranice s trakom; desktop = centrirani popup */
.page-top { display: flex; }
.page-x { display: none; }
@media (min-width: 900px) {
  #screen-profile, #screen-admin, #screen-stats, #screen-register, #screen-login {
    background: rgba(28,18,42,.72);
    align-items: center; justify-content: center; padding: 24px; z-index: 50;
  }
  #screen-profile .scroll, #screen-admin .scroll, #screen-stats .scroll,
  #screen-register .scroll, #screen-login .scroll {
    position: relative; flex: 0 1 auto; width: 100%; display: block;
    background: linear-gradient(160deg, #ffffff, #f6eef7);
    border-radius: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
    max-height: 86dvh; overflow-y: auto; padding: 30px 28px;
  }
  #screen-profile .scroll { max-width: 460px; }
  #screen-admin .scroll { max-width: 600px; }
  #screen-stats .scroll { max-width: 560px; }
  #screen-register .scroll, #screen-login .scroll { max-width: 420px; }
  #screen-profile .page-top, #screen-admin .page-top, #screen-stats .page-top { display: none; }
  #screen-profile .page-x, #screen-admin .page-x, #screen-stats .page-x,
  #screen-register .page-x, #screen-login .page-x { display: block; }
}

/* Pravni linkovi u dnu (GDPR) */
.legal-links { text-align: center; margin-top: 46px; font-size: 12px; color: var(--text-muted); }
.legal-links a { color: var(--text-muted); text-decoration: underline; }
.legal-links a:hover { color: var(--magenta); }
.legal-links span { margin: 0 6px; opacity: .6; }

/* Kvačica za prihvaćanje uvjeta (registracija) */
.consent { display: flex; align-items: flex-start; gap: 9px; text-align: left; font-size: 13px; color: var(--text-muted); margin: 4px 2px 14px; line-height: 1.4; }
.consent span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.consent input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; transform: scale(.65); transform-origin: left top; accent-color: var(--magenta); }
.consent a { color: var(--magenta); text-decoration: underline; }

/* Statistika */
.stat-group { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 700; margin: 22px 4px 10px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); text-align: center; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--heading); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.stat-list { display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat-row b { color: var(--magenta); }

/* =====================================================================
   DETALJI OSOBE (slika u pozadini + info + gumb za razgovor)
   ===================================================================== */
.persona-name { cursor: pointer; }
.avatar-ring { cursor: pointer; }
.pd-screen { display: flex; flex-direction: column; }
.pd-hero {
  flex: 1; position: relative; min-height: 0;
  background: var(--magenta) center/cover no-repeat;
  display: flex; align-items: flex-end;
}
.pd-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,10,30,.94) 0%, rgba(20,10,30,.55) 48%, rgba(20,10,30,0) 82%);
}
.pd-hero.noimg::before {
  content: attr(data-letter); position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center; font-size: 120px; color: #fff; opacity: .55;
}
.pd-back {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--heading); font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.pd-badge {
  position: absolute; top: 18px; right: 16px; z-index: 3;
  background: var(--magenta); border-radius: 50%; width: 40px; height: 40px; padding: 0;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.pd-badge svg { width: 20px; height: 20px; }
.pd-badge:empty { display: none; }
.pd-info { position: relative; z-index: 1; width: 100%; padding: 20px 20px 30px; color: #fff; }
.pd-name { font-size: 30px; font-weight: 800; color: #fff; margin: 0; }
.pd-sub { font-size: 15px; opacity: .92; margin-top: 3px; }
.pd-vibe { font-size: 14px; margin-top: 10px; font-weight: 600; color: #ffd9f0; }
.pd-status { font-size: 13px; margin-top: 6px; color: #fff; }
.pd-status .status-dot { background: #cbb8dd; }
.pd-status .status-dot.online { background: #37c26b; }
.pd-desc { font-size: 15px; line-height: 1.5; margin-top: 12px; opacity: .95; }
.pd-locked {
  display: inline-block; margin-top: 16px; font-size: 12px; color: #fff;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  padding: 8px 12px; border-radius: 20px;
}
.pd-chat-btn { width: 100%; margin: 18px 0 0; }

/* Prijavljeni korisnik: pojednostavljen slider (detalji su na stranici osobe) */
body.logged-in .persona-sub,
body.logged-in .persona-desc,
body.logged-in .pvibe { display: none; }

/* Elementi samo za goste (npr. donji logo) */
body.logged-in .guest-only { display: none; }

/* Splash pri prvom učitavanju */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--magenta), var(--purple-2));
  transition: opacity .8s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }
.splash-logo {
  width: 210px; height: 62px;
  background: url('bonda_logo.svg') center/contain no-repeat;
  filter: brightness(0) invert(1);   /* bijeli logo na gradientu */
  animation: splashIn 1.1s cubic-bezier(.22,.61,.36,1) both;
}
.splash.hide .splash-logo { transform: scale(1.12); transition: transform .8s ease; }
@keyframes splashIn { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }

/* Zvonce +10% u traci */
.notif-btn svg { width: 26px; height: 26px; }

/* Strelica za povratak u chatu (lijevo od menija) */
.chat-actions { display: flex; align-items: center; gap: 14px; align-self: flex-start; margin-top: 12px; }
.chat-back {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-back:hover { opacity: .75; }

/* Sitni tekst u redu statistike */
.stat-sub { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* Hint tekst u profilu (O meni) */
.pr-hint { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.4; }

/* Ljepši select i textarea u poljima (profil "O meni" i sl.) */
.field textarea, .field select {
  width: 100%; border: none; outline: none;
  background: rgba(255,255,255,.65);
  padding: 16px 20px; border-radius: 16px;
  font-family: inherit; font-size: 15px; color: var(--text-dark);
  box-shadow: var(--shadow);
}
.field textarea {
  resize: vertical; min-height: 96px; line-height: 1.5;
}
.field textarea::placeholder { color: #8a8398; }
.field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C22E91' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 14px;
}

/* ===================== PREMIUM MEDIJI ===================== */
/* Premium kartica u cijenama */
.badge-premium { background: linear-gradient(90deg, var(--magenta), var(--purple-2)); }

/* Detalj osobe: zaključani teaser */
.pd-media { margin-top: 14px; }
.pd-locked {
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.14);
  border-radius: 16px; padding: 14px 16px; cursor: pointer; color: #fff;
}
.pd-locked-top { font-weight: 700; font-size: 14px; }
.pd-locked-sub { font-size: 12px; opacity: .85; margin-top: 3px; }

/* Detalj osobe: galerija/video/audio (premium) */
.pd-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pd-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 12px; cursor: pointer; }
.pd-video { width: 100%; border-radius: 14px; margin-top: 10px; background: #000; }
.pd-audio { width: 100%; margin-top: 10px; }

/* Lightbox za slike */
.lightbox {
  position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* Admin: mediji */
.af-media-wrap { margin-top: 6px; }
.af-media-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.af-media-item { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--bg-1); box-shadow: var(--shadow); }
.af-media-item img { width: 100%; height: 100%; object-fit: cover; }
.af-media-ico { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.af-media-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 1;
}
.af-media-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Pregled medija u chatu (overlay) */
.media-viewer {
  position: fixed; inset: 0; z-index: 9997; background: rgba(20,10,30,.88);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.media-viewer-inner {
  position: relative; width: 100%; max-width: 520px; max-height: 86dvh; overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 44px 16px 16px;
}
.media-viewer-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none; cursor: pointer;
  color: var(--magenta); font-size: 28px; line-height: 1;
}
.media-viewer-body .mv-empty { text-align: center; color: var(--text-muted); padding: 24px 10px; }
.mv-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mv-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 12px; cursor: pointer; }
.mv-video { width: 100%; border-radius: 14px; margin-bottom: 10px; background: #000; }
.mv-audio { width: 100%; margin-bottom: 10px; }

/* Lokot s tekstom u composeru (nepremium) */
#composer-lock-menu button { width: auto; padding: 0 14px; gap: 7px; border-radius: 19px; white-space: nowrap; }
#composer-lock-menu span { font-size: 13px; font-weight: 700; color: var(--magenta); }

/* Cloudflare Turnstile widget: puna širina (kao polja), obični rubovi */
.cf-widget { display: block; width: 100%; margin: 4px 0 14px; }
.cf-widget:empty { margin: 0; }
.cf-widget iframe { width: 100% !important; }

/* ===================== PREKIDAČ (tamni način) ===================== */
.dark-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.dark-toggle > span:first-child { font-weight: 600; color: var(--heading); }
.dark-toggle input { display: none; }
.dark-slider { width: 48px; height: 27px; background: #cdc6d8; border-radius: 20px; position: relative; transition: background .2s; flex-shrink: 0; }
.dark-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.dark-toggle input:checked + .dark-slider { background: var(--magenta); }
.dark-toggle input:checked + .dark-slider::after { transform: translateX(21px); }

/* ===================== TAMNI NAČIN (dark mode) ===================== */
.dark {
  --bg-1: #241c33; --bg-2: #1a1426;
  --heading: #ece8f5; --text-dark: #e8e4f0; --text-muted: #948aa8;
  --card: rgba(255,255,255,0.06);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}
.dark body { background: #100b18; }
.dark .phone { background: linear-gradient(180deg, #241c33 0%, #17111f 60%, #100b18 100%); }
.dark input, .dark .composer input,
.dark .field textarea, .dark .field select { background: rgba(255,255,255,.08); color: var(--text-dark); }
.dark input::placeholder, .dark textarea::placeholder { color: #857b9a; }
.dark .msg.user { background: #2c2542; color: var(--text-dark); }
.dark .composer { background: rgba(255,255,255,.04); }
.dark .chat-header { background: transparent; }
.dark .pd-back { background: rgba(0,0,0,.4); color: #fff; }
.dark .menu-card { background: #241c33; }
.dark .modal-card { background: linear-gradient(160deg, #241c33, #1a1426); }
.dark .notif-panel { background: #241c33; color: var(--text-dark); }
.dark .notif-item:hover { background: rgba(255,255,255,.06); }
.dark .media-viewer-inner { background: #241c33; }
.dark .price-card p { color: #b9b2c9; }
.dark .composer-media-menu button { background: rgba(255,255,255,.08); }
.dark .composer-media-menu button:hover { background: rgba(255,255,255,.14); }
.dark #composer-lock-menu span { color: var(--magenta-2); }
.dark .sidebar { background: rgba(255,255,255,.04); border-right-color: rgba(255,255,255,.06); }
.dark .sidebar-persona.active { background: rgba(255,255,255,.12); }

/* Profil: lista razgovora + opasna zona */
.pr-convos { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pr-convo { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-1); border-radius: 12px; padding: 10px 14px; }
.pr-convo span { color: var(--text-dark); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-convo-del { background: none; border: none; cursor: pointer; color: #d9534f; font-size: 15px; padding: 4px 6px; flex-shrink: 0; }
.dark .pr-convo { background: rgba(255,255,255,.06); }
.section-h.danger-h { color: #d9534f; }

/* Cijena: "/mj" sitni dodatak */
.price-per { font-size: 15px; font-weight: 500; color: var(--text-muted); }

/* Profil: progress bar preostalih riječi */
.words-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; color: var(--text-dark); margin-bottom: 7px; }
.words-head b { color: var(--heading); font-weight: 700; white-space: nowrap; }
.words-track { height: 10px; border-radius: 20px; background: rgba(120,80,140,.14); overflow: hidden; }
.words-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--magenta), var(--purple-1)); transition: width .35s ease; }
.words-fill.low { background: linear-gradient(90deg, #e0559f, #d9534f); }
.words-note { font-size: 12px; color: #d9534f; margin-top: 7px; line-height: 1.4; }
.words-unl { font-weight: 600; color: var(--magenta); }
.dark .words-track { background: rgba(255,255,255,.09); }

/* X gumb na uvećanoj slici (lightbox) */
.lightbox-close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.5); color: #fff; font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(0,0,0,.7); }

/* Desktop: stranica osobe = centrirani prozor koji prekrije sve (ne uz chat) */
@media (min-width: 900px) {
  #screen-persona {
    background: rgba(28,18,42,.72);
    align-items: center; justify-content: center; padding: 24px; z-index: 50;
  }
  #screen-persona .pd-hero {
    flex: 0 1 auto; width: 100%; max-width: 420px; height: 86dvh;
    border-radius: 24px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.45);
  }
}
