/* ============================================================
   MC Server List — Main Stylesheet (v2)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d1117;
  --bg2:      #161b22;
  --bg3:      #21262d;
  --border:   #30363d;
  --text:     #e6edf3;
  --text2:    #8b949e;
  --primary:  #1f6feb;
  --primary2: #388bfd;
  --green:    #238636;
  --green2:   #2ea043;
  --red:      #da3633;
  --yellow:   #d29922;
  --radius:   8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 8px;
}
.nav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary2);
  text-decoration: none;
  white-space: nowrap;
  margin-right: 8px;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  align-items: center;
  margin-left: auto;
  flex-wrap: nowrap;
}
.nav-links a {
  color: var(--text2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: .88rem;
  transition: color .15s, background .15s;
  white-space: nowrap;
  display: block;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg3); }
.btn-nav { background: var(--green) !important; color: #fff !important; font-weight: 600; }
.btn-nav:hover { background: var(--green2) !important; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; margin-left: auto; padding: 4px; }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  z-index: 300;
  list-style: none;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 8px 14px; color: var(--text2); font-size: .88rem; text-decoration: none; white-space: nowrap; }
.dropdown-menu li a:hover { background: var(--bg3); color: var(--text); }

/* Badge */
.badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
  vertical-align: middle;
  line-height: 1.4;
}

/* ── Main container ── */
main.main-container {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.card-sm { padding: 12px 16px; }

/* ── Server Cards ── */
.server-list { display: flex; flex-direction: column; gap: 10px; }
.server-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .15s, transform .1s;
}
.server-card:hover { border-color: var(--primary2); transform: translateY(-1px); }
.server-card.featured { border-color: var(--yellow); }
.server-card.premium  { border-color: #a371f7; }

.server-rank { font-size: 1.1rem; font-weight: 700; color: var(--text2); min-width: 32px; text-align: center; flex-shrink: 0; }
.server-icon { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--bg3); }
.server-icon-placeholder { width: 52px; height: 52px; border-radius: 6px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.server-info { flex: 1; min-width: 0; }
.server-name { font-size: 1rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.server-desc { font-size: .83rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 5px; }
.server-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.tag {
  background: var(--bg3);
  color: var(--text2);
  font-size: .74rem;
  padding: 2px 7px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tag:hover, .tag.active { border-color: var(--primary2); color: var(--primary2); }

.server-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 110px;
  flex-shrink: 0;
}
.online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.online-dot.green { background: #3fb950; }
.online-dot.red   { background: var(--red); }

.vote-btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 6px 16px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  font-family: inherit;
  white-space: nowrap;
}
.vote-btn:hover { background: var(--primary2); }
.vote-btn.voted { background: var(--bg3); color: var(--text2); cursor: default; }

.stat-pill { display: inline-flex; align-items: center; gap: 3px; font-size: .79rem; color: var(--text2); }

/* ── Status badges ── */
.status-badge {
  display: inline-block;
  font-size: .74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-approved  { background: #1e3a2a; color: #3fb950; }
.status-pending   { background: #2d2a16; color: var(--yellow); }
.status-rejected  { background: #3a1e1e; color: var(--red); }
.status-removed   { background: #3a1e1e; color: #f85149; }
.status-featured  { background: #2d2a16; color: var(--yellow); }
.status-premium   { background: #2a1e3a; color: #a371f7; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .84rem; color: var(--text2); margin-bottom: 5px; }
.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  color: var(--text);
  font-size: .93rem;
  font-family: inherit;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary2); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover   { background: var(--primary2); }
.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover   { background: var(--green2); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover    { background: #f85149; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text2); }
.btn-sm  { padding: 4px 11px; font-size: .78rem; }
.btn-block { width: 100%; text-align: center; display: block; }

/* ── Alerts ── */
.alert { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 14px; font-size: .9rem; }
.alert-error   { background: #3d1a1a; border: 1px solid #f85149; color: #f85149; }
.alert-success { background: #1a3d1a; border: 1px solid #3fb950; color: #3fb950; }
.alert-info    { background: #1a2a3d; border: 1px solid #58a6ff; color: #58a6ff; }
.alert-warning { background: #3a2e1a; border: 1px solid var(--yellow); color: var(--yellow); }

/* ── Search bar ── */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 160px; }
.search-bar select { min-width: 130px; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-block;
  padding: 7px 13px;
  border-radius: var(--radius);
  font-size: .88rem;
  text-decoration: none;
  border: 1px solid var(--border);
}
.pagination a { color: var(--text2); background: var(--bg2); }
.pagination a:hover { border-color: var(--primary2); color: var(--primary2); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Layout helpers ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 1.4rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.text-muted { color: var(--text2); }
.text-center { text-align: center; }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Stats strip ── */
.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-align: center; }
.stat-card .stat-num   { font-size: 1.5rem; font-weight: 700; color: var(--primary2); }
.stat-card .stat-label { font-size: .78rem; color: var(--text2); margin-top: 3px; }

/* ── Server detail ── */
.server-detail-header { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.server-detail-icon { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--bg3); }
.server-banner { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 400px; }
thead th { background: var(--bg3); color: var(--text2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 11px 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }

/* ── Auth ── */
.auth-wrap { max-width: 460px; margin: 40px auto; }
.auth-wrap .card { padding: 30px; }

/* ── Profile ── */
.profile-header { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 22px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 16px;
  font-size: .88rem;
  color: var(--text2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary2); border-bottom-color: var(--primary2); }

/* ── Footer ── */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 24px 20px; margin-top: auto; }
.footer-inner { max-width: 1280px; margin: 0 auto; text-align: center; }
.footer-brand { font-size: 1rem; font-weight: 700; color: var(--primary2); margin-bottom: 10px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }
.footer-links a { color: var(--text2); text-decoration: none; font-size: .83rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text2); font-size: .78rem; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 0 12px;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { padding: 10px 16px; border-radius: 0; font-size: .9rem; }
  .nav-dropdown .dropdown-menu { position: static; box-shadow: none; border: none; background: var(--bg3); border-radius: 0; display: none !important; }
  .nav-dropdown.open .dropdown-menu { display: block !important; }
  .nav-dropdown:hover .dropdown-menu { display: none !important; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .server-card { flex-wrap: wrap; }
  .server-stats { min-width: 100%; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .server-detail-header { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .main-container { padding: 16px 12px; }
}
@media (max-width: 480px) {
  .card { padding: 14px; }
  .stats-strip { grid-template-columns: 1fr; }
  .auth-wrap { margin: 16px auto; }
  .server-icon { width: 44px; height: 44px; }
  .server-icon-placeholder { width: 44px; height: 44px; }
}
