/* Trending Srbija - stilovi (v2) */

:root {
    --bg: #f6f5f9;
    --surface: #ffffff;
    --surface-alt: #fbfaff;
    --text: #16151f;
    --text-muted: #6d6c85;
    --text-faint: #9695ab;
    --border: #e9e7f3;
    --border-soft: #f1effa;

    --primary: #ff5a45;
    --primary-dark: #e2432f;
    --primary-soft: #ffece8;
    --accent: #3a2fd6;
    --accent-soft: #edebff;

    --success: #16a34a;
    --success-bg: #e9f9ef;
    --error: #dc2626;
    --error-bg: #fdecec;
    --warning-text: #92620a;
    --warning-bg: #fff3dd;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(22, 21, 31, 0.05);
    --shadow: 0 6px 20px -4px rgba(22, 21, 31, 0.10);
    --shadow-lg: 0 16px 40px -12px rgba(22, 21, 31, 0.18);

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { letter-spacing: -0.02em; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    flex-wrap: wrap;
}
.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.03em;
}
.logo span {
    background: linear-gradient(90deg, var(--primary), #ff8a3d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.header-search {
    display: flex;
    flex: 1;
    min-width: 260px;
    gap: 0;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
}
.header-search input[type="text"] {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 0.92rem;
    color: var(--text);
    min-width: 0;
}
.header-search input[type="text"]:focus { outline: none; }
.header-search select {
    padding: 8px 10px;
    border: none;
    border-left: 1px solid var(--border);
    font-size: 0.85rem;
    background: transparent;
    max-width: 130px;
    color: var(--text-muted);
}
.header-search select:focus { outline: none; }
.header-search button {
    padding: 8px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    transition: background 0.15s ease, transform 0.1s ease;
}
.header-search button:hover { background: var(--primary-dark); }
.header-search button:active { transform: scale(0.97); }
.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    white-space: nowrap;
}
.main-nav a { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }
.main-nav a:hover { color: var(--text); text-decoration: none; }
.btn-nav {
    background: var(--text);
    color: white !important;
    padding: 9px 18px;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 0.85rem !important;
    transition: background 0.15s ease;
}
.btn-nav:hover { background: var(--primary-dark); }

/* ============================================================
   Flash messages
   ============================================================ */
.flash {
    margin: 18px 0;
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
}
.flash-uspeh { background: var(--success-bg); color: var(--success); }
.flash-greska { background: var(--error-bg); color: var(--error); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
    padding: 56px 0 32px;
    text-align: center;
    position: relative;
}
.hero::before {
    content: "";
    position: absolute;
    inset: -20px 10% auto 10%;
    height: 220px;
    background: radial-gradient(ellipse at center, var(--primary-soft) 0%, transparent 70%);
    z-index: -1;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.hero h1 {
    font-size: 2.6rem;
    margin: 0 0 10px;
    font-weight: 800;
    line-height: 1.15;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.08rem;
    max-width: 560px;
    margin: 0 auto;
}

/* ============================================================
   Section headings
   ============================================================ */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 44px 0 20px;
    font-size: 1.4rem;
    font-weight: 800;
}
.section-title .fire { font-size: 1.05em; }
.section-sub {
    color: var(--text-muted);
    margin-top: -12px;
    margin-bottom: 22px;
    font-size: 0.94rem;
}

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.filter-bar select, .filter-bar input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--surface-alt);
    color: var(--text);
}
.filter-bar input { flex: 1; min-width: 160px; }
.filter-bar button {
    padding: 10px 22px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.filter-bar button:hover { background: var(--primary-dark); }

/* ============================================================
   Trending — two-column ranked list (homepage)
   ============================================================ */
.trending-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 28px;
    margin-bottom: 20px;
}
.trending-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.trending-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border);
    text-decoration: none;
}
.trending-rank {
    flex: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.92rem;
}
.trending-row:nth-child(-n+3) .trending-rank {
    background: linear-gradient(135deg, var(--primary), #ff8a3d);
    color: white;
}
.trending-body { flex: 1; min-width: 0; }
.trending-body .t-title {
    font-weight: 700;
    color: var(--text);
    font-size: 0.97rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trending-body .t-meta {
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-top: 2px;
}
.trending-extra {
    flex: none;
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-faint);
}
.trending-extra .flame { color: var(--primary); }

.trending-row-google:hover { border-color: var(--accent); }
.t-google-badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    margin-right: 4px;
}

/* ============================================================
   Listing grid (search results, standard cards)
   ============================================================ */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}
.listing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.listing-card .badge-trending {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, var(--primary), #ff8a3d);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
}
.listing-card .badge-sponsored {
    display: inline-block;
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}
.listing-card h3 { margin: 4px 0 0; font-size: 1.08rem; font-weight: 700; }
.listing-card .meta { color: var(--text-faint); font-size: 0.82rem; }
.listing-card .desc { font-size: 0.9rem; color: var(--text-muted); flex-grow: 1; }
.listing-card .price { font-weight: 800; color: var(--accent); }
.listing-card .card-link { margin-top: auto; font-weight: 700; font-size: 0.88rem; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ============================================================
   Search results — split layout (organic left / sponsored right)
   ============================================================ */
.search-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}
.search-main .col-heading,
.search-side .col-heading {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-main .listing-grid { grid-template-columns: 1fr 1fr; }

.google-results { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.google-result {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.google-result:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.google-result .gr-thumb {
    display: block;
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-alt);
    border: 1px solid var(--border);
}
.google-result .gr-body { min-width: 0; }
.google-result .gr-source {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: lowercase;
}
.google-result h3 { margin: 3px 0 4px; font-size: 1rem; font-weight: 700; color: var(--text); }
.google-result .gr-snippet { font-size: 0.87rem; color: var(--text-muted); }
.google-hint {
    padding: 16px 18px;
    background: var(--surface-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-faint);
    font-size: 0.88rem;
    margin-bottom: 8px;
}
.search-side {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 90px;
}
.sponsor-list { display: flex; flex-direction: column; gap: 12px; }
.sponsor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.sponsor-card .sp-thumb {
    display: block;
    width: calc(100% + 28px);
    height: 80px;
    margin: -14px -14px 10px;
    object-fit: cover;
    background: var(--surface-alt);
}
.sponsor-card .sp-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 800;
    font-size: 1.6rem;
}
.sponsor-card .sp-rank {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sponsor-card h4 {
    margin: 4px 0 0;
    font-size: 0.96rem;
    font-weight: 700;
}
.sponsor-card .meta { color: var(--text-faint); font-size: 0.8rem; }
.sponsor-card .desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }
.sponsor-card .contact { margin-top: 8px; font-size: 0.82rem; color: var(--text-muted); }
.sponsor-empty {
    text-align: center;
    padding: 30px 14px;
    color: var(--text-faint);
    font-size: 0.88rem;
}
.sponsor-cta {
    display: block;
    text-align: center;
    margin-top: 14px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
}
.sponsor-cta:hover { text-decoration: none; background: #e0dcff; }

/* ============================================================
   Forms
   ============================================================ */
.form-card {
    max-width: 520px;
    margin: 36px auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}
.form-card.wide { max-width: 720px; }
.form-card h1 { margin-top: 0; font-size: 1.5rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.88rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
    font-family: inherit;
    background: var(--surface-alt);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.82rem; color: var(--text-faint); margin-top: 4px; }
.form-actions { margin-top: 22px; }
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-secondary { background: var(--accent); }
.btn-secondary:hover { background: #2e25ac; }
.btn-outline { background: transparent; color: var(--primary-dark); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-small { padding: 7px 14px; font-size: 0.8rem; }
.btn-danger { background: var(--error); }
.btn-danger:hover { background: #b91c1c; }

/* ============================================================
   Tables (dashboard / admin)
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.data-table th, .data-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.88rem;
}
.data-table th { background: var(--surface-alt); font-weight: 700; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-alt); }

.status-pill {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}
.status-na_cekanju, .status-nije_placeno { background: var(--warning-bg); color: var(--warning-text); }
.status-aktivan, .status-aktivna, .status-odobren, .status-placeno { background: var(--success-bg); color: var(--success); }
.status-blokiran, .status-blokirana, .status-odbijen, .status-istekao { background: var(--error-bg); color: var(--error); }

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 32px 0 20px;
}
.dashboard-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.dashboard-tabs a {
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.86rem;
}
.dashboard-tabs a:hover { text-decoration: none; border-color: var(--text-muted); }
.dashboard-tabs a.active { background: var(--text); color: white; border-color: var(--text); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 22px 0; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-card .num { font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.stat-card .label { color: var(--text-faint); font-size: 0.83rem; margin-top: 2px; }

.detail-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    margin: 26px 0;
}
.detail-box .meta-row { color: var(--text-faint); margin-bottom: 14px; font-size: 0.9rem; }
.detail-box .price-tag { font-size: 1.5rem; font-weight: 800; color: var(--accent); margin: 10px 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    margin-top: 60px;
    padding: 28px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-faint);
    font-size: 0.86rem;
}
.footer-links a { color: var(--text-faint); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
    .search-layout { grid-template-columns: 1fr; }
    .search-side { position: static; }
    .search-main .listing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .main-nav { justify-content: center; }
    .trending-columns { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .google-result .gr-thumb { width: 80px; height: 60px; }
}
