/* =====================================================
   DIGITAL DARTS LEAGUE — Unified Stylesheet
   (merged + cleaned)
   ===================================================== */

/* =========================
   1) BASE / GLOBAL
   ========================= */
body {
  margin: 0;
  padding: 0;
  font-family: 'Raleway', sans-serif;
  background-color: #1a1a1a;
  overflow-x: hidden;
}
html { scrollbar-gutter: stable both-edges; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }

/* Optional utility carried over */
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: 1px; }

/* Link colors inside .document areas */
.document a,
.document a:visited { color: #ff7a00; text-decoration: none; font-weight: 500; }
.document a:hover { color: #000; }

/* Highlight message used on index */
.exciting-msg {
  color: #ff7a00 !important;
  font-size: 0.9rem !important;
  margin-top: 0.5rem !important;
  text-align: center !important;
}

/* =========================
   2) NAVBAR & DROPDOWNS
   ========================= */
.navbar {
  background-color: #000;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1500;
  height: 52px !important;
  padding: 0 2rem; /* lock vertical height via height above */
  box-sizing: border-box;
}
.navbar::after {
  content: "";
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 3px;
  background-color: #ff7a00;
}
.nav-left ul {
  list-style: none; display: flex;
  margin: 0; padding: 0; align-items: center;
}
.nav-left li { position: relative; margin-right: 1.5rem; }
.nav-left a {
  color: #fff; text-decoration: none; font-weight: 500;
  font-size: 16px; padding: 10px 15px; white-space: nowrap; display: block;
}
.user-links a { color: #fff; text-decoration: none; font-weight: 500; }
.user-links a:hover { color: #ff7a00; }
.auth-actions a:visited { color: #ff7a00; }

.arrow { display: inline-block; width: 1em; text-align: center; transition: transform 0.3s ease; }
.dropdown.open > a .arrow,
.dropdown-submenu.open > a .arrow { transform: rotate(90deg); }

.dropdown-content,
.dropdown-subcontent {
  display: none;
  position: absolute;
  background-color: #222;
  min-width: 180px;
  border: 1px solid #444;
  z-index: 2005 !important;
  overflow: visible !important;
  opacity: 1 !important;           /* no fade-in; stable layout */
  transition: none !important;
}
.dropdown.open > .dropdown-content,
.dropdown-submenu.open > .dropdown-subcontent { display: block !important; }

.dropdown-content a,
.dropdown-subcontent a {
  padding: 10px 15px;
  color: #fff;
  text-decoration: none;
  display: block;
}
.dropdown-content a:hover,
.dropdown-subcontent a:hover { background-color: #444; }

.dropdown-submenu { position: relative; }
.dropdown-subcontent {
  background-color: #111;
  border-left: 3px solid #ff7a00;
  white-space: nowrap;
}
.dropdown-submenu.open > .dropdown-subcontent {
  top: 100% !important; left: 0 !important; margin-left: 0 !important;
}

/* =========================
   3) PAGE LAYOUT / DOCUMENT
   ========================= */
.document {
  /* top padding clears fixed navbar; bottom clears fixed footer */
  padding: 120px 3rem 70px 3rem;
  max-width: 800px;
  margin: 0 auto;
  background: #fff url("images/combined_footer_overlay.png") no-repeat bottom right;
  background-size: 240px auto;
  color: #000;
  min-height: 100vh;
  box-sizing: border-box;
}
.doc-logo { text-align: center; margin-bottom: 1.5rem; }
.doc-logo img { width: 120px; max-width: 100%; height: auto; }
.title { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 1rem; }
p.welcome { text-align: center; font-size: 15px; color: #333; margin: 0.5rem 0 1rem 0; }

/* =========================
   4) FOOTER (FIXED)
   ========================= */
.fixed-footer {
  position: fixed; bottom: 0; left: 0; width: 100%;
  background: #000; padding: 0.8rem 0;
  display: flex; justify-content: space-around; align-items: center;
  border-top: 3px solid #ff7a00;
  z-index: 1200;
}
.fixed-footer a {
  color: #fff; font-size: 1.6rem; text-decoration: none; transition: color 0.2s ease;
}
.fixed-footer a:hover { color: #ff7a00; }
@media (max-width: 500px) {
  .fixed-footer a { font-size: 1.4rem; }
}

/* =========================
   5) MODALS (GENERIC + LOGIN)
   ========================= */
.modal {
  display: none; position: fixed; z-index: 2000; left: 0; top: 0;
  width: 100%; height: 100%; overflow: auto;
  background-color: rgba(0,0,0,0.6);
}
.modal-content {
  background-color: #fff; margin: 15% auto; padding: 20px;
  border: 3px solid #ff7a00; width: 90%; max-width: 400px;
  border-radius: 8px; text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.modal-content p { color: #333; font-size: 1rem; }
.close { color: #aaa; float: right; font-size: 24px; font-weight: bold; cursor: pointer; }
.close:hover, .close:focus { color: #ff7a00; }

/* Login modal */
#loginModalOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center; justify-content: center;
  z-index: 2000;
}
#loginModal {
  background: #fff; color: #000;
  width: min(92vw, 420px);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  border-top: 4px solid #ff7a00;
}
#loginModal header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem; border-bottom: 1px solid #eee; font-weight: 700;
}
#loginModal header .close-btn {
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
}
#loginModal .content { padding: 1rem; }
#loginModal .actions {
  padding: 0 1rem 1rem 1rem; display: flex; justify-content: flex-end;
}
#loginModal .actions button {
  background: #ff7a00; color: #fff; border: none;
  padding: 0.5rem 1rem; border-radius: 4px; font-weight: 700; cursor: pointer;
  transition: background .2s ease;
}
#loginModal .actions button:hover { background: #e66a00; }

/* =========================
   6) CONTACT FORM
   ========================= */
#contactForm { display: flex; flex-direction: column; gap: 12px; }
#contactForm label { font-weight: 600; margin-bottom: 4px; }
#contactForm input[type="text"],
#contactForm input[type="email"],
#contactForm input[type="tel"],
#contactForm textarea {
  padding: 10px; border: 1px solid #ccc; border-radius: 6px;
  font-size: 14px; width: 100%; box-sizing: border-box;
}
#contactForm textarea { min-height: 120px; resize: vertical; }
#contactForm button {
  background-color: #ff7a00; color: #fff; padding: 10px 18px;
  border: none; border-radius: 6px; cursor: pointer; font-weight: 700;
  width: auto !important; display: inline-block !important;
}
#contactForm button:hover { background-color: #e66a00; }
#contactForm .note { font-size: 0.85rem; color: #666; margin-top: -8px; }

/* Honeypot hidden */
.hp-wrap {
  display: none !important; visibility: hidden !important;
  height: 0 !important; overflow: hidden !important;
  margin: 0 !important; padding: 0 !important;
}

/* =========================
   7) RULES PAGES
   ========================= */
.rules-page h2 {
  font-size: 15px; margin-top: 1.8rem; margin-bottom: 0.4rem; font-weight: 700;
}
.rules-page ul { margin-top: 0.5rem; padding-left: 1.2rem; }
.rules-page li { margin-bottom: 0.5rem; line-height: 1.5; }

/* =========================
   8) TABLES / OPPONENT FINDER
   ========================= */
.players-table-wrapper {
  display: flex; justify-content: center; width: 100%;
  overflow-x: visible; padding-bottom: 1rem;
}
.players-table {
  width: 100%; border-collapse: collapse;
  margin: 20px auto 0 auto; table-layout: auto;
}
.players-table th,
.players-table td {
  border: 1px solid #ccc; padding: 8px; text-align: left;
  word-break: break-word; white-space: normal;
}
.players-table th { background-color: #ff7a00; color: #fff; }
.players-table tr:nth-child(even) { background-color: #f9f9f9; }
.players-table a,
.players-table a:visited { color: #000; text-decoration: none; font-weight: 500; }
.players-table a:hover { color: #ff7a00; }

@media (max-width: 700px) {
  .players-table-wrapper {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto;
    max-width: 100vw; box-sizing: border-box;
  }
  .players-table { width: 100%; max-width: 100%; min-width: unset; table-layout: auto; }
}

/* Add Opponent form (scoped table) */
.add-opponent-table {
  width: 100%; max-width: 500px; margin: 0 auto 20px; border-collapse: collapse;
  font-family: 'Raleway', sans-serif;
}
.add-opponent-table td {
  padding: 10px 8px; font-size: 16px; vertical-align: middle; color: #000;
}
.add-opponent-table label { font-weight: 600; white-space: nowrap; }
.add-opponent-table input[type="text"],
.add-opponent-table input[type="tel"] {
  width: 100%; padding: 8px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px;
}
.add-opponent-form .auth-actions { text-align: center; margin-top: 20px; }
.add-opponent-form button[type="submit"] {
  background-color: #ff7a00; color: #fff; border: none; padding: 10px 20px;
  font-weight: 700; font-size: 16px; border-radius: 6px; cursor: pointer;
  transition: background-color 0.3s ease;
}
.add-opponent-form button[type="submit"]:hover { background-color: #e96b00; }

/* Auth forms (login/register) */
.auth-form-table {
  width: 100%; max-width: 500px; margin: 0 auto 20px; border-collapse: collapse;
}
.auth-form-table td {
  padding: 10px 8px; font-size: 16px; vertical-align: middle; color: #000;
}
.auth-form-table label { font-weight: 600; white-space: nowrap; }
.auth-form-table input[type="text"],
.auth-form-table input[type="password"],
.auth-form-table input[type="email"] {
  width: 100%; padding: 8px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px;
}
.auth-form-actions { text-align: center; margin-top: 20px; }
.auth-form-actions button[type="submit"],
.auth-form-actions input[type="submit"] {
  background-color: #ff7a00; color: #fff; border: none; padding: 10px 20px;
  font-weight: 700; font-size: 16px; border-radius: 6px; cursor: pointer;
  transition: background-color 0.3s ease;
}
.auth-form-actions button[type="submit"]:hover,
.auth-form-actions input[type="submit"]:hover { background-color: #e66a00; }

/* =========================
   9) SEARCH BAR (opponent finder)
   ========================= */
.search-bar { text-align: center; margin-bottom: 20px; }
.search-bar input {
  padding: 10px; border-radius: 6px; border: 1px solid #ccc; font-size: 15px; width: 280px;
}
@media screen and (max-width: 480px) {
  .search-bar input { width: 90%; }
}

/* =========================
   10) DASHBOARD BUTTONS
   ========================= */
.dash-btn {
  display: inline-block;
  background-color: #000;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  min-width: 140px;
  transition: background-color 0.2s ease;
}
.dash-btn:hover { background-color: #e66a00; }
