/* === LEG8 Unified Styles (Optimized) === */
:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #2563eb;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

/* --- Header --- */
.site-header {
  padding: 16px 20px;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* --- Layout --- */
.container {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}
.card {
  background: var(--card);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* --- Typography --- */
h1, h2, h3 { margin: 0 0 8px; }

/* --- Buttons --- */
button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
button:hover { filter: brightness(1.1); }
button.add { background: #4b6ef5; }
button.edit, button.approve { background: #4caf50; }
button.delete, button.reject { background: #dc3545; }

/* --- Inputs --- */
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #0b1220;
  color: var(--text);
  transition: all 0.2s ease;
}
textarea { resize: vertical; min-height: 70px; }

/* --- Search Results --- */
.results-list { list-style: none; padding: 0; margin-top: 10px; }
.player-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px;
  background: #1e293b; margin: 4px 0;
  cursor: pointer; transition: background 0.2s;
}
.player-item:hover { background: var(--accent); color: white; }
.player-item img { width: 40px; height: 40px; border-radius: 50%; }

/* --- Flags / Status Badges --- */
.flag, .status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}
.flag.green, .status-badge.green { background: #16a34a; color: #fff; box-shadow: 0 0 6px #16a34a88; }
.flag.yellow, .status-badge.yellow { background: #facc15; color: #111; box-shadow: 0 0 6px #facc1588; }
.flag.red, .status-badge.red { background: #dc2626; color: #fff; box-shadow: 0 0 6px #dc262688; }

/* --- Modal --- */
.modal.hidden { display: none; }
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #111827;
  padding: 20px;
  border-radius: 12px;
  width: 90%; max-width: 600px; max-height: 90vh;
  overflow-y: auto; position: relative;
}
.close-button {
  position: absolute; top: 10px; right: 14px;
  font-size: 1.5rem; cursor: pointer; color: #aaa;
}
.close-button:hover { color: white; }

/* --- Profile --- */
.profile-header {
  display: flex; gap: 10px; align-items: center; margin-bottom: 12px;
}
.profile-header img {
  width: 80px; height: 80px;
  border-radius: 8px;
  object-fit: cover;
}
.account-links ul {
  list-style: none; padding: 0; margin: 5px 0 0;
}
.account-links li {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.account-icon { width: 20px; height: 20px; object-fit: contain; }

/* --- `s --- */
.comment {
  background: #1f2937;
  padding: 8px;
  margin: 6px 0;
  border-radius: 6px;
}
.comment strong { color: #93c5fd; }
.comment small { color: #9ca3af; }

/* --- Voting --- */
.vote-bar { display: flex; gap: 10px; margin: 8px 0 12px; }
.vote-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.vote-btn:hover { filter: brightness(1.15); }

.vote-btn.active-like {
  background: #16a34a !important;
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.5) !important;
}
.vote-btn.active-dislike {
  background: #dc2626 !important;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.5) !important;
}

/* --- Leaderboards --- */
.leaderboards {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  align-items: stretch;
} 
.ranking-box {
  background: var(--card);
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 16px;
  width: 420px;
  display: flex;
  flex-direction: column;
}
.ranking-box h2 {
  margin: 0 0 8px;
  text-align: center;
  border-bottom: 1px solid #1f2937;
  padding-bottom: 8px;
}
.ranking-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 350px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 480px; /* adjust this to match height of 10 players visually */
}
.ranking-list li {
  display: flex;
  align-items: center;          /* centers photo + text vertically */
  gap: 10px;
  padding: 8px 12px;
  background: #1e293b;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}



/* ✅ Likes: fixed width for alignment (handles 1–4 digits) */
.ranking-list li .likes {
  margin-left: auto;                 /* push to right edge */
  width: 60px;                       /* fixed width column for consistency */
  text-align: right;                 /* align numbers neatly */
  color: #facc15;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  justify-content: flex-end;         /* align emoji + number as one unit */
  align-items: center;
  gap: 4px;
  padding-right: 4px;
}

.ranking-list li:hover { background: var(--accent); color: white; }
.ranking-list img { width: 64px; height: 64px; border-radius: 50%;}

/* Ensure photo and name line up perfectly */
.ranking-list img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;               /* removes inline-space gap */
  margin: 0;
}

/* Name + stats stay aligned with photo */
.ranking-list li span {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

/* Optional: tighten icon/text spacing */
.ranking-list li span svg,
.ranking-list li span img.icon {
  vertical-align: middle;
  margin-right: 4px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }

/* --- Admin Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border: 1px solid #222;
  border-radius: 8px;
  overflow: hidden;
}
th {
  background: #181818;
  color: #bbb;
  text-align: left;
  padding: 10px;
  font-weight: 600;
  border-bottom: 1px solid #222;
}
td {
  padding: 10px;
  border-bottom: 1px solid #222;
  vertical-align: middle;
}
tr:hover { background: #1a1a1a; }

/* --- Alerts --- */
.alert {
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  color: #ddd;
}
.alert.success { border-left: 4px solid #4caf50; }
.alert.error { border-left: 4px solid #ff4c4c; }

@media (max-width: 900px) {
  .ranking-box { width: 100%; max-width: 420px; }
}

/* --- PLAYER PHOTO STYLES --- */

/* Player photo in search results */
.player-item img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #1f2937;
  background: #0b1220;
}

/* Profile modal photo */
.profile-header img {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #1f2937;
  background: #0b1220;
}

/* Admin manage_players.php photo preview */
.preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #333;
  background: #111;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.preview:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* Placeholder image if no photo */
img[alt="No photo"], .default-photo {
  background: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Upload button (admin) */
.upload-label {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 6px;
  transition: filter 0.2s ease;
}
.upload-label:hover {
  filter: brightness(1.1);
}

.player-item img,
.profile-header img,
.preview { border-radius: 6px !important; }

/* --- Account Modal Styles --- */
#accountModal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#accountModal .modal-content {
  background: #1b1b1b;
  color: #fff;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 20px;
  width: 400px;
  max-height: 85vh;
  overflow-y: auto;
}

/* --- Account Item Row --- */
.account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #222;
  font-size: 14px;
}

.account-item:last-child {
  border-bottom: none;
}

/* --- Icon beside text --- */
.account-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
}

/* --- Make platform + handle visually grouped --- */
.account-item span {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.account-item span strong {
  color: #9ca3af;
  font-weight: 500;
}

/* Reuse your modal styles. Only small additions here */
.auth-button {
  margin-left: auto;
  background: #2563eb;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s;
}
.auth-button:hover { filter: brightness(1.1); }

.auth-modal { max-width: 420px; }

.auth-modal h2 { text-align: center; margin-bottom: 12px; }

.modal-actions {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 12px;
}

.account-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
.account-row select,
.account-row input {
  flex: 1;
}
.account-row .remove-account {
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 8px;
  font-weight: bold;
  transition: background 0.2s;
}
.account-row .remove-account:hover {
  background: #ef4444;
}

/* --- Share button inside modal --- */
.share-btn {
  background: #2563eb;
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}
.share-btn:hover {
  background: #3b82f6;
}

/* --- Toast notification --- */
.copy-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #111827;
  color: #e5e7eb;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}
.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Optional: modal actions area */
.modal-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* === Profile Box (Top Section in Modal) === */
.profile-box {
  background: #1e293b;
  border: 1px solid #2d3748;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.2s ease;
}

.profile-box:hover {
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.25);
}

/* Photo and Share Button */
.profile-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-photo-section .profile-picture {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #2b3950;
  background: #0f172a;
}

.share-btn {
  margin-top: 8px;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.share-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Info Section */
.profile-info {
  flex: 1;
}

.profile-info h2 {
  margin: 0 0 6px;
}

.profile-info p {
  margin: 0 0 6px;
  color: #cbd5e1;
  font-size: 0.95rem;
}

/* === Comment Box === */
.comment-box {
  background: #1e293b;
  border: 1px solid #2d3748;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.comment-box h3 {
  margin-bottom: 8px;
  color: #e2e8f0;
}

.comment-box input,
.comment-box textarea {
  width: 100%;
  background: #0f172a;
  border: 1px solid #2d3748;
  border-radius: 8px;
  color: #f8fafc;
  padding: 8px 10px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.comment-box input:focus,
.comment-box textarea:focus {
  border-color: #2563eb;
  outline: none;
}

.post-comment-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.post-comment-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* --- How to Use Section --- */
.how-to-use {
  background: #111827;
  border: 1px solid #1f2937;
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 700px;
  margin: 0 auto 16px auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.how-to-use strong {
  color: var(--accent);
}

/* --- Footer --- */
.site-footer {
  background: #0f172a;
  border-top: 1px solid #1f2937;
  padding: 8px 0;                /* Reduced from 20px */
  color: var(--muted);
  font-size: 13px;               /* Slightly smaller text */
  margin-top: 20px;              /* Less spacing above footer */
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;                      /* Tighter spacing */
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-logo {
  width: 28px;                   /* Smaller logo */
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(37,99,235,0.3));
}

.footer-text {
  margin: 0;
  color: var(--muted);
}

.footer-right {
  text-align: right;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links span {
  color: #374151;
  margin: 0 4px;
}

/* --- Header --- */
.site-header {
  padding: 16px 20px;
  border-bottom: 1px solid #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(37,99,235,0.4));
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.site-tagline {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

/* --- Recently Added Players --- */
.recently-added {
  text-align: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  animation: fadeIn 0.5s ease-in-out;
}

.recently-added a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.recently-added a:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === LEG8 Tag Styling === */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}

.tag-badge {
  background: #1d4ed8;
  color: #f9fafb;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: background 0.2s ease;
}

.tag-badge:hover {
  background: #2563eb;
}

.tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 15px;
}

.tag-checkboxes label {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid #2563eb;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: #93c5fd;
  cursor: pointer;
  user-select: none;
}

.tag-checkboxes input {
  margin-right: 5px;
  accent-color: #2563eb;
}

/* === Announcements Section (Compact & Matching "How to Use") === */
.announcement-box {
  background: var(--card);
  border: 1px solid rgba(37, 99, 235, 0.3);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.15);
  margin: 24px auto 40px;
  padding: 18px 22px;
  max-width: 800px;
  border-radius: 10px;
  color: var(--text);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  transition: all 0.25s ease;
}

.announcement-box:hover {
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.announcement-box h2 {
  color: #60a5fa;
  margin-bottom: 10px;
  font-size: 1.3em;
  font-weight: 600;
  border-bottom: 1px solid rgba(96, 165, 250, 0.2);
  padding-bottom: 5px;
}

.announcement-content {
  color: #d1d5db;
  font-size: 0.9rem;
}

.announcement-content p {
  margin: 6px 0;
}

.announcement-content strong {
  color: #93c5fd;
}

.tag-list {
  margin-top: 4px;
}

.tag-badge {
  display: inline-block;
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 4px;
}

/* === Compact Stats Inline === */
.stats-inline {
  text-align: center;
  font-size: 0.95rem;
  color: #93c5fd; /* soft blue */
  margin: 20px 0 10px;
  letter-spacing: 0.3px;
}

.stats-inline span {
  font-weight: 600;
  color: #60a5fa; /* bright blue */
}
