@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --purple:     #6C5CE7;
    --purple-d:   #5849C2;
    --purple-l:   #EDE9FF;
    --purple-ll:  #F5F3FF;
    --purple-mid: #8B5CF6;
    --accent:     #E94560;
    --accent-l:   #FFF0F3;
    --text:       #1a1a2e;
    --text2:      #334155;
    --text3:      #64748B;
    --text4:      #94A3B8;
    --bg:         #F7F6FF;
    --surface:    #FFFFFF;
    --border:     #E8E5FF;
    --border2:    #D4CFFF;
    --green:      #059669;
    --green-l:    #DCFCE7;
    --yellow:     #F59E0B;
    --yellow-l:   #FEF3C7;
    --radius:     12px;
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   HEADER
   ============================================================ */
.pwa-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2266 60%, var(--purple) 100%);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 12px rgba(108,92,231,.3);
}
.header-inner {
    max-width: 600px; margin: 0 auto;
    padding: 0 1rem; height: 58px;
    display: flex; align-items: center; justify-content: space-between;
}
.logo-wrap { display: flex; align-items: center; gap: .6rem; }
.logo-mark {
    width: 32px; height: 32px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Sora', sans-serif; font-size: .65rem; font-weight: 800; color: #fff;
    backdrop-filter: blur(8px);
}
.logo-text { font-family: 'Sora', sans-serif; font-size: 1rem; font-weight: 400; color: rgba(255,255,255,.8); }
.logo-text strong { color: #fff; font-weight: 800; }
.logo-text em { font-style: normal; color: #c4b5fd; }

.icon-btn {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 9px; width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: rgba(255,255,255,.85);
    transition: all .15s; backdrop-filter: blur(8px);
}
.icon-btn:hover { background: rgba(255,255,255,.22); }

/* ============================================================
   MAIN
   ============================================================ */
.pwa-main { max-width: 600px; margin: 0 auto; padding: 0 0 100px; }

/* ============================================================
   ZERO STATE
   ============================================================ */
.zero-state {
    text-align: center;
    padding: 4.5rem 2rem 3rem;
    display: flex; flex-direction: column; align-items: center;
}
.zero-icon-wrap {
    width: 88px; height: 88px;
    background: var(--purple-l);
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(108,92,231,.2);
}
.zero-icon-wrap svg { width: 40px; height: 40px; stroke: var(--purple); }
.zero-state h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.25rem; font-weight: 800;
    color: var(--text); margin-bottom: .6rem;
}
.zero-state p {
    font-size: .9rem; color: var(--text3);
    line-height: 1.7; max-width: 260px; margin: 0 auto 1.5rem;
}
.zero-steps {
    display: flex; flex-direction: column; gap: 10px;
    width: 100%; max-width: 300px; margin: 0 auto 1.75rem;
    text-align: left;
}
.zero-step {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 10px 14px;
}
.zero-step-num {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--purple-l); color: var(--purple);
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zero-step-text { font-size: 13px; color: var(--text2); font-weight: 500; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex; gap: .4rem; overflow-x: auto;
    padding: .85rem 1rem .65rem;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    position: sticky; top: 58px; z-index: 10;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.filter-bar::-webkit-scrollbar { display: none; }
.pill {
    flex-shrink: 0; padding: .38rem .9rem; border-radius: 20px;
    border: 1.5px solid var(--border2);
    background: var(--surface);
    font-size: .8rem; font-weight: 600; cursor: pointer;
    font-family: inherit; color: var(--text3);
    transition: all .15s; white-space: nowrap;
}
.pill:hover:not(.active) { border-color: var(--purple); color: var(--purple); }
.pill.active {
    background: var(--purple); border-color: var(--purple); color: #fff;
    box-shadow: 0 2px 8px rgba(108,92,231,.3);
}

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton-post {
    margin: .75rem 1rem; height: 140px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; position: relative;
}
.skeleton-post::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(108,92,231,.05) 50%, transparent 100%);
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================================================
   POST CARD
   ============================================================ */
.post-card {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    transition: background .1s;
}
.post-card:active { background: var(--purple-ll); }

.post-biz-row { display: flex; align-items: center; gap: .65rem; margin-bottom: .75rem; }
.post-biz-logo { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.post-biz-logo-init {
    width: 38px; height: 38px; border-radius: 9px;
    background: linear-gradient(135deg, var(--purple), var(--purple-mid));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Sora', sans-serif; font-size: .85rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.post-biz-info { flex: 1; min-width: 0; }
.post-biz-name { font-size: .88rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-biz-type { font-size: .75rem; color: var(--text4); }
.post-time { font-size: .72rem; color: var(--text4); flex-shrink: 0; }

.post-badge {
    display: inline-flex; align-items: center;
    padding: .15rem .6rem; border-radius: 20px;
    font-size: .7rem; font-weight: 700; margin-bottom: .5rem;
    text-transform: uppercase; letter-spacing: .03em;
}
.badge-blue   { background: #EEF2FF;   color: #4F46E5; }
.badge-yellow { background: var(--yellow-l); color: #92400E; }
.badge-green  { background: var(--green-l);  color: #065F46; }
.badge-red    { background: var(--accent-l); color: var(--accent); }
.badge-purple { background: var(--purple-l); color: var(--purple); }
.badge-gray   { background: #F1F5F9; color: var(--text3); }

.post-title { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
.post-text  { font-size: .875rem; color: var(--text2); line-height: 1.65; white-space: pre-line; }
.post-img   { margin: .75rem 0; border-radius: 10px; overflow: hidden; }
.post-img img { width: 100%; max-height: 300px; object-fit: cover; }

.post-coupon {
    background: var(--accent-l); border: 1.5px dashed var(--accent);
    border-radius: 10px; padding: .85rem 1rem; margin: .75rem 0;
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.post-coupon-label { font-size: .65rem; font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .2rem; }
.post-coupon-code { font-family: monospace; font-size: 1.1rem; font-weight: 800; color: var(--accent); letter-spacing: .1em; }
.post-coupon-disc { font-size: .75rem; color: var(--text3); margin-top: .15rem; }

.post-event-date { font-size: .82rem; color: var(--text3); margin-top: .5rem; }
.post-link {
    display: inline-flex; align-items: center; gap: .3rem;
    margin-top: .6rem; font-size: .83rem; font-weight: 600; color: var(--purple);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem 1.4rem; border-radius: 10px;
    font-size: .88rem; font-weight: 700; cursor: pointer;
    border: none; font-family: inherit; transition: all .15s; text-decoration: none;
}
.btn-primary {
    background: var(--purple); color: #fff;
    box-shadow: 0 4px 14px rgba(108,92,231,.35);
}
.btn-primary:hover { background: var(--purple-d); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text3); border: 1.5px solid var(--border2); }
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg { padding: .9rem 1.75rem; font-size: .95rem; }
.btn-full { width: 100%; }
.mt1 { margin-top: .5rem; display: flex; }
.mt2 { margin-top: 1rem; display: flex; }

/* ============================================================
   FOLLOW PAGE (zaprati.html)
   ============================================================ */
.follow-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1.25rem;
}
.follow-state { width: 100%; max-width: 360px; text-align: center; }

.biz-follow-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 20px; padding: 2rem 1.5rem;
    box-shadow: 0 8px 32px rgba(108,92,231,.1);
}
.biz-avatar-lg {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--purple-mid));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Sora', sans-serif; font-size: 1.8rem; font-weight: 800; color: #fff;
    margin: 0 auto 1rem; overflow: hidden;
    border: 3px solid var(--purple-l);
}
.biz-follow-card h1 {
    font-family: 'Sora', sans-serif; font-size: 1.35rem; font-weight: 800;
    color: var(--text); margin-bottom: .3rem;
}
.biz-type-label { font-size: .82rem; color: var(--text3); margin-bottom: .5rem; }
.biz-desc { font-size: .88rem; color: var(--text3); line-height: 1.6; margin-bottom: 1rem; }
.biz-follow-stats {
    display: flex; justify-content: center; gap: 1rem;
    margin-bottom: 1.25rem;
}
.biz-follow-stats span {
    font-size: .82rem; color: var(--text3);
    background: var(--purple-ll); padding: .25rem .75rem;
    border-radius: 20px; border: 1px solid var(--border);
}

.follow-check { font-size: 3rem; margin-bottom: 1rem; }
.follow-err   { font-size: 3rem; margin-bottom: 1rem; }
.follow-state h2 {
    font-family: 'Sora', sans-serif; font-size: 1.2rem; font-weight: 800;
    color: var(--text); margin-bottom: .5rem;
}
.follow-sub { font-size: .88rem; color: var(--text3); line-height: 1.6; }

.push-prompt {
    background: var(--purple-ll); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem; margin: 1rem 0;
    display: flex; align-items: center; gap: .85rem; text-align: left;
}
.push-prompt-ico { font-size: 1.5rem; flex-shrink: 0; }
.push-prompt-text { flex: 1; }
.push-prompt-text strong { font-size: .88rem; display: block; margin-bottom: .2rem; color: var(--purple); }
.push-prompt-text p { font-size: .78rem; color: var(--text3); }

/* ============================================================
   DRAWER
   ============================================================ */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(26,26,46,.6);
    backdrop-filter: blur(4px);
    z-index: 200; display: flex; justify-content: flex-end;
}
.drawer {
    background: var(--surface); width: 300px; max-width: 90vw;
    height: 100%; display: flex; flex-direction: column;
    box-shadow: -4px 0 32px rgba(108,92,231,.15);
}
.drawer-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #1a1a2e, #2d2266);
}
.drawer-header h3 {
    font-family: 'Sora', sans-serif; font-size: 1rem; font-weight: 800; color: #fff;
}
.drawer-header .icon-btn { color: rgba(255,255,255,.8); }
.following-list { flex: 1; overflow-y: auto; }
.following-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .75rem 1.25rem; border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.following-item:hover { background: var(--purple-ll); }
.following-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.following-logo-init {
    width: 36px; height: 36px; border-radius: 8px;
    background: linear-gradient(135deg, var(--purple), var(--purple-mid));
    display: flex; align-items: center; justify-content: center;
    font-family: 'Sora', sans-serif; font-size: .8rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.following-info { flex: 1; min-width: 0; }
.following-name { font-size: .88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.following-type { font-size: .75rem; color: var(--text4); }
.drawer-footer { padding: 1.25rem; border-top: 1px solid var(--border); text-align: center; }
.drawer-hint { font-size: .8rem; color: var(--text4); margin-bottom: .5rem; }

/* ============================================================
   LOAD MORE
   ============================================================ */
.load-more {
    display: block; width: calc(100% - 2rem); margin: 1rem;
    border-color: var(--border2); color: var(--purple);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%);
    background: var(--purple); color: #fff;
    padding: .65rem 1.4rem; border-radius: 20px;
    font-size: .85rem; font-weight: 600; z-index: 500;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(108,92,231,.4);
}

/* ============================================================
   INSTALL BAR
   ============================================================ */
.install-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: linear-gradient(135deg, #1a1a2e, #2d2266);
    color: rgba(255,255,255,.8);
    padding: .9rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    font-size: .83rem; z-index: 300;
    box-shadow: 0 -4px 20px rgba(108,92,231,.3);
    border-top: 1px solid rgba(108,92,231,.3);
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin .8s linear infinite; margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   BOTTOM NAV (opcionalno za buduće)
   ============================================================ */
.pwa-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex; align-items: stretch;
    z-index: 200;
}
.pwa-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    font-size: 10px; font-weight: 600; color: var(--text4);
    cursor: pointer; transition: color .15s;
}
.pwa-nav-item.active { color: var(--purple); }
.pwa-nav-item svg { width: 20px; height: 20px; }
