/* ioDebug - main stylesheet */
:root {
  --brand: #0b5cad;
  --brand-dark: #08427d;
  --accent: #e8452c;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7385;
  --border: #e2e6ee;
  --nav: #0f1724;
  --radius: 6px;
  --maxw: 1200px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Top bar ---------- */
.topbar { background: #070c14; color: #9aa4b5; font-size: 12px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.topbar a { color: #c9d1de; margin-left: 16px; }
.topbar .social a { margin-left: 12px; }

/* ---------- Header ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 28px; color: var(--text); letter-spacing: -0.5px; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #13a3e0);
  color: #fff; display: grid; place-items: center; font-family: Consolas, monospace; font-size: 18px;
}
.logo .io { color: var(--brand); }
.logo .debug { color: var(--text); }
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.search { display: flex; flex: 0 1 380px; }
.search input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-right: none;
  border-radius: var(--radius) 0 0 var(--radius); font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--brand); }
.search button {
  background: var(--brand); color: #fff; border: none; padding: 0 16px;
  border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-weight: 600;
}
.search button:hover { background: var(--brand-dark); }

/* ---------- Main nav ---------- */
.main-nav { background: var(--nav); position: sticky; top: 0; z-index: 50; }
.main-nav .container { display: flex; align-items: center; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav li a {
  display: block; color: #e6ebf3; padding: 14px 16px; font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: .3px;
}
.main-nav li a:hover, .main-nav li a.active { background: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 24px; padding: 10px; cursor: pointer; }

/* ---------- Ticker ---------- */
.ticker { background: #fff; border-bottom: 1px solid var(--border); font-size: 13px; }
.ticker .container { display: flex; align-items: center; height: 38px; overflow: hidden; gap: 12px; }
.ticker .label { background: var(--accent); color: #fff; font-weight: 700; padding: 3px 10px; border-radius: 3px; white-space: nowrap; font-size: 12px; }
.ticker .track { overflow: hidden; flex: 1; position: relative; height: 20px; }
.ticker .track-inner { position: absolute; white-space: nowrap; animation: ticker 45s linear infinite; }
.ticker .track-inner a { color: var(--text); margin-right: 48px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Layout ---------- */
.page { padding: 24px 0 40px; }
.grid-main { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.section-title {
  font-size: 18px; font-weight: 800; text-transform: uppercase; margin: 0 0 14px;
  padding-bottom: 8px; border-bottom: 3px solid var(--brand); display: inline-block;
}
.section-head { border-bottom: 1px solid var(--border); margin-bottom: 16px; }

/* ---------- Thumbnails (generated) ---------- */
.thumb {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9;
  display: flex; align-items: flex-end; color: #fff;
}
.thumb::before {
  content: attr(data-icon); position: absolute; right: 12px; top: 6px; font-size: 54px; opacity: .25;
  font-family: Consolas, monospace; font-weight: 700;
}
.thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 14px 14px;
}
.t-security { background: linear-gradient(135deg, #8a1c1c, #e8452c); }
.t-ransomware { background: linear-gradient(135deg, #3d0d4f, #a23ed6); }
.t-microsoft { background: linear-gradient(135deg, #0a3a7a, #1e88e5); }
.t-linux { background: linear-gradient(135deg, #1f2d1f, #43a047); }
.t-apple { background: linear-gradient(135deg, #2b2f36, #78849a); }
.t-google { background: linear-gradient(135deg, #0c5e57, #26a69a); }
.t-technology { background: linear-gradient(135deg, #34234f, #5c6bc0); }
.t-crypto { background: linear-gradient(135deg, #6b3e00, #f9a825); }
.thumb.has-img { background-size: cover; background-position: center; background-color: #1d2330; }
.thumb.has-img::before, .thumb.has-img::after { display: none; }
a .thumb.has-img { transition: filter .2s; }
a:hover .thumb.has-img { filter: brightness(1.08); }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: 3px; background: var(--brand); color: #fff; letter-spacing: .4px;
}
.badge.security { background: #c62828; }
.badge.ransomware { background: #7b1fa2; }
.badge.microsoft { background: #1565c0; }
.badge.linux { background: #2e7d32; }
.badge.apple { background: #546e7a; }
.badge.google { background: #00897b; }
.badge.technology { background: #3f51b5; }
.badge.crypto { background: #ef8f00; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.hero-main .thumb { aspect-ratio: auto; height: 100%; min-height: 380px; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.hero-side .thumb { aspect-ratio: auto; height: 100%; min-height: 182px; }
.hero .overlay {
  position: relative; z-index: 2; padding: 18px; width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.hero .overlay h2 { margin: 8px 0 4px; font-size: 26px; line-height: 1.2; }
.hero-side .overlay h2 { font-size: 17px; }
.hero a { color: #fff; }
.hero a:hover { text-decoration: none; }
.hero a:hover h2 { text-decoration: underline; }
.hero .meta { color: #dfe4ec; font-size: 12px; }

/* ---------- Article list ---------- */
.article-list { padding: 18px; }
.article-item { display: grid; grid-template-columns: 240px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.article-item:first-child { padding-top: 0; }
.article-item:last-child { border-bottom: none; padding-bottom: 0; }
.article-item h3 { margin: 6px 0 6px; font-size: 19px; line-height: 1.3; }
.article-item h3 a { color: var(--text); }
.article-item p { margin: 0 0 8px; color: #424a5a; }
.meta { font-size: 12px; color: var(--muted); }
.meta b { color: var(--text); font-weight: 600; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
  padding: 7px 13px; border: 1px solid var(--border); background: #fff; border-radius: 4px; color: var(--text); font-size: 14px;
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Sidebar ---------- */
.sidebar .widget { padding: 16px; margin-bottom: 20px; }
.widget h4 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; border-left: 4px solid var(--brand); padding-left: 8px; }
.popular-list { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.popular-list li { counter-increment: pop; display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.popular-list li:last-child { border-bottom: none; }
.popular-list li::before {
  content: counter(pop); font-size: 22px; font-weight: 800; color: var(--brand); min-width: 22px; line-height: 1.1;
}
.popular-list a { color: var(--text); font-weight: 600; font-size: 14px; }
.newsletter p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.newsletter input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 8px; }
.btn {
  display: inline-block; background: var(--brand); color: #fff; border: none; padding: 10px 18px;
  border-radius: 4px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.block { width: 100%; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #c4351f; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.dl-mini { list-style: none; margin: 0; padding: 0; }
.dl-mini li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.dl-mini li:last-child { border-bottom: none; }
.dl-icon {
  width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 13px; flex-shrink: 0; font-family: Consolas, monospace;
}
.dl-mini .ver { font-size: 12px; color: var(--muted); display: block; }
.ad-box {
  height: 250px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #f7f8fb, #f7f8fb 10px, #eef1f6 10px, #eef1f6 20px);
  color: #a3abb9; font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
}

/* ---------- Article page ---------- */
.article { padding: 28px 32px; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.article h1 { font-size: 34px; line-height: 1.2; margin: 10px 0 12px; }
.article .byline { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.article .thumb { margin-bottom: 22px; aspect-ratio: 21/9; }
.article .body p { font-size: 17px; line-height: 1.75; margin: 0 0 18px; }
.article .body h2 { font-size: 23px; margin: 28px 0 12px; }
.article .body pre {
  background: #0f1724; color: #cfe3ff; padding: 16px; border-radius: 6px; overflow-x: auto; font-size: 14px;
}
.article .body blockquote { border-left: 4px solid var(--brand); margin: 0 0 18px; padding: 8px 16px; background: #f1f6fc; color: #2a3a52; }
.share { display: flex; gap: 8px; margin: 20px 0; }
.share a { padding: 7px 14px; border-radius: 4px; color: #fff; font-size: 13px; font-weight: 600; }
.tags a { display: inline-block; background: #eef2f8; color: var(--text); padding: 4px 10px; border-radius: 3px; font-size: 13px; margin: 0 6px 6px 0; }
.author-box { display: flex; gap: 16px; padding: 18px; background: #f7f9fc; border-radius: var(--radius); margin-top: 24px; }
.author-box .avatar { width: 64px; height: 64px; font-size: 22px; flex-shrink: 0; }
.comments { margin-top: 28px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment .meta { margin-bottom: 4px; }
.comments textarea { width: 100%; min-height: 100px; padding: 10px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; margin-bottom: 8px; }
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 10px; }
.related h5 { margin: 8px 0 0; font-size: 14px; line-height: 1.35; }
.related h5 a { color: var(--text); }

/* ---------- Downloads ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters button {
  border: 1px solid var(--border); background: #fff; padding: 7px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.filters button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.dl-table { width: 100%; border-collapse: collapse; }
.dl-table th, .dl-table td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dl-table th { font-size: 12px; text-transform: uppercase; color: var(--muted); background: #f7f9fc; }
.dl-table .name { display: flex; gap: 12px; align-items: center; }
.dl-table .name b { display: block; font-size: 15px; }
.dl-table .name span { font-size: 13px; color: var(--muted); }
.stars { color: #f5a623; letter-spacing: 1px; }

/* ---------- Guides / tutorials cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-card { overflow: hidden; display: flex; flex-direction: column; }
.guide-card .thumb { border-radius: 0; }
.guide-card .content { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.guide-card h3 { font-size: 17px; margin: 6px 0 8px; line-height: 1.3; }
.guide-card h3 a { color: var(--text); }
.guide-card p { margin: 0 0 12px; color: #4a5263; font-size: 14px; flex: 1; }
.level { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; }
.level.beginner { background: #e3f6e8; color: #1e7b38; }
.level.intermediate { background: #fff4dc; color: #a26a00; }
.level.advanced { background: #fde6e3; color: #b3261e; }
.page-banner {
  background: linear-gradient(90deg, rgba(15,23,36,.92), rgba(11,92,173,.55)), url("../images/banner.jpg") center/cover, linear-gradient(135deg, #0f1724, #0b5cad);
  color: #fff; padding: 44px 0;
}
.page-banner h1 { margin: 0 0 6px; font-size: 32px; }
.page-banner p { margin: 0; color: #cfdcf0; max-width: 720px; }

/* ---------- Forums ---------- */
.forum-table { width: 100%; border-collapse: collapse; }
.forum-table th, .forum-table td { padding: 14px; border-bottom: 1px solid var(--border); text-align: left; }
.forum-table th { background: var(--nav); color: #fff; font-size: 13px; text-transform: uppercase; }
.forum-table td.num { text-align: center; color: var(--muted); width: 90px; }
.forum-table .f-title b { display: block; font-size: 15px; }
.forum-table .f-title span { font-size: 13px; color: var(--muted); }
.forum-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.forum-stats .card { padding: 18px; text-align: center; }
.forum-stats b { display: block; font-size: 26px; color: var(--brand); }

/* ---------- Static pages ---------- */
.static { padding: 28px 32px; }
.static h2 { margin-top: 28px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 14px;
}
.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
.team .card { padding: 16px; text-align: center; }
.team .avatar { margin: 0 auto 8px; width: 60px; height: 60px; font-size: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--nav); color: #9aa4b5; padding: 40px 0 0; margin-top: 20px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h5 { color: #fff; font-size: 14px; text-transform: uppercase; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #c9d1de; }
.site-footer .logo { color: #fff; font-size: 24px; margin-bottom: 10px; }
.site-footer .logo .debug { color: #fff; }
.footer-bottom { border-top: 1px solid #1f2a3b; margin-top: 30px; padding: 16px 0; font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: #1d2330; color: #fff; padding: 12px 18px;
  border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 0; transform: translateY(10px);
  transition: all .25s; z-index: 100; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-main { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .team, .forum-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .site-header .container { flex-direction: column; height: auto; padding: 12px 16px; gap: 10px; }
  .search { width: 100%; flex: 1 1 auto; }
  .nav-toggle { display: block; }
  .main-nav ul { display: none; flex-direction: column; width: 100%; }
  .main-nav ul.open { display: flex; }
  .main-nav .container { flex-direction: column; align-items: stretch; }
  .article-item { grid-template-columns: 1fr; }
  .card-grid, .related { grid-template-columns: 1fr; }
  .article, .static { padding: 20px 16px; }
  .article h1 { font-size: 26px; }
  .topbar .links { display: none; }
  .dl-table .hide-sm { display: none; }
}

/* ---------- Auth / modal ---------- */
.topbar .hello { margin-left: 16px; color: #c9d1de; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,12,20,.6); display: grid; place-items: center; z-index: 200; padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 100%; max-width: 400px; padding: 24px; position: relative; }
.modal-close { position: absolute; right: 10px; top: 6px; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.tabs-row { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tabs-row button { flex: 1; background: none; border: none; padding: 10px; font-weight: 700; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; font-size: 15px; }
.tabs-row button.on { color: var(--brand); border-bottom-color: var(--brand); }
.form-error { color: #c62828; font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.btn:disabled { opacity: .6; cursor: wait; }
.login-cta { background: #f1f6fc; border: 1px dashed #b9cde6; padding: 14px; border-radius: var(--radius); text-align: center; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 12px; padding: 0; margin-left: auto; }
.link-btn.danger { color: #c62828; }
.staff { background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-left: 4px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-head .meta { margin: 0; }
.comment-body, .post-body { font-size: 15px; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; }
.comment-body pre, .post-body pre { background: #0f1724; color: #cfe3ff; padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 13px; }

/* ---------- Downloads pills ---------- */
.pill { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; background: #eef2f8; color: var(--muted); vertical-align: middle; letter-spacing: .3px; }
.pill.own { background: #e3f0fd; color: var(--brand); }
.pill.banned { background: #c62828; color: #fff; }
.dl-table .name .meta { display: block; margin-top: 3px; }
.dl-table a.btn { text-align: center; white-space: nowrap; }
.dl-table a.btn:hover { text-decoration: none; }

/* ---------- Forum threads ---------- */
.forum-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.topic-title { font-size: 28px; margin: 6px 0 4px; }
.posts { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 20px; }
.post { display: grid; grid-template-columns: 160px 1fr; overflow: hidden; }
.post-user { background: #f7f9fc; border-right: 1px solid var(--border); padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.post-user .avatar { width: 54px; height: 54px; font-size: 18px; margin-bottom: 4px; }
.post-user .meta { margin-top: 4px; }
.post-main { padding: 14px 18px; }
.post-meta { display: flex; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px; }
#reply-form textarea, #topic-form textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 14px; margin-bottom: 6px; }

/* ---------- Admin ---------- */
.admin-stats { grid-template-columns: repeat(7, 1fr); }
.admin-table { overflow-x: auto; }
.admin-table td { font-size: 14px; }

@media (max-width: 980px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) {
  .post { grid-template-columns: 1fr; }
  .post-user { flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); text-align: left; padding: 10px 14px; }
  .post-user .avatar { width: 36px; height: 36px; font-size: 13px; margin: 0; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .topbar .links { display: block; }
  .topbar .today { display: none; }
}
