/* ========= Theme ========= */
:root{
  --bg: #0b0f12;            /* page background */
  --surface: #121821;       /* cards / table bg */
  --surface-2: #0f141b;
  --text: #e5e7eb;          /* primary text */
  --muted: #a5b4c3;
  --border: #1f2a37;
  --accent: #22c55e;        /* emerald */
  --accent-2: #16a34a;
  --accent-glow: rgba(34,197,94,.2);
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --radius: 14px;
}

/* ========= Base ========= */
*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size:16px;
  line-height:1.6;
  color:var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(34,197,94,.07), transparent 60%) ,
              radial-gradient(800px 400px at 10% 110%, rgba(34,197,94,.06), transparent 50%) ,
              var(--bg);
  /* Disable text selection globally */
  -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;
}

/* Links */
a{color:var(--accent);text-decoration:none}
a:hover{color:#a7f3d0;text-decoration:underline}

/* ========= Layout ========= */
#main{max-width:1200px;margin:0 auto;padding:24px}

/* Header */
#header{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 0 26px;border-bottom:1px solid var(--border);
}
.brand{
  display:flex;align-items:center;gap:12px;font-weight:700;color:var(--text);
}
.brand__logo{display:inline-flex;align-items:center;justify-content:center;width:auto;height:42px;}
.brand__text{letter-spacing:.5px}

/* Buttons (kept if needed elsewhere) */
.btn{
  display:inline-flex;align-items:center;gap:.5rem;
  padding:.6rem 1rem;border-radius:10px;font-weight:600;
  border:1px solid transparent;transition:all .2s ease;
}
.btn--accent{
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#00170a; border-color:transparent;
  box-shadow:0 6px 16px var(--accent-glow);
}
.btn--accent:hover{transform:translateY(-1px);filter:saturate(1.05)}

/* Content wrapper */
#site_content{ margin:28px 0 16px; }

/* Card */
.card{
  background:linear-gradient(180deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
}

/* AVP2 Logo + Donate */
.logo-container{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-bottom:6px;
}
.avp-logo{
  max-width:480px;
  width:90%;
  height:auto;
  filter: drop-shadow(0 0 14px rgba(34,197,94,.35));
}
.donate-container{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  margin: 0 0 10px;
}
.donate-img{
  display:block;
  width:62px;
  height:31px;
  image-rendering:auto;
}
.donate-caption{
  font-weight:800;
  color:#ff4d4f; /* red */
  text-shadow:0 0 10px rgba(255,77,79,.25);
  letter-spacing:.2px;
}

/* Title - glowing emerald green */
.page-title{
  margin:6px 0 18px;
  font-size:clamp(26px, 3vw, 34px);
  font-weight:800;
  text-align:center;
  color:var(--accent);
  text-shadow:0 0 10px rgba(34,197,94,.5), 0 0 20px rgba(34,197,94,.25);
}

/* Table container */
.table-wrap{
  overflow:auto;
  border-radius:calc(var(--radius) - 4px);
  border:1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(34,197,94,.2), 0 10px 30px rgba(0,0,0,.35);
}

/* ====== MERGED TABLE STYLES (from tablestyle.css) ====== */
/* Page background fallback for old browsers */
body{background-color:#0b0f12}

/* Table base */
.listtable{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

/* Sticky header for wide lists */
#my-final-table thead th{
  position:sticky; top:0; z-index:2;
}

/* Header cells */
#my-final-table th{
  background: linear-gradient(180deg,#1f2937,#111827);
  color:#e5e7eb;
  padding:12px 10px;
  font-weight:700;
  text-align:left;
  border-bottom:1px solid #243143;
  letter-spacing:.3px;
  box-shadow:inset 0 -1px 0 #0b1220;
}
#my-final-table th a{color:#e5e7eb;text-decoration:none}
#my-final-table th a:hover{text-decoration:underline}

/* Rows */
#my-final-table tr{
  color:#e5e7eb;
  transition:background .15s ease, transform .04s ease;
}

/* Zebra stripes */
#my-final-table tbody tr:nth-child(odd) td{background:#0f141b}
#my-final-table tbody tr:nth-child(even) td{background:#121821}

/* Row hover */
#my-final-table tbody tr:hover td{
  background: #0f1c14;
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.15);
}

/* Cells */
#my-final-table td{
  padding:10px;
  border-right:1px solid #1f2a37;
  border-bottom:1px solid #1b2633;
  color:#e5e7eb;
  vertical-align:middle;
}
#my-final-table td:last-child{border-right:none}

/* Column alignment / widths */
.t1{height:17px;text-align:left;min-width:120px}
.t2{text-align:left}
.t3{min-width:90px;text-align:left}
.t4{min-width:110px;text-align:left}
.t5{text-align:center;min-width:70px;font-variant-numeric:tabular-nums}

/* Sort icons (Dynatable) – subtle emerald hint */
a.dynatable-sort-header{
  position:relative;padding-right:16px;
}
a.dynatable-sort-header:after{
  content:""; position:absolute; right:2px; top:50%; transform:translateY(-50%);
  border: 5px solid transparent; border-top-color: rgba(34,197,94,.65);
}
a.dynatable-sort-header.dynatable-sorted-desc:after{
  border-top-color: transparent; border-bottom-color: rgba(34,197,94,.85);
}

/* Small screens */
@media (max-width: 640px){
  #my-final-table th, #my-final-table td{padding:10px 8px}
  .page-title{font-size:20px}
}

/* Footer */
#footer{
  margin:28px 0 16px;text-align:left;font-size:.95rem;color:var(--muted);
}
#footer .footer-wrap{
  background:linear-gradient(180deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px;
  box-shadow: 0 0 0 1px rgba(34,197,94,.2), 0 10px 30px rgba(0,0,0,.35); /* match table border accent */
}
#footer a{color:#c7f9de}
#footer a:hover{color:#a7f3d0}

.back-to-top{
  display:inline-block;margin-top:12px;
  padding:8px 12px;border-radius:10px;
  border:1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(34,197,94,.2);
  text-transform:uppercase;font-weight:700;letter-spacing:.3px;
}

/* Utility */
.center{display:block;margin-inline:auto;text-align:center}
.left{float:left;margin-right:10px}
.right{float:right;margin-left:10px}

.brand__img{height:42px;width:auto;object-fit:contain;border-radius:8px;display:block;}


/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #0b0f12; }
::-webkit-scrollbar-thumb {
  background-color: #14532d; /* dark green */
  border-radius: 10px;
  border: 2px solid #0b0f12;
}
::-webkit-scrollbar-thumb:hover { background-color: #22c55e; } /* light emerald */
/* Firefox scrollbar */
* { scrollbar-width: thin; scrollbar-color: #14532d #0b0f12; }



/* Normalize table header vertical alignment (fix 'Map' misalignment) */
#my-final-table thead th{
  vertical-align: middle;
  line-height: 1.2;
}

#my-final-table thead th a.dynatable-sort-header{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  padding-right: 16px; /* keep space for arrow */
  margin: 0;
}

#my-final-table thead th a.dynatable-sort-header:after{
  top: 50%;
  transform: translateY(-50%);
}



/* Smaller page title size override */
.page-title{ font-size: clamp(20px, 2.2vw, 26px); }



/* ===== Mobile-friendly responsive layout ===== */
@media (max-width: 640px){
  /* Header brand wraps nicely */
  .brand__text{ font-size: 12px; line-height: 1.2; }

  /* Logo spacing */
  .logo-container{ gap: 8px; margin-bottom: 4px; }
  .avp-logo{ width: 95%; max-width: 360px; }
  .donate-container{ gap: 6px; margin-bottom: 8px; }
  .page-title{ font-size: 20px; margin: 6px 0 12px; }

  /* Table becomes card/list view */
  .table-wrap{ border-radius: 10px; }
  #my-final-table{ border: 0; }
  #my-final-table thead{ 
    display: none; 
  }
  #my-final-table tbody, 
  #my-final-table tr, 
  #my-final-table td{
    display: block;
    width: 100%;
  }
  #my-final-table tr{
    margin: 10px 8px;
    background: #0f141b;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
  }
  #my-final-table td{
    border: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #1b2633;
    word-break: break-word;
  }
  #my-final-table td:last-child{
    border-bottom: 0;
  }

  /* Labels for each cell */
  #my-final-table td:nth-child(1)::before{ content: "Server Name"; }
  #my-final-table td:nth-child(2)::before{ content: "Gametype"; }
  #my-final-table td:nth-child(3)::before{ content: "Map"; }
  #my-final-table td:nth-child(4)::before{ content: "Players"; }

  #my-final-table td::before{
    display: block;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 4px;
    letter-spacing: .2px;
  }

  /* Back to Top button larger for touch */
  .back-to-top{ padding: 10px 14px; font-size: 12px; }
}

/* Improve wrapping for long server names/maps on all screens */
#my-final-table td, #my-final-table th{
  white-space: normal;
  word-break: break-word;
}



/* === Header alignment hard-fix: ensure all column titles align on the same baseline === */
#my-final-table thead th{ vertical-align: middle; padding-top: 12px; padding-bottom: 12px; }
#my-final-table thead th a.dynatable-sort-header{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  line-height: 24px;
  padding-right: 0;   /* we'll render arrow inline, no absolute positioning */
  position: static;
  margin: 0;
}

/* Render sort arrow inline so text baseline matches */
#my-final-table thead th a.dynatable-sort-header:after{
  content: "";
  display: inline-block;
  border: 5px solid transparent;
  border-top-color: rgba(34,197,94,.75);
  margin-left: 6px;
  position: static;
  transform: none;
}

/* Desc state arrow flip */
#my-final-table thead th a.dynatable-sort-header.dynatable-sorted-desc:after{
  border-top-color: transparent;
  border-bottom-color: rgba(34,197,94,.95);
}



/* Smaller column header text */
#my-final-table thead th{
  font-size: clamp(11px, 1.2vw, 13px);
  padding-top: 10px;
  padding-bottom: 10px;
}



/* === Header baseline/descender fix for 'Gametype' and 'Players' === */
#my-final-table thead th{ vertical-align: middle; padding-top: 10px; padding-bottom: 10px; }
#my-final-table thead th, 
#my-final-table thead th *{ line-height: 1.1; }

#my-final-table thead th a.dynatable-sort-header{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  height: auto;
  padding-right: 0;
  margin: 0;
}

#my-final-table thead th a.dynatable-sort-header:after{
  content: "";
  display: inline-block;
  border: 5px solid transparent;
  border-top-color: rgba(34,197,94,.85);
  margin-left: 6px;
  position: static;
  transform: none;
}

#my-final-table thead th a.dynatable-sort-header.dynatable-sorted-desc:after{
  border-top-color: transparent;
  border-bottom-color: rgba(34,197,94,1);
}

