/* ======================================================================
   Elixiria Static Forum – Global Styles (style.css)
   Theme: Dark cinematic gradient with violet accent
   Palette: #0A0016 → #090909, Accent #7C4DFF
   Author: ChatGPT (Elixiria 2025)
   ====================================================================== */

/* ---- CSS Reset / Modern Normalize (lightweight) ---- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, picture, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
a { text-decoration: none; color: inherit; }
:focus { outline: 2px solid transparent; outline-offset: 2px; }

/* ---- Theme Tokens ---- */
:root{
  --bg: #0A0016;
  --bg-2: #090909;
  --panel: #121016;
  --panel-2: #0f0d14;
  --text: #EAEAF2;
  --muted: #B9B9C6;
  --accent: #7C4DFF;
  --accent-2: #A084FF;
  --link: #94F9D2;
  --success: #2ecc71;
  --warning: #ffb020;
  --danger: #ff5d5d;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --radius: 16px;
}

/* ---- Body / Background ---- */
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100dvh;
  line-height: 1.5;
  letter-spacing: 0.1px;
}

/* ---- Containers ---- */
main{
  width: min(1100px, 92vw);
  margin: 24px auto 64px;
  padding: 0 4px;
}

footer{
  width: min(1100px, 92vw);
  margin: 40px auto 80px;
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  opacity: .9;
}

/* ---- Top Navigation ---- */
.topnav{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(10,0,22,0.85), rgba(9,9,9,0.65));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px clamp(12px, 4vw, 28px);
}

.topnav a{
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  transition: transform .12s ease, color .12s ease, background .12s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.topnav a:hover{
  color: var(--text);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
  border-color: var(--border);
}

.topnav a.active{
  color: white;
  background: radial-gradient(120% 120% at 20% 0%, rgba(124,77,255,0.28), rgba(124,77,255,0.08) 50%, transparent);
  border-color: rgba(124,77,255,0.45);
}

/* ---- Hero ---- */
.hero{
  width: min(1100px, 92vw);
  margin: 32px auto 12px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(124,77,255,0.08), rgba(255,255,255,0.02));
  box-shadow: var(--shadow);
}

.hero h1{
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: 0.3px;
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
}

.hero .subtitle{
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

/* ---- Buttons / Utilities ---- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(124,77,255,0.45);
  box-shadow: 0 6px 16px rgba(124,77,255,0.18);
}
.btn.primary{
  border-color: rgba(124,77,255,0.55);
  background: linear-gradient(180deg, rgba(124,77,255,0.28), rgba(124,77,255,0.12));
}
.badge{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size:.8rem;
  color: var(--accent-2);
  border: 1px solid rgba(124,77,255,0.45);
  background: rgba(124,77,255,0.08);
}

/* ======================================================================
   Forum Index
   ====================================================================== */
.forum-index{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(12px, 2vw, 18px);
  margin-top: 18px;
}
.forum-category{
  grid-column: span 12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.2vw, 20px);
}
@media (min-width: 720px){
  .forum-category{ grid-column: span 6; }
}
@media (min-width: 1040px){
  .forum-category{ grid-column: span 4; }
}

.forum-category h2{
  margin: 0 0 10px;
  font-size: 1.15rem;
  letter-spacing: .2px;
}
.forum-category ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.forum-category li a{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.forum-category li a::after{
  content: "›";
  opacity: .6;
}
.forum-category li a:hover{
  transform: translateX(2px);
  background: rgba(124,77,255,0.06);
  border-color: rgba(124,77,255,0.45);
}

/* ======================================================================
   Topic Thread (forum/topic/index.html)
   expected markup: .topic-thread > .post
   with optional .topic-controls in .hero
   ====================================================================== */

.topic-controls{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.topic-thread{
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.post{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow: var(--shadow);
  padding: clamp(12px, 2vw, 18px);
}

.post .meta{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: .92rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.post .content{
  font-size: 1rem;
}
.post .content p{ margin: 0 0 10px; }
.post .content code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
.post .actions{
  display:flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ---- Pagination (generic) ---- */
.pagination{
  display:flex;
  gap: 8px;
  justify-content: center;
  margin: 14px 0 6px;
}
.pagination a{
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}
.pagination a.active{
  border-color: rgba(124,77,255,0.55);
  background: rgba(124,77,255,0.15);
}

/* ======================================================================
   Utility Pages (new-posts, downloads, register, login)
   ====================================================================== */
.section{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.2vw, 20px);
  margin-top: 18px;
}
h2.section-title{
  margin: 0 0 10px;
  font-size: 1.15rem;
}
.table{
  width:100%;
  border-collapse: collapse;
  font-size: .98rem;
}
.table th, .table td{
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.table tr:hover td{
  background: rgba(124,77,255,0.04);
}

/* ---- Forms ---- */
.form{
  display: grid;
  gap: 12px;
}
.input,
.select,
.textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
}
.textarea{ min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(124,77,255,0.55);
  box-shadow: 0 0 0 4px rgba(124,77,255,0.18);
}
.form .row{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width:720px){
  .form .row{ grid-template-columns: 1fr 1fr; }
}

/* ======================================================================
   Links, subtle animations
   ====================================================================== */
a{ color: var(--link); }
a:hover{ opacity: .95; text-decoration: underline; text-underline-offset: 2px; }

/* Optional: subtle scanline grain for retro vibe */
.hero, .forum-category, .post, .section{
  position: relative;
  overflow: clip;
}
.hero::before, .forum-category::before, .post::before, .section::before{
  content:"";
  position:absolute; inset:0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02) 0,
    rgba(255,255,255,0.02) 2px,
    transparent 2px,
    transparent 4px
  );
  mask-image: radial-gradient(80% 80% at 50% 0%, rgba(0,0,0,.22), rgba(0,0,0,0.0) 65%);
  pointer-events: none;
}
