/* =========================================================
   1) Base / Layout
   ========================================================= */

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f6f7f9;
  color: #222;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
}

.warning {
    background-color: #fdf9e6; /* A light yellow background */
    border: 1px solid #ef4444;  /* A red border */
    color: #ef4444;            /* Red text */
    padding: 15px;             /* Space between the border and the content */
    margin-bottom: 20px;       /* Space below the warning box */
    border-radius: 5px;        /* Rounded corners */
    font-size: 25px;
    text-align: center;

}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.page-header h2 {
  margin: 0;
}

a.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  border: none;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

a.btn:hover {
  background: #1d4ed8;
}

/* =========================================================
   2) Navbar (desktop + mobile dropdown)
   ========================================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;

  background: #01193b;
  padding: 12px 20px;

  display: flex;
  align-items: center;
  gap: 12px;
}

/* Brand (trophy + title) */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 10px;
}

.nav-logo {
  height: 28px;
  width: auto;
}

.nav-title {
  font-weight: 700;
  color: #f9fafb;
  white-space: nowrap;
}

/* The link container */
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap; /* allows nice wrap on medium widths */
}

/* Links */
.navbar a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}

.navbar a:hover {
  background: #374151;
  color: #fff;
}

.navbar a.active {
  background: #2563eb;
  color: #fff;
}

/* User label */
.nav-user {
  margin-left: auto;
  font-size: 14px;
  color: #e5e7eb;
  white-space: nowrap;
}

/* Hamburger toggle (bars) */
.nav-toggle {
  display: none; /* shown on mobile */
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-toggle:hover {
  background: rgba(229, 231, 235, 0.18);
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #e5e7eb;
  margin: 5px 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

/* When open → X */
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hide title on very small screens */
@media (max-width: 600px) {
  .nav-title { display: none; }
}

/* Mobile dropdown */
@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }

  /* Keep brand left, toggle right */
  .navbar { gap: 10px; }

  .nav-links {
    position: absolute;
    top: 58px;
    left: 12px;
    right: 12px;
    z-index: 9999;

    flex-direction: column;
    align-items: stretch;
    gap: 6px;

    background: #01193b;
    border: 1px solid rgba(229,231,235,0.25);
    border-radius: 12px;
    padding: 10px;

    box-shadow: 0 10px 25px rgba(0,0,0,0.25);

    /* slide-down animation setup */
    transform-origin: top;
    transform: translateY(-8px) scaleY(0.96);
    opacity: 0;
    pointer-events: none;
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .nav-links.open {
    transform: translateY(0) scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 10px 12px; /* tap-friendly */
    border-radius: 10px;
  }
}


/* =========================================================
   3) Tables (generic + sticky headers)
   ========================================================= */

table {
  width: 100%;
  background: #fff;
  margin-top: 12px;

  border-collapse: separate;   /* important for sticky headers */
  border-spacing: 0;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f3f4f6;
  font-weight: 600;
}

tbody tr:nth-child(even) { background: #f9fafb; }
tbody tr:hover { background: #eef2ff; }

.table-scroll {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f3f4f6;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f4f6;
}

/* Group header rows */
.group-header th {
  background: #e5e7eb;
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-top: 50px solid #f3f4f6;
}


/* =========================================================
   4) Inputs / Forms
   ========================================================= */

form { margin-top: 12px; }

form label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

form > div,
form p {
  margin-bottom: 12px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  max-width: 300px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #c9c9c9;
  border-radius: 2px;
  background-color: #ffffff;
}


/* Modern compact select styling */
select {
  appearance: none;            /* remove native arrow */
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;

  padding: 4px 26px 4px 8px;
  font-size: 13px;
  font-family: inherit;

  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;

  /* custom arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23374151' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6 6 6-6' stroke='%23374151' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 12px;
}

select:hover {
  border-color: #2563eb;
}

select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}



/* Excel-like number input */
input[type="number"] {
  width: 30px;
  max-width: 30px;
  padding: 2px 4px;
  font-size: 14px;
  font-family: inherit;
  text-align: center;

  border: 1px solid #c9c9c9;
  border-radius: 2px;
  background-color: #ffffff;
}

/* Focus */
input[type="number"]:focus,
select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #2a6edb;
  box-shadow: inset 0 0 0 1px #2a6edb;
}

/* Remove number spinners (Chrome, Edge, Safari) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove number spinners (Firefox) */
input[type="number"] { -moz-appearance: textfield; }

/* Prevent iOS zoom */
@media (max-width: 768px) {
  input[type="number"] { font-size: 16px; }
}


/* =========================================================
   5) Buttons / CTA
   ========================================================= */

button {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button:hover { background: #1d4ed8; }

button.secondary { background: #6b7280; }
button.secondary:hover { background: #4b5563; }

/* Big CTA button */
.cta {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 32px;

  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;

  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);

  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}


/* Link styled like primary button */
a.btn {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  border: none;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

a.btn:hover {
  background: #1d4ed8;
}

a.btn.secondary {
  background: #6b7280;
}

a.btn.secondary:hover {
  background: #4b5563;
}

/* =========================================================
   6) Flash messages
   ========================================================= */

.flash {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.flash li {
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}


/* =========================================================
   7) Locked rows
   ========================================================= */

.locked { opacity: 0.6; }

.locked input,
.locked select,
.locked button {
  pointer-events: none;
}


/* =========================================================
   8) Group standings block (non-sticky per-table)
   ========================================================= */

.group-block {
  margin: 18px 0 26px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.group-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.group-title {
  font-weight: 700;
  padding: 10px 12px;
  background: #e5e7eb;
  border-bottom: 1px solid #d1d5db;
}

.table-wrapper { overflow-x: auto; }


/* =========================================================
   9) Specialized tables (admin / predictions / standings)
   ========================================================= */

table.admin,
table.predictions,
table.standings {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

table.admin th, table.admin td,
table.predictions th, table.predictions td,
table.standings th, table.standings td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}

/* Admin alignment helpers */
table.admin th.align-right,
table.admin td.align-right { text-align: right; }

table.admin th.align-center,
table.admin td.align-center { text-align: center; }

table.admin th {
  background: #6093f8;
  font-weight: 600;
}

/* Admin zebra */
table.admin:last-of-type tr:nth-child(odd) { background: #e0e9f1; }
table.admin:last-of-type tr:nth-child(even) { background: #a4bbd3; }

/* Predictions alignment */
table.predictions th.align-center,
table.predictions td.align-center { text-align: center; }

/* Standings table */
table.standings th,
table.standings td { text-align: center; }

table.standings th.align-left,
table.standings td.align-left { text-align: left; }

table.standings th {
  background: #f3f4f6;
  font-weight: 600;
}

/* Optional zebra for team rows within group blocks */
.group-block table.standings:last-of-type tr:nth-child(even) {
  background: #f9fafb;
}

.score-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;           /* separation between score and select */
}

.score-box {
  display: flex;
  align-items: center;
  gap: 6px;           /* separation between numbers and ":" */
}

.score-sep {
  font-weight: 600;
}

/* Override global select width */
.score-stack select {
  font-size: 12px;
  padding: 3px 12px 3px 6px;
}
.pk-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================
   10) Hero section (index page)
   ========================================================= */

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
}

.hero h2 {
  font-size: 1.8rem;
  font-weight: 500;
  margin: 0;
  color: #374151;
}

.hero-image img {
  max-width: 240px;
  width: 100%;
  margin-top: 24px;
}

.countdown-box {
  margin: 40px auto;
  padding: 40px;
  text-align: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  max-width: 600px;
}

.countdown-number {
  font-size: 5rem;
  font-weight: 800;
  margin: 10px 0;
}


@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .hero h2 { font-size: 1.4rem; }
  .hero-image img { max-width: 180px; }

  th, td { padding: 8px; }
  input[type="number"] { max-width: 60px; }
}


/* =========================================================
   11) Admin cards
   ========================================================= */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.admin-card {
  background: #dadee2;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.admin-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

.admin-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.admin-card h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
}

.admin-card p {
  flex-grow: 1;
  color: #4b5563;
  font-size: 14px;
  margin-bottom: 16px;
}

.admin-action {
  display: inline-block;
  text-align: center;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: #4b84f5;
  color: #111827;
}

.admin-action:hover { background: #3b6fe0; }

.admin-warning .admin-action { background: #f59e0b; }
.admin-warning .admin-action:hover { background: #d97706; }


/* =========================================================
   12) Confirm overlay
   ========================================================= */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.confirm-overlay.hidden { display: none; }

.confirm-box {
  background: white;
  padding: 24px;
  border-radius: 10px;
  width: 320px;
  text-align: center;
}

.confirm-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.confirm-actions button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#confirm-yes {
  background: #ef4444;
  color: white;
}

#confirm-no {
  background: #03b430;
}


/* =========================================================
   13) Toasts
   ========================================================= */

#toast-container {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  animation: slide-in 0.5s ease, fade-out 0.5s ease 5s forwards;
}

.toast-success  { background: #22c55e; color: #052e16; }
.toast-error    { background: #ef4444; color: #7f1d1d; }
.toast-warning  { background: #f59e0b; color: #78350f; }
.toast-info     { background: #3b82f6; color: #0c2d57; }
.toast-password { background: #1e1e2e; color: #f8f8f2; font-family: monospace; font-size: 1.05em; }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fade-out {
  to { opacity: 0; transform: translateX(30px); }
}

/* Language switcher dropdown */
.lang-switcher {
  position: relative;
  margin-left: 8px;
}

.lang-switcher summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  user-select: none;
  line-height: 1;
  color: #f4f6f8;
}

.lang-switcher summary::-webkit-details-marker { display: none; }
.lang-switcher summary::marker { display: none; }

.lang-switcher summary:hover {
  background: rgba(255,255,255,0.1);
}

.lang-arrow {
  font-size: 0.6em;
  opacity: 0.7;
  line-height: 1;
}

.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #01193b;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  overflow: hidden;
  min-width: 130px;
  z-index: 200;
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: #f4f6f8;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.15s;
}

.lang-dropdown a:hover {
  background: rgba(255,255,255,0.1);
}

.lang-dropdown a.lang-active {
  font-weight: 600;
  background: rgba(255,255,255,0.08);
}
