/* =========================================================
   RESET & BASE
========================================================= */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #e6edf3;
  background: url('/assets/bg.png') no-repeat center center fixed;
  background-size: cover;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =========================================================
   GLOBAL FX
========================================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 0;
}

.fireflies {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.firefly {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0,255,180,.9);
  box-shadow: 0 0 12px rgba(0,255,180,.8);
  animation: move var(--duration, 16s) linear infinite;
}

@keyframes move {
  from { transform: translateY(0); opacity: .2; }
  to   { transform: translateY(-120vh); opacity: 1; }
}

/* =========================================================
   HEADER
========================================================= */
header,
.header {
  position: relative;
  z-index: 2;
  height: 56px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(18,24,33,.85);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.05);
}

header img,
.header img {
  height: 32px;
  cursor: pointer;
}

header .user {
  font-size: 14px;
  color: #9fb3c8;
}

header .user a {
  color: #00ffb3;
}

.back {
  font-size: 13px;
  color: #00ffb3;
  cursor: pointer;
  opacity: .85;
}

/* =========================================================
   MAIN LAYOUT
========================================================= */
main {
  position: relative;
  z-index: 2;
  padding: 36px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

/* =========================================================
   CARD
========================================================= */
.card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 26px;
  cursor: pointer;
  background: rgba(30,35,45,.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
  transition: transform .25s ease, box-shadow .25s ease;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg, none) center / cover no-repeat;
  opacity: .75;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.15),
    rgba(0,0,0,.55)
  );
}

.card > * {
  position: relative;
  z-index: 2;
}

.card h2 {
  margin: 0 0 12px;
  color: #00ffb3;
  letter-spacing: .8px;
}

.card p {
  font-size: 14px;
  color: #d4deea;
}

.card button {
  align-self: flex-start;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, #00ffb3, #00cfff);
  font-weight: 600;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 45px rgba(0,255,180,.45);
}

/* =========================================================
   DASHBOARD
========================================================= */
.page-dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-dashboard main {
  flex: 1;
}

.page-dashboard footer {
  z-index: 2;
  padding: 24px;
}

/* =========================================================
   LOGIN
========================================================= */
.page-login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: url('/assets/bg.png') no-repeat center center fixed;
  background-size: cover;
}

.page-login::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 0;
}

.page-login .login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.page-login .login-container {
  width: 360px;
  padding: 36px 28px;
  border-radius: 18px;
  background: #3e434c;
  box-shadow: 0 0 30px rgba(0,0,0,.45);
  text-align: center;
  position: relative;
  z-index: 5;
}

.page-login input {
  width: 100%;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid #00ffb3;
  background: #050b14;
  color: #fff;
}

.page-login button {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, #00ffb3, #00cfff);
  font-weight: 600;
}

.page-login .login-logo {
  width: 220px;
  max-width: 80%;
  margin: 0 auto 24px;
  display: block;
}

/* =========================================================
   SPEARHEAD – PDF VIEWER (DESKTOP)
========================================================= */
.page-faction .container {
  display: flex;
  height: calc(100vh - 56px);
}

.page-faction .sidebar {
  width: 300px;
  background: #121821;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.page-faction .sidebar h2 {
  margin: 0 0 26px;
  font-size: 18px;
  color: #00ffb3;
  letter-spacing: .8px;
}

.page-faction .pdf-item {
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: rgba(30,35,45,.55);
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, transform .15s ease;
}

.page-faction .pdf-item:hover {
  background: rgba(0,255,180,.18);
  box-shadow: 0 0 18px rgba(0,255,180,.4);
  transform: translateY(-3px);
}

.page-faction .viewer {
  flex: 1;
}

.page-faction iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* =========================================================
   FOOTER
========================================================= */
footer {
  text-align: center;
  font-size: 12px;
  color: #9fb3c8;
}

/* =========================================================
   MOBILE
========================================================= */
@media (max-width: 768px) {

  body {
    background-attachment: scroll;
    overflow-x: hidden;
  }

  header,
  .header {
    flex-direction: column;
    height: auto;
    padding: 14px;
    text-align: center;
  }

  main {
    padding: 14px;
  }

  .grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .card {
    background: var(--bg) center / cover no-repeat;  
    padding: 16px;
    min-height: 200px;
  }

  .card:hover {
    transform: none;
    box-shadow: none;
  }
  
  .card::before {
    display: none;
  }

  .page-faction .container {
    flex-direction: column;
  }

  .page-faction .sidebar {
    width: 100%;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    padding: 14px;
  }

  .page-faction .pdf-item {
    margin: 0;
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
    position: relative;
  }
  
  /* =========================================
   PDF ITEM – ACTIVE STATE
========================================= */

.page-faction .pdf-item.active {
  background: rgba(0,255,180,.25);
  box-shadow: 
    0 0 22px rgba(0,255,180,.5),
    inset 0 0 0 1px rgba(0,255,180,.6);
  transform: translateY(-2px);
}

.page-faction .pdf-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(to bottom, #00ffb3, #00cfff);
}
  
}