/* pwa/css/pwa.css - azurirana verzija sa link dugmetom */
:root {
  --bg:       #080d18;
  --bg2:      #0f1624;
  --bg3:      #18213a;
  --border:   rgba(255,255,255,0.07);
  --text:     #eef1f9;
  --text2:    #7e93bb;
  --text3:    #3d4f72;
  --accent:   #e8a248;
  --accent2:  #c47f28;
  --pill-bg:  rgba(232,162,72,0.12);
  --radius:   14px;
  --font-d:   'Fraunces', Georgia, serif;
  --font-b:   'DM Sans', sans-serif;
  --ease:     0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-b);
  line-height: 1.6; min-height: 100vh; overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 30% 0%, rgba(232,162,72,0.05) 0%, transparent 55%);
}

/* HEADER */
.pwa-header { position: sticky; top: 0; z-index: 50; background: rgba(8,13,24,0.9); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 680px; margin: 0 auto; padding: 0 1rem; height: 58px; display: flex; align-items: center; justify-content: space-between; }
.logo-text { font-family: var(--font-d); font-size: 1.3rem; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }
.icon-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--ease); font-size: 0.9rem; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* MAIN */
.pwa-main { max-width: 680px; margin: 0 auto; padding: 1.25rem 1rem 5rem; position: relative; z-index: 1; }

/* ZERO STATE */
.zero-state { text-align: center; padding: 5rem 1rem 3rem; }
.zero-icon  { font-size: 3.5rem; margin-bottom: 1rem; }
.zero-state h2 { font-family: var(--font-d); font-size: 1.5rem; margin-bottom: 0.5rem; }
.zero-state p  { color: var(--text2); font-size: 0.95rem; margin-bottom: 1.5rem; }

/* FILTER BAR */
.filter-bar { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1.25rem; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.pill { flex-shrink: 0; padding: 0.3rem 0.9rem; border-radius: 100px; font-size: 0.8rem; font-weight: 500; cursor: pointer; background: var(--bg3); color: var(--text2); border: 1px solid var(--border); transition: all var(--ease); }
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active { background: var(--pill-bg); color: var(--accent); border-color: rgba(232,162,72,0.3); }

/* SKELETON */
.skeleton-post { height: 120px; background: var(--bg2); border-radius: var(--radius); margin-bottom: 0.75rem; border: 1px solid var(--border); animation: shimmer 1.6s ease infinite; }
@keyframes shimmer { 0%,100%{opacity:.4} 50%{opacity:.8} }

/* POST CARD */
.post-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 0.75rem; position: relative;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
  animation: fadeUp 0.3s ease both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.post-card:hover { background: var(--bg3); border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }

.post-biz-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.post-biz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.post-biz-name { font-size: 0.78rem; font-weight: 500; color: var(--accent); }
.post-date { font-size: 0.75rem; color: var(--text3); margin-left: auto; }
.post-title { font-family: var(--font-d); font-size: 1.05rem; font-weight: 600; line-height: 1.3; color: var(--text); margin-bottom: 0.5rem; }
.post-body { font-size: 0.88rem; color: var(--text2); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-img { width: 100%; border-radius: 10px; margin-top: 0.85rem; max-height: 220px; object-fit: cover; }

/* LINK DUGME */
.post-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding: 0.45rem 1rem;
  background: rgba(232,162,72,0.1);
  border: 1px solid rgba(232,162,72,0.25);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--ease);
  width: fit-content;
}
.post-link-btn:hover {
  background: rgba(232,162,72,0.2);
  border-color: rgba(232,162,72,0.5);
  transform: translateX(2px);
}
.post-link-btn svg { flex-shrink: 0; transition: transform var(--ease); }
.post-link-btn:hover svg { transform: translate(2px, -2px); }

/* LOAD MORE */
.load-more { display: block; width: 100%; margin-top: 1rem; justify-content: center; }

/* DRAWER */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 200; animation: fadeIn 0.2s ease; }
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(320px, 90vw); background: var(--bg2); border-left: 1px solid var(--border); display: flex; flex-direction: column; animation: slideLeft 0.25s cubic-bezier(0.34,1.2,0.64,1); }
@keyframes slideLeft{from{transform:translateX(60px);opacity:0}to{transform:none;opacity:1}}
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem; border-bottom: 1px solid var(--border); }
.drawer-header h3 { font-family: var(--font-d); font-size: 1.1rem; }
.following-list { flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.follow-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); }
.follow-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #000; font-family: var(--font-d); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.follow-name { font-size: 0.875rem; font-weight: 500; flex: 1; }
.unfollow-btn { background: transparent; border: 1px solid var(--border); color: var(--text3); border-radius: 6px; padding: 0.2rem 0.5rem; font-size: 0.72rem; cursor: pointer; transition: all var(--ease); }
.unfollow-btn:hover { border-color: #ef4444; color: #fca5a5; }
.drawer-footer { padding: 1rem; border-top: 1px solid var(--border); }
.drawer-hint { font-size: 0.8rem; color: var(--text3); text-align: center; }

/* FOLLOW PAGE */
.follow-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.follow-state { text-align: center; max-width: 380px; width: 100%; }
.biz-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 24px; padding: 2.5rem 2rem; }
.biz-avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #000; font-family: var(--font-d); font-weight: 700; font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem; }
.biz-card h1 { font-family: var(--font-d); font-size: 1.6rem; margin-bottom: 0.5rem; }
.biz-desc { color: var(--text2); font-size: 0.9rem; margin-bottom: 1.5rem; }
.follow-check { font-size: 3rem; color: #22c55e; margin-bottom: 1rem; }
.follow-err   { font-size: 3rem; color: #ef4444; margin-bottom: 1rem; }
.follow-sub   { color: var(--text2); font-size: 0.95rem; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); margin: 0 auto 1rem; animation: spin 0.8s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.2rem; border-radius: 10px; font-family: var(--font-b); font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none; outline: none; transition: all var(--ease); white-space: nowrap; }
.btn:active{transform:scale(0.97)}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent2); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.mt1 { margin-top: 0.75rem; }
.mt2 { margin-top: 1.25rem; }

/* TOAST */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(16px); background: #1e2d4a; border: 1px solid var(--border); color: var(--text); padding: 0.7rem 1.2rem; border-radius: 10px; font-size: 0.875rem; z-index: 300; box-shadow: 0 8px 32px rgba(0,0,0,0.5); pointer-events: none; opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok  { border-color: rgba(34,197,94,0.4); color: #86efac; }
.toast.err { border-color: rgba(239,68,68,0.4); color: #fca5a5; }

/* INSTALL BAR */
.install-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg2); border-top: 1px solid var(--border); padding: 0.85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; z-index: 100; font-size: 0.875rem; color: var(--text2); animation: slideUp 0.3s ease; }
@keyframes slideUp{from{transform:translateY(100%)}to{transform:none}}

/* BROWSER WARNING */
.browser-warn { background: #92400e; color: #fef3c7; padding: 0.6rem 1rem; font-size: 0.8rem; display: none; align-items: center; justify-content: space-between; gap: 1rem; }
.browser-warn button { background: none; border: none; color: #fef3c7; cursor: pointer; font-size: 1rem; flex-shrink: 0; }

.hidden { display: none !important; }
