/* SDN Tech Sharing — UI Revamp (V4)
   Futuristik • simple • modern • responsif
*/

:root{
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";

  /* core */
  --bg: #070B14;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.09);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.66);
  --border: rgba(255,255,255,.12);

  /* brand */
  --primary: #3A8CFF;
  --primary2:#6BE4FF;
  --accent:#FFB74A;
  --danger:#FF4D4D;
  --ok:#3BFF92;

  /* shape */
  --r12: 12px;
  --r16: 16px;
  --r20: 20px;
  --r28: 28px;
  --shadow: 0 22px 70px rgba(0,0,0,.40);
  --ring: 0 0 0 4px rgba(58,140,255,.18);

  /* spacing */
  --container: min(1120px, 92vw);
}

html[data-theme="light"]{
  --bg: #F7F9FF;
  --panel: rgba(255,255,255,.80);
  --panel2: rgba(255,255,255,.94);
  --text: rgba(9,13,26,.92);
  --muted: rgba(9,13,26,.62);
  --border: rgba(9,13,26,.10);
  --shadow: 0 22px 70px rgba(20,45,90,.10);
  --ring: 0 0 0 4px rgba(58,140,255,.14);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background: var(--bg);
  min-height:100vh;
  overflow-x:hidden;
}

/* ambient futuristic background */
body:before, body:after{
  content:"";
  position:fixed;
  inset:-40vh -30vw;
  z-index:-2;
  pointer-events:none;
}
body:before{
  background:
    radial-gradient(900px 520px at 15% 10%, rgba(58,140,255,.26), transparent 60%),
    radial-gradient(860px 520px at 80% 10%, rgba(255,183,74,.18), transparent 60%),
    radial-gradient(900px 520px at 65% 90%, rgba(107,228,255,.18), transparent 65%);
  filter:saturate(115%);
}
body:after{
  background-image:
    linear-gradient(transparent 0, transparent 96%, rgba(255,255,255,.035) 96%, rgba(255,255,255,.035) 100%),
    linear-gradient(90deg, transparent 0, transparent 96%, rgba(255,255,255,.03) 96%, rgba(255,255,255,.03) 100%);
  background-size: 34px 34px, 34px 34px;
  opacity:.28;
  z-index:-1;
  mask-image: radial-gradient(circle at 50% 30%, rgba(0,0,0,.95), transparent 70%);
}

@media (prefers-reduced-motion: no-preference){
  body:before{animation: floatbg 18s ease-in-out infinite alternate;}
  @keyframes floatbg{from{transform:translate3d(0,0,0) scale(1)} to{transform:translate3d(-2vw,1.5vh,0) scale(1.03)}}
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

/* layout helpers */
.container{width:var(--container);margin: 18px auto 64px;}
.row{display:flex;align-items:center}
.between{justify-content:space-between}
.end{justify-content:flex-end}
.gap{gap:10px}
.gap12{gap:12px}
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}
.p24{padding:24px}.w100{width:100%}
.muted{color:var(--muted)}
.hide-sm{display:inline}
@media (max-width:720px){.hide-sm{display:none}}

/* nav */
.nav{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(7,11,20,.78), rgba(7,11,20,.38));
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .nav{background: linear-gradient(to bottom, rgba(247,249,255,.92), rgba(247,249,255,.62));}

.nav-inner{
  width:var(--container);
  margin:0 auto;
  padding: 12px 0;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.brand{display:flex;align-items:center;gap:12px;min-width:220px}
.brand-logo{height:40px;width:auto;border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.18)}
.brand-title{font-weight:900;letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted)}
.nav-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}

.avatar{
  width:30px;height:30px;border-radius:12px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(58,140,255,.35), rgba(255,183,74,.22));
  border: 1px solid var(--border);
  font-weight:900;
}

.dot{
  display:inline-grid;place-items:center;
  min-width:22px;height:22px;
  padding:0 6px;
  border-radius:999px;
  font-size:12px;
  background: rgba(255,77,77,.18);
  border:1px solid rgba(255,77,77,.25);
}

/* buttons */
.btn{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  padding: 10px 14px;
  border-radius: 14px;
  cursor:pointer;
  color: var(--text);
  display:inline-flex;align-items:center;gap:8px;
  transition: transform .12s ease, background .2s ease, border .2s ease, box-shadow .2s ease;
  user-select:none;
}
.btn:hover{transform: translateY(-1px); border-color: rgba(58,140,255,.35); background: rgba(255,255,255,.06)}
.btn:active{transform: translateY(0px)}
.btn:focus{outline:none; box-shadow: var(--ring)}
.btn.primary{
  border:none;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 16px 46px rgba(58,140,255,.20);
}
.btn.primary:hover{filter:saturate(110%)}
.btn.ghost{background: transparent}
.btn.danger{border-color: rgba(255,77,77,.35); color: rgba(255,220,220,.95)}
.icon{font-size:14px}

/* card */
.card{
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--r28);
  box-shadow: var(--shadow);
}

.sep{border:none;border-top:1px solid var(--border); margin: 18px 0}

/* hero */
.hero{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin: 16px 0;}
.hero h2{margin:0; font-size: clamp(22px, 2.1vw, 30px); letter-spacing:.2px}
.hero-actions{display:flex; gap:10px; flex-wrap:wrap}
@media (max-width:720px){.hero{flex-direction:column}}

/* filters */
.filter{
  display:grid;
  grid-template-columns: 1fr 240px 190px 140px auto;
  gap:10px;
  margin: 14px 0 18px;
}
@media (max-width:980px){.filter{grid-template-columns: 1fr 1fr;}}
@media (max-width:520px){.filter{grid-template-columns: 1fr;}}

input, select, textarea{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.10);
  color: var(--text);
  outline:none;
}
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea{background: rgba(255,255,255,.75)}
input:focus, select:focus, textarea:focus{box-shadow: var(--ring); border-color: rgba(58,140,255,.35)}
label{font-size:13px;color:var(--muted);display:block;margin:10px 0 6px}
.req{color: var(--accent)}

/* posts grid */
.grid-posts{display:grid; grid-template-columns: repeat(3, 1fr); gap: 14px;}
@media (max-width:980px){.grid-posts{grid-template-columns: repeat(2, 1fr);}}
@media (max-width:620px){.grid-posts{grid-template-columns: 1fr;}}

.post-card{overflow:hidden; position:relative}
.post-card:hover{transform: translateY(-2px); transition: .15s}

.thumb{display:block;height: 168px;background: rgba(0,0,0,.10)}
.thumb img{width:100%;height:100%;object-fit:cover}
.thumb-placeholder{height:100%;display:grid;place-items:center;background: linear-gradient(135deg, rgba(58,140,255,.30), rgba(255,183,74,.18));font-weight:900;letter-spacing:2px}

.post-body{padding: 14px 14px 16px}
.meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pill{font-size:12px;padding:6px 10px;border-radius:999px;background: rgba(58,140,255,.12);border: 1px solid rgba(58,140,255,.22)}
.pill.accent{border-color: rgba(255,183,74,.35); background: rgba(255,183,74,.10)}
.post-title{margin: 10px 0 8px; font-size: 18px; line-height:1.25}
.post-title a:hover{text-decoration:underline}
.excerpt{margin:0;color:var(--muted);line-height:1.5; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}

/* flash */
.flash{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:14px;border:1px solid var(--border);margin:12px 0}
.flash .flash-x{border:none;background:transparent;color:inherit;cursor:pointer}
.flash.info{background: rgba(58,140,255,.10); border-color: rgba(58,140,255,.20)}
.flash.success{background: rgba(59,255,146,.10); border-color: rgba(59,255,146,.18)}
.flash.error{background: rgba(255,77,77,.10); border-color: rgba(255,77,77,.18)}

/* auth */
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding: 22px}
.auth-card{width:min(480px,92vw); position:relative; overflow:hidden; padding:22px; border-radius: 30px; background: linear-gradient(180deg, var(--panel2), var(--panel)); border:1px solid var(--border); box-shadow: var(--shadow)}
.auth-card.wide{width:min(760px,94vw)}
.auth-bg{position:absolute; inset:-70px -70px auto auto; width: 340px; height:340px; transform: rotate(18deg);
  background: radial-gradient(circle at 30% 30%, rgba(58,140,255,.42), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(255,183,74,.28), transparent 60%),
              radial-gradient(circle at 60% 20%, rgba(107,228,255,.24), transparent 65%);
  z-index:1; filter: blur(.2px);
}
.auth-hero{position:relative; z-index:2}
.auth-logo{height:46px;width:auto;border-radius:14px}
.auth-hero h1{margin:10px 0 6px; font-size: clamp(22px, 2.4vw, 30px)}
.form{margin-top:14px; position:relative; z-index:2}
.link{color: var(--primary2); font-weight:700}
.link:hover{text-decoration:underline}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
@media (max-width:720px){.grid2{grid-template-columns:1fr}}
.otp-actions{display:flex;flex-direction:column;justify-content:flex-end}
.thumb-mini img{height:46px;border-radius:14px;border:1px solid var(--border)}

/* editor blocks */
.editor-toolbar{display:flex; flex-wrap:wrap; gap:10px; margin-bottom:12px}
.block{padding:14px; border-radius: 18px; border: 1px dashed rgba(58,140,255,.24); background: rgba(0,0,0,.06); margin-bottom:12px}
.block-h{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px}
.block-title{font-weight:900}
.block-actions{display:flex; gap:8px}
.small{font-size:12px;color:var(--muted)}

/* content / post view */
.h1{font-size: clamp(24px, 2.8vw, 34px); margin:0}
.post-cover{border-radius: 22px; overflow:hidden; border:1px solid var(--border)}
.content{line-height:1.7}
.content h2{margin:18px 0 10px}

.code-wrap{border:1px solid var(--border); border-radius: 18px; overflow:hidden; margin: 14px 0}
.code-meta{padding:10px 12px; border-bottom:1px solid var(--border); font-weight:900; font-size:12px; color:var(--muted)}
pre{margin:0; padding:12px; overflow:auto}

.callout{border: 1px solid rgba(255,183,74,.25); background: rgba(255,183,74,.08); padding:14px; border-radius:18px; margin: 14px 0}
.callout-title{font-weight:900; margin-bottom:8px}
.prompt{white-space:pre-wrap; border:1px solid var(--border); background: rgba(0,0,0,.06); border-radius:14px; padding:12px}
.attach{border: 1px solid rgba(58,140,255,.22); background: rgba(58,140,255,.06); padding:14px; border-radius:18px; margin: 14px 0}
.attach-title{font-weight:900; margin-bottom:8px}

/* tables */
.table-wrap{overflow:auto; border:1px solid var(--border); border-radius: 16px}
.table{width:100%; border-collapse:separate; border-spacing:0}
.table th,.table td{padding:12px 14px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top}
.table thead th{position:sticky; top:0; background: rgba(255,255,255,.04); backdrop-filter: blur(10px); z-index:1}
html[data-theme="light"] .table thead th{background: rgba(255,255,255,.72)}
.table tr:last-child td{border-bottom:none}
.nowrap{white-space:nowrap}

/* tabs / chips */
.home-tabs{display:flex; gap:10px; flex-wrap:wrap}
.tab{padding:10px 12px; border-radius:999px; border:1px solid var(--border); background: var(--panel); color: var(--text); text-decoration:none; font-weight:700}
.tab.active{box-shadow: var(--ring)}
.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{display:inline-flex; gap:6px; align-items:center; padding:6px 10px; border-radius:999px; border:1px solid var(--border); background: var(--panel2); text-decoration:none; color: var(--text); font-size:13px}
.statline{display:flex; gap:12px; flex-wrap:wrap; margin-top:10px}

/* public pages */
.public-hero{padding:28px 0 18px; background: radial-gradient(1200px 600px at 20% -10%, rgba(58,140,255,.30), transparent 60%), radial-gradient(1200px 600px at 80% 0%, rgba(255,183,74,.20), transparent 55%)}
.public-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.brandline{display:flex;gap:12px;align-items:center}
.brand-logo-lg{width:54px;height:54px;border-radius:16px; box-shadow:0 12px 34px rgba(0,0,0,.18)}
.public-search{display:grid; grid-template-columns: 1fr 240px 140px; gap:10px; margin-top:18px}
@media (max-width:820px){.public-top{flex-direction:column}.public-search{grid-template-columns:1fr;}}

.timeline{display:grid; grid-template-columns: repeat(2,1fr); gap:12px}
@media (max-width:900px){.timeline{grid-template-columns:1fr}}

/* footer */
.footer{padding: 26px 0 44px; border-top: 1px solid var(--border); margin-top: 48px}

/* dialogs */
.modal::backdrop{background:rgba(0,0,0,.55)}
.modal{border:none;background:transparent;padding:0}

/* subtle default transitions */
@media (prefers-reduced-motion: no-preference){
  .card, .btn, .post-card{will-change: transform}
}
