/* Basic styling for JPL PHP application */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f9fafb;
  color: #333;
  line-height: 1.6;
}

/* Prevent horizontal overflow on small screens */
html, body {
  overflow-x: hidden;
}

/* Header: sticky, space-between layout */
header {
  background-color: #0d253f;
  color: #fff;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  /* space out brand and nav/toggle */
  justify-content: space-between;
  /* stick to top while scrolling */
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .brand {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

header .brand img {
  height: 40px;
  width: 40px;
  margin-right: 0.5rem;
}

/* Navigation list (desktop) */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  /* left-align links within nav container; header layout pushes nav to right */
  justify-content: flex-start;
}

nav li {
  margin-left: 1rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.2s ease-in;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

nav a.active {
  background-color: #e63946;
}

/* Let nav size itself naturally; header’s flex spacing handles alignment */
header nav {
  /* no margin; space is managed by header’s flex layout */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1, h2, h3 {
  margin-top: 0;
  color: #0d253f;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table thead {
  background-color: #0d253f;
  color: #fff;
}

table th, table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: middle;
}

table tbody tr:nth-child(even) {
  background-color: #f2f4f7;
}

.team-name {
  display: flex;
  align-items: center;
}

.team-name img {
  width: 32px;
  height: 32px;
  margin-right: 0.5rem;
}

/* Forms */
form {
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 1rem 0;
}

form .form-group {
  margin-bottom: 1rem;
}

form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: bold;
}

form input[type="text"],
form input[type="number"],
form input[type="file"],
form textarea,
form select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

form button {
  background-color: #0d253f;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease-in;
}

form button:hover {
  background-color: #e63946;
}

.success {
  color: #2b9348;
  margin-top: 1rem;
}

.error {
  color: #d62828;
  margin-top: 1rem;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.gallery-grid img {
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

footer {
  background-color: #0d253f;
  color: #fff;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}

/*
 * Responsive navigation styling
 *
 * On small screens, the navigation menu collapses into a hamburger icon.
 * When the hamburger is activated, the navigation list is displayed in a
 * column and covers the full width under the header. The `.nav-open` class
 * applied to the header toggles the menu open state.
 */
header .nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  /* optional gap between nav and toggle on desktop */
  margin-left: 1rem;
}

header .nav-toggle:focus {
  outline: 2px solid #e63946;
  outline-offset: 2px;
}

header .nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #fff;
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 900px) {
  /* keep header sticky on small screens */
  header {
    position: sticky;
  }

  /* reset nav margin on mobile; nav takes full width */
  header nav {
    margin-left: 0;
  }

  /* show hamburger button on mobile */
  header .nav-toggle {
    display: block;
  }

  /*
   * Mobile nav styling: use transform/opacity for flip animation.
   * Keep the nav list in the DOM so transitions can occur.
   */
  header nav ul {
    flex-direction: column;
    gap: 0;
    background-color: #0d253f;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 999;
    /* hidden by default */
    max-height: 0;
    overflow: hidden;
    transform-origin: top;
    transform: rotateX(-90deg);
    opacity: 0;
    transition: max-height 0.4s ease-in-out,
                transform 0.4s ease-in-out,
                opacity 0.4s ease-in-out;
    /* align stacked items to the start */
    justify-content: flex-start;
  }

  header.nav-open nav ul {
    /* allow space for links when open */
    max-height: 500px;
    transform: rotateX(0deg);
    opacity: 1;
  }

  nav li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  nav li:last-child {
    border-bottom: none;
  }

  nav a {
    padding: 1rem;
    display: block;
    width: 100%;
  }

  /* turn hamburger into an X when open */
  header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Pagination styling */
.pagination {
  margin-top: 1.5rem;
  text-align: center;
}

.pagination a {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0.5rem 0.75rem;
  background: #0d253f;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
}

.pagination a.active {
  background: #e63946;
}

.pagination a.disabled {
  pointer-events: none;
  opacity: 0.4;
}

/* ======= Modern Auth Page Styles ======= */
:root{
  --bg: #0b1020;
  --bg-accent: #131a33;
  --card: rgba(255,255,255,0.08);
  --card-stroke: rgba(255,255,255,0.12);
  --text: #e8ecf2;
  --muted: #9aa5b1;
  --primary: #4da3ff;
  --primary-strong: #2e80ff;
  --danger: #ff5d6c;
  --focus: #9ecbff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* Background gradient with subtle animated glow */
.auth-body{
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(77,163,255,0.20), transparent 60%),
    radial-gradient(1000px 700px at -10% 80%, rgba(255,93,108,0.18), transparent 60%),
    linear-gradient(180deg, #0b1020, #0b1020 40%, #0e1430);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

.auth-wrapper{
  display: grid;
  place-items: center;
  padding: 4rem 1rem;
}

.auth-card{
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  backdrop-filter: blur(10px);
  animation: cardIn 400ms ease-out;
}

@keyframes cardIn{
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.auth-brand{
  text-align: center;
  margin-bottom: 1.25rem;
}

.brand-badge{
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(46,128,255,0.45);
  margin-bottom: 0.75rem;
}

.auth-title{
  font-size: 1.4rem;
  margin: 0 0 .25rem 0;
}

.auth-subtitle{
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.auth-form{
  margin-top: 1rem;
}

.form-group{
  margin-bottom: 1rem;
}

label{
  display: inline-block;
  margin-bottom: .4rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: .2px;
}

.input{
  width: 100%;
  padding: .85rem .95rem;
  border-radius: 12px;
  border: 1px solid var(--card-stroke);
  background: rgba(10,12,25,0.6);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.input::placeholder{ color: #a6b1c3; opacity: .7; }

.input:focus{
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(158,203,255,.15);
  background: rgba(12,14,30,0.8);
}

.password-field{
  position: relative;
}

.pw-toggle{
  position: absolute;
  right: .4rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  padding: .4rem .5rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: 8px;
  color: #c6d2e3;
}
.pw-toggle:hover{ background: rgba(255,255,255,.06); }

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s, background .2s, border-color .2s;
}

.btn-primary{
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
  box-shadow: 0 8px 24px rgba(46,128,255,0.35);
}
.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(46,128,255,0.45);
}
.btn-primary:active{ transform: translateY(0); }

.alert{
  border-radius: 12px;
  padding: .85rem 1rem;
  margin: .5rem 0 1rem;
  font-weight: 600;
}
.alert-error{
  background: rgba(255,93,108,0.12);
  border: 1px solid rgba(255,93,108,0.35);
  color: #ffdce0;
}

.form-meta{
  margin-top: .75rem;
  display: flex;
  justify-content: center;
}
.meta-text{
  color: var(--muted);
  font-size: .85rem;
}

/* Make sure header/footer includes don’t crowd the auth card */
.container, .auth-wrapper{ max-width: 100%; }
/* ===== Dropdown (Player Registration) ===== */

/* Ensure the dropdown <li> can position its submenu */
nav li.dropdown { position: relative; }

/* Add a small caret on the parent link */
nav li.dropdown > a::after {
  content: "▾";
  font-size: 0.7em;
  margin-left: 6px;
  opacity: 0.85;
}

/* Submenu base styles (desktop defaults) */
nav li .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;           /* sits just below the parent li */
  left: 0;
  min-width: 180px;
  background: #fff;    /* light panel on dark header */
  border: 1px solid rgba(13, 37, 63, 0.15);
  border-radius: 6px;
  padding: 6px 0;
  z-index: 1001;
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
}

/* Submenu items */
nav li .dropdown-menu li { margin: 0; border: 0; }
nav li .dropdown-menu a {
  display: block;
  padding: 0.55rem 0.9rem;
  color: #0d253f;          /* dark text on white */
  background: transparent;
  border-radius: 0;
}

/* Hover state for submenu items */
nav li .dropdown-menu a:hover {
  background: #f2f4f7;
  color: #0d253f;
}

/* SHOW submenu on hover (desktop) */
nav li.dropdown:hover > .dropdown-menu {
  display: block;
}

/* ===== Mobile behavior (<= 900px) ===== */
@media (max-width: 900px) {
  /* Make submenu flow inside the stacked mobile menu */
  nav li .dropdown-menu {
    position: static;        /* stack in the flow */
    width: 100%;
    min-width: 0;
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-radius: 0;
    background: #0d253f;     /* match header background */
    box-shadow: none;
    padding: 0;
  }

  /* Mobile submenu links use light text to match dark bg */
  nav li .dropdown-menu a {
    color: #fff;
    padding: 0.9rem 1rem;
  }

  nav li .dropdown-menu a:hover {
    background: rgba(255,255,255,0.12);
  }

  /* Hide submenu by default on mobile… */
  nav li .dropdown-menu { display: none; }

  /*
   * …and reveal it when the parent <li> is focused-within.
   * This enables tap-to-open (first tap focuses the parent link).
   * Works without JS.
   */
  nav li.dropdown:focus-within > .dropdown-menu {
    display: block;
  }

  /* Rotate caret when open (focus-within) */
  nav li.dropdown:focus-within > a::after {
    transform: rotate(180deg);
    display: inline-block;
  }
}

/* Improve form labels & input placeholders */
.auth-card label {
  color: #0d253f;         /* dark blue (same as site heading color) */
  font-weight: 600;
}

.auth-card .input {
  background: #fff;       /* pure white input background */
  color: #0d253f;         /* dark text */
  border: 1px solid #ccc; /* subtle border */
}

.auth-card .input::placeholder {
  color: #888;            /* medium gray placeholder */
  opacity: 1;             /* make sure it's visible */
}

form .form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text); /* pulls from your auth color scheme */
  letter-spacing: 0.4px;
}

/* Make form labels visible and consistent */
form .form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0d253f;   /* dark navy (same as headings) */
  text-transform: none;
  letter-spacing: 0.3px;
}


/* Make labels and input text visible on white background */
.card label {
  color: #0d253f;          /* dark navy */
  font-weight: 600;
}

.card .input,
.card .textarea {
  color: #0d253f;          /* dark text */
  background: #fff;        /* keep white background */
}

.card .input::placeholder,
.card .textarea::placeholder {
  color: #667085;          /* softer gray for placeholder */
}
/* ====== NEW NAV (desktop + full-screen mobile) ====== */
.site-header {
  position: sticky; top: 0; z-index: 1100;
  background: #0d253f; color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.site-header .nav-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:.6rem 1rem; gap:10px;
}
.site-header .brand{ display:flex; align-items:center; gap:.5rem; color:#fff; text-decoration:none; font-weight:800; font-size:1.25rem; letter-spacing:.3px; }
.site-header .brand img{ width:40px; height:40px; border-radius:8px; }

.desktop-nav{ display:block; }
.desktop-nav .menu{ display:flex; gap:.25rem; align-items:center; margin:0; padding:0; list-style:none; }
.desktop-nav .menu > li{ position:relative; }
.desktop-nav a, .desktop-nav .dd-toggle{
  display:inline-block; padding:.55rem .85rem; border-radius:8px; color:#fff; text-decoration:none;
  font-weight:700; letter-spacing:.2px; background:transparent; border:0; cursor:pointer;
}
.desktop-nav a:hover, .desktop-nav .dd-toggle:hover{ background:rgba(255,255,255,.12); }
.desktop-nav a.active{ background:#e63946; }

.desktop-nav .has-dropdown .dropdown{
  position:absolute; left:0; top:calc(100% + 8px); min-width:210px;
  background:#fff; color:#0d253f; border:1px solid rgba(13,37,63,.15); border-radius:10px;
  box-shadow:0 16px 28px rgba(0,0,0,.18); padding:6px 0; list-style:none; margin:0; display:none;
}
.desktop-nav .has-dropdown.open .dropdown{ display:block; }
.desktop-nav .dropdown a{
  display:block; color:#0d253f; padding:.65rem .9rem; border-radius:0; font-weight:700; text-decoration:none;
}
.desktop-nav .dropdown a:hover{ background:#f2f4f7; }

/* Hamburger */
.nav-toggle{ display:none; background:none; border:0; cursor:pointer; padding:.4rem; }
.nav-toggle span{ display:block; width:26px; height:3px; background:#fff; margin:4px 0; border-radius:2px; }

/* ===== Mobile drawer ===== */
.mnav{
  position:fixed; inset:0; background:rgba(4,10,18,.55);
  backdrop-filter:saturate(130%) blur(4px);
  display:none; z-index:2000;
}
.mnav.active{ display:block; }
.mnav .mnav-panel{
  position:absolute; left:0; top:0; height:100%; width:min(92vw, 480px);
  background:
          radial-gradient(900px 600px at 80% -10%, rgba(77,163,255,.16), transparent 60%),
          radial-gradient(900px 600px at -10% 80%, rgba(255,93,108,.14), transparent 60%),
          linear-gradient(180deg, #0f233b, #08192d 60%);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  transform: translateX(-100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
  overflow-y:auto; -webkit-overflow-scrolling:touch;
}
.mnav.active .mnav-panel{ transform: translateX(0); }

.mnav-top{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:1rem 1.1rem; border-bottom:1px solid rgba(255,255,255,.12);
}
.mnav-top .brand{ display:flex; align-items:center; gap:.6rem; color:#fff; text-decoration:none; font-weight:900; letter-spacing:.3px; }
.mnav-top .brand img{ width:44px; height:44px; border-radius:10px; }
.mnav-close{
  width:42px; height:42px; border-radius:10px; border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.08); color:#fff; font-size:22px; line-height:1;
  display:grid; place-items:center; cursor:pointer;
}

.mnav-list{ list-style:none; margin:0; padding:.4rem 0 1rem; }
.mnav-list > li{ border-bottom:1px solid rgba(255,255,255,.10); }
.mnav-list a, .mnav .collapser{
  display:block; width:100%; text-align:left; color:#fff; text-decoration:none; font-weight:900;
  padding:1rem 1.1rem; letter-spacing:.4px; text-transform:uppercase; background:none; border:0; cursor:pointer;
}
.mnav-list a.active, .mnav-list a:hover, .mnav .collapser:hover{ background:rgba(255,255,255,.12); }

/* collapsible in mobile */
.mnav .collapsible .sublist{
  display:none; list-style:none; margin:0; padding:0 0 .5rem;
  background:rgba(255,255,255,.05);
}
.mnav .collapsible.open .sublist{ display:block; }
.mnav .sublist a{ text-transform:none; letter-spacing:.2px; padding:.9rem 1.4rem; font-weight:700; }
.mnav .chev{ float:right; transition: transform .2s; }
.mnav .collapsible.open .chev{ transform: rotate(180deg); }

/* Breakpoint behaviour */
@media (max-width: 1000px){
  .desktop-nav{ display:none; }
  .nav-toggle{ display:block; }
}