/* assets/css/blog.css - Svetao, moderan dizajn za EngineeringCaffe Blog & Alate */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-cyan: #0284c7;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 35px -10px rgba(37, 99, 235, 0.12);
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
}

code, pre, .mono {
    font-family: 'JetBrains Mono', monospace;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* --- DVOREDNO ZAGLAVLJE (BEZ GURANJA DUGMIĆA) --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* Red 1: Logo + Pretraga + Korisnicki/Admin dugmici */
.header-topbar {
    max-width: 1360px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-logo span {
    color: var(--accent-blue);
}

.header-search {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 3px 6px 3px 12px;
}

.header-search:focus-within {
    border-color: var(--accent-blue);
    background: #fff;
}

.header-search input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13.5px;
    color: var(--text-primary);
    padding: 6px 0;
}

.header-search button {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* Grupa dugmica desno - uvek u jednom redu i iste visine */
.header-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-btn-outline {
    background: #ffffff;
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.nav-btn-outline:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: #f8fafc;
}

.nav-btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
}

.nav-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}

.nav-btn-admin {
    background: #fef3c7;
    border-color: #fde68a;
    color: #b45309;
}

.nav-btn-admin:hover {
    background: #fde68a;
    color: #92400e;
}

.nav-btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.nav-btn-danger:hover {
    background: #fee2e2;
}

/* Red 2: Čista traka sa kategorijama menija */
.header-menubar {
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
}

.menubar-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    height: 46px;
    scrollbar-width: none;
}

.menubar-inner::-webkit-scrollbar {
    display: none;
}

.menu-item {
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.menu-item:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.menu-item.active {
    background: var(--accent-blue);
    color: #ffffff;
}

.menu-item-highlight {
    margin-left: auto;
    color: var(--accent-blue);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

/* --- HERO SEKCIJA --- */
.hero-section {
    background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 45%),
                radial-gradient(circle at 90% 30%, rgba(2, 132, 199, 0.06) 0%, transparent 45%),
                #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 44px 24px;
}

.hero-grid {
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 36px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--accent-blue);
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(28px, 3.6vw, 42px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.8px;
    margin-bottom: 14px;
}

.hero-title span {
    color: var(--accent-blue);
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 22px;
    max-width: 600px;
}

.platform-box {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-md);
}

.platform-modules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0 18px;
}

.platform-mod-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px;
}

.platform-mod-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.platform-mod-card h4 {
    font-size: 13.5px;
    font-weight: 800;
    margin-bottom: 3px;
}

.platform-mod-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- GLAVNI KONTEJNER --- */
.page-container {
    max-width: 1360px;
    margin: 30px auto 60px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

/* --- SEKCIJA ZA BESPLATNE ALATE --- */
.tools-section-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

.tool-tabs-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin: 16px 0 20px;
    border-bottom: 1px solid var(--border-light);
}

.tool-tab-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-tab-btn:hover,
.tool-tab-btn.active {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

.tool-module-pane {
    display: none;
}

.tool-module-pane.active {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
    align-items: center;
}

.calc-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.calc-input-group label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.calc-input-group input,
.calc-input-group select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-main);
    color: var(--text-primary);
}

.calc-output-card {
    background: linear-gradient(145deg, #eff6ff, #f0f9ff);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 18px 20px;
}

.calc-res-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px dashed #cbd5e1;
}

.calc-res-item:last-child {
    border-bottom: none;
}

.calc-res-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.calc-res-value {
    font-size: 19px;
    font-weight: 800;
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
}

/* --- BLOG KARTICE I ČLANAK --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

.article-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: all 0.22s ease;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.article-thumb {
    height: 165px;
    background: linear-gradient(135deg, #e0f2fe, #eff6ff, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    position: relative;
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.94);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-blue);
    border: 1px solid var(--border-light);
}

.article-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-body h3 {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 8px;
}

.article-body h3 a:hover {
    color: var(--accent-blue);
}

.article-body p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    flex: 1;
}

.article-footer {
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Pojedinacni post */
.single-post-box {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 34px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.single-post-box h1 {
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    margin: 12px 0 18px;
    line-height: 1.22;
}

.post-rich-content h2 { font-size: 22px; margin: 24px 0 10px; }
.post-rich-content h3 { font-size: 18px; margin: 18px 0 8px; }
.post-rich-content p { margin-bottom: 14px; color: var(--text-secondary); }
.post-rich-content ul, .post-rich-content ol { margin: 0 0 16px 20px; color: var(--text-secondary); }
.post-rich-content code {
    background: var(--bg-subtle);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--accent-blue);
    font-size: 13.5px;
}

/* Sidebar */
.side-widget {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.side-widget h3 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.side-list-item {
    padding: 9px 0;
    border-bottom: 1px solid var(--border-light);
}

.side-list-item:last-child {
    border-bottom: none;
}

/* Cookie Banner & Footer */
#cookie-consent-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 920px;
    background: #0f172a;
    color: #f8fafc;
    padding: 16px 22px;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    z-index: 9999;
}

.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    padding: 32px 24px;
    color: var(--text-muted);
    font-size: 13.5px;
}

@media (max-width: 992px) {
    .header-topbar {
        flex-wrap: wrap;
    }
    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .hero-grid,
    .page-container,
    .tool-module-pane.active {
        grid-template-columns: 1fr;
    }
}