/* ip-adresse.ch · raspored kao root.hr (kutije, widgeti, matrix zaglavlje), podnožje kao vojs.eu,
   naglasci u švicarskoj crvenoj (#da291c, Pantone 485) umjesto root.hr narančaste */
:root {
    --brand: #da291c;
    --brand-hover: #b8211a;
    --bg: #edeceb;
    --content: #fff;
    --row: #f1efec;
    --row-alt: #e6e4e0;
    --dark: #1c1c1c;
    --dark-2: #282828;
    --text: #282828;
    --text-2: #424242;
    --muted: #838383;
    --title: #4a4a4a;
    --on-dark: #ccc;
    --border: #d7d5d1;
    --border-2: #b9afa0;
    --btn: #f7f6f5;
    --btn-hover: #fff;
    --surface: #fff;
    --green: #4baf4f;
    --blue: #3597da;
    --side: 380px;
    --gap: 16px;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-y: scroll; }
body {
    margin: 0;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand); color: #fff; }

.container { width: 100%; max-width: 1270px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* ---------- Gumbi ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 6px 12px;
    font-size: 13px; font-weight: 700; line-height: 1.4; white-space: nowrap;
    color: var(--text-2); background: var(--btn);
    border: 1px solid var(--border); border-radius: 3px;
    cursor: pointer;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn-orange { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-orange:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-lg { padding: 9px 16px; font-size: 15px; }

/* ---------- Zaglavlje ---------- */
.top { position: relative; z-index: 10; background: var(--bg); }
.matrix { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.top-in { position: relative; z-index: 1; height: 72px; display: flex; align-items: center; justify-content: space-between; }
.logo { position: relative; display: block; }
.logo::before {
    /* mirna podloga ispod loga da animacija ne ide preko slova */
    content: ""; position: absolute; inset: -16px -48px -16px -40px; z-index: -1;
    background: radial-gradient(closest-side, var(--bg) 72%, transparent);
}
.logo img { display: block; height: 46px; width: auto; }
.logo .logo-d { display: none; }

/* Traka s jezicima (na mjestu glavnog izbornika root.hr) */
.nav { position: relative; z-index: 5; background: var(--content); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.nav-in { display: flex; align-items: center; height: 44px; }
.nav-globe { display: flex; align-items: center; padding: 0 8px 0 0; color: var(--muted); font-size: 15px; }
.nav-menu { display: flex; height: 100%; }
.nav-menu > li { position: relative; display: flex; }
.nav-link {
    display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px;
    font-size: 15px; color: var(--text);
}
.nav-link:hover { background: var(--row); text-decoration: none; }
.nav-menu > li.is-active > .nav-link { box-shadow: inset 0 -3px var(--brand); font-weight: 600; }
.lang-short { display: none; }
.nav-icons { display: flex; align-items: center; gap: 2px; margin-left: auto; }
/* prekidač tamne/svijetle teme (isti kao na root.hr) */
.theme-switch {
    position: relative; flex: 0 0 auto; width: 40px; height: 22px; margin: 0 0 0 8px; padding: 0;
    background: var(--border); border: 0; border-radius: 11px; cursor: pointer; transition: background-color .25s;
}
.theme-switch:hover { background: var(--border-2); }
.theme-switch-knob {
    position: absolute; top: 2px; left: 2px; display: flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; font-size: 11px; background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s;
}
.theme-switch .fa-sun { color: var(--brand); }
.theme-switch .fa-moon { display: none; color: #1c1c1c; }
@media (prefers-reduced-motion: reduce) { .theme-switch, .theme-switch-knob { transition: none; } }

/* ---------- Raspored ---------- */
.page { flex: 1 0 auto; padding-top: var(--gap); padding-bottom: 28px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: var(--gap); align-items: start; }
.col-side { display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- Widgeti (svijetla varijanta desnog stupca) ---------- */
.widget { display: flex; flex-direction: column; padding: 16px; color: var(--text-2); background: var(--content); border-radius: 10px; min-width: 0; }
.widget-title { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; font-size: 19px; font-weight: 700; line-height: 1.2; color: var(--title); }
.widget-title i { color: var(--brand); font-size: 17px; }
.widget-sub { margin: -2px 0 8px; color: var(--text-2); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wlist li { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.wlist li[hidden] { display: none; }
.wl-link { flex: 1 1 auto; min-width: 0; padding: 3px 0; color: var(--text); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-link:hover { color: var(--brand); }
.wl-text { flex: 1 1 auto; min-width: 0; padding: 3px 0; color: var(--text); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-badge {
    flex: 0 0 auto; min-width: 48px; padding: 2px 6px; text-align: center;
    font-size: 13px; font-weight: 600; color: #fff; background: var(--brand); border-radius: 3px;
}
.wl-meta { flex: 0 1 auto; max-width: 68%; color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-stable { background: var(--green); }
.badge-longterm { background: var(--blue); }
.widget-more { margin-top: auto; padding: 8px 0 2px; align-self: flex-start; color: var(--text); font-weight: 700; }
.widget-more:hover { color: var(--brand); }
.widget-empty { color: var(--text-2); font-style: italic; }

/* Partneri: logotipi uvijek na bijeloj podlozi (i u tamnoj temi) */
.partner-logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.partner-logos a {
    display: flex; align-items: center; justify-content: center; height: 64px; padding: 10px 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 6px;
}
.partner-logos a:hover { border-color: var(--border-2); background: #f7f6f5; }
.partner-logos img { display: block; max-width: 100%; max-height: 32px; width: auto; height: auto; object-fit: contain; }

/* ---------- Bijeli sadržaj ---------- */
.box { background: var(--content); border-radius: 10px; padding: 12px 16px 16px; min-width: 0; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; }
.box-head h1 { font-size: 24px; line-height: 1.2; color: var(--title); }

/* Moja IP adresa (isto kao root.hr/moja-ip-adresa) */
.mono { font-family: "JetBrains Mono", Consolas, monospace; }
.ip-lead { margin: -6px 0 14px; font-size: 15px; color: var(--text-2); }
.ip-hero { padding: 24px 20px; text-align: center; color: #fff; background: var(--dark); border-radius: 6px; }
.ip-hero-box { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; max-width: 100%; }
.ip-hero-badge { padding: 3px 8px; font-size: 13px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 3px; }
.ip-hero-address { font-size: 34px; font-weight: 600; line-height: 1.2; color: #fff; word-break: break-all; }
.ip-hero-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; color: var(--on-dark); font-size: 15px; }
.ip-hero-meta[hidden], .ip-hero-meta [hidden] { display: none; }
.ip-copy {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 auto;
    color: var(--on-dark); background: transparent; border: 1px solid #4b4b4b; border-radius: 3px; cursor: pointer;
}
.ip-copy:hover { color: #fff; border-color: var(--brand); }
.ip-copy.copied { color: var(--green); border-color: var(--green); }
.ip-copy[hidden] { display: none; }
.sub-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 18px; color: var(--title); scroll-margin-top: 16px; }
.sub-title i { color: var(--brand); font-size: 16px; }
.ip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ip-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; background: var(--row); border: 1px solid var(--border); border-radius: 6px; }
.ip-card .ip-copy { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; color: var(--text-2); border-color: var(--border); background: var(--surface); }
.ip-card .ip-copy:hover { color: var(--brand); border-color: var(--brand); }
.ip-label { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ip-label i { margin-right: 4px; color: var(--brand); }
.ip-value { padding-right: 40px; font-size: 16px; font-weight: 600; color: var(--text); word-break: break-all; }
.ip-value.is-empty { font-weight: 400; color: var(--muted); }
.ip-flag { width: 24px; height: 18px; margin-right: 8px; vertical-align: -3px; border-radius: 2px; object-fit: cover; }
.ip-meta { font-size: 13px; color: var(--muted); word-break: break-word; }
.ip-meta:empty { display: none; }
.ip-meta a { color: var(--brand); }
.terminal { overflow: hidden; background: #101010; border-radius: 6px; }
.terminal-bar { display: flex; gap: 6px; padding: 10px 12px; background: var(--dark-2); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #4b4b4b; }
.terminal-bar span:first-child { background: var(--brand); }
.terminal-body { padding: 12px 16px 14px; font-family: "JetBrains Mono", Consolas, monospace; font-size: 13.5px; }
.terminal-comment { margin-top: 12px; color: #7d7e7e; }
.terminal-comment:first-child { margin-top: 0; }
.terminal-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.terminal-line code { min-width: 0; overflow-x: auto; white-space: nowrap; color: #e0e0e0; font-family: inherit; }
.terminal-line .prompt { margin-right: 10px; color: var(--brand); user-select: none; }
.terminal-line .ip-copy { width: 30px; height: 30px; }
.ip-faq > div { padding: 10px 0; border-bottom: 1px solid var(--border); }
.ip-faq > div:last-child { border-bottom: 0; }
.ip-faq dt { font-weight: 700; color: var(--text); }
.ip-faq dd { margin: 2px 0 0; color: var(--text-2); }
.ip-note { margin-top: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--text-2); background: var(--row); border-radius: 6px; }
.ip-note i { margin-right: 4px; color: var(--brand); }

.notfound { padding: 48px 24px; text-align: center; }
.notfound .code { font-size: 72px; font-weight: 800; line-height: 1; color: var(--brand); }
.notfound h1 { margin: 10px 0 6px; font-size: 26px; color: var(--title); }
.notfound p { color: var(--text-2); }
.notfound .actions { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }

/* ---------- Podnožje (kao vojs.eu: root.hr logo, autorska prava, Amadex, kolačići) ---------- */
.footer { flex-shrink: 0; padding: 22px 0 26px; font-size: 12.8px; color: var(--muted); text-align: center; }
.footer-in p + p { margin-top: 6px; }
.footer a { color: var(--brand); }
.footer a:hover { color: var(--brand-hover); text-decoration: none; }
.footer-logo { display: inline-block; margin-bottom: 4px; line-height: 0; }
.footer-logo img { display: block; height: 28px; width: auto; }
.footer-logo .logo-d { display: none; }

.back-to-top {
    /* uz desni rub sadržaja (1270 px), a ne uz rub ekrana */
    position: fixed; right: max(18px, calc((100vw - 1270px) / 2 - 58px)); bottom: 18px; z-index: 40;
    display: flex; align-items: center; justify-content: center; width: 42px; height: 42px;
    color: #fff; background: var(--brand); border: 0; border-radius: 3px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s;
}
.back-to-top:hover { background: var(--brand-hover); }
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ---------- Prilagodbe ---------- */
@media (max-width: 1200px) {
    :root { --side: 320px; }
}
@media (max-width: 992px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .col-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 768px) {
    :root { --gap: 10px; }
    .container { padding-left: 10px; padding-right: 10px; }
    .top-in { height: 58px; }
    .logo img { height: 38px; }
    .nav-link { padding: 0 10px; font-size: 14.5px; }
    .col-side { grid-template-columns: minmax(0, 1fr); }
    .widget, .box { border-radius: 8px; }
    .ip-grid { grid-template-columns: minmax(0, 1fr); }
    .ip-hero-address { font-size: 22px; }
    .ip-hero { padding: 18px 12px; }
}
@media (max-width: 520px) {
    .lang-full { display: none; }
    .lang-short { display: inline; }
    .nav-link { padding: 0 12px; font-weight: 600; }
}
@media (max-width: 360px) {
    .logo img { height: 34px; }
    .nav-globe { display: none; }
    /* najuži ekrani: podnaslovi i opisi u widgetima smiju u drugi red umjesto da se režu */
    .widget-sub { white-space: normal; }
    .wl-meta { white-space: normal; text-align: right; }
}

/* ---------- Tamna tema (svijetla je zadana) - iste boje kao na root.hr ---------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141414;
    --content: #1f1f1f;
    --row: #2b2b2b;
    --row-alt: #262626;
    --dark: #1f1f1f;
    --dark-2: #2b2b2b;
    --text: #f0f0f0;
    --text-2: #d8d8d8;
    --muted: #9c9c9c;
    --title: #f0f0f0;
    --border: #353535;
    --border-2: #4a4a4a;
    --btn: #2b2b2b;
    --btn-hover: #353535;
    --surface: #262626;
}
html[data-theme="dark"] .logo .logo-l,
html[data-theme="dark"] .footer-logo .logo-l { display: none; }
html[data-theme="dark"] .logo .logo-d,
html[data-theme="dark"] .footer-logo .logo-d { display: block; }
html[data-theme="dark"] .theme-switch { background: #4a4a4a; }
html[data-theme="dark"] .theme-switch:hover { background: #5a5a5a; }
html[data-theme="dark"] .theme-switch-knob { transform: translateX(18px); }
html[data-theme="dark"] .theme-switch .fa-sun { display: none; }
html[data-theme="dark"] .theme-switch .fa-moon { display: inline-block; }
html[data-theme="dark"] .ip-hero { background: #141414; }
html[data-theme="dark"] .partner-logos a { border-color: #fff; }
html[data-theme="dark"] .partner-logos a:hover { background: #f1f1f1; }
