/* === GLOBAL RESET === */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: "Inter", Arial, sans-serif;
  background-color: #f8f9fb;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

hr {
  display: block;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  margin-left: auto;
  margin-right: auto;
  border-style: inset;
  border-width: 2px;
  border-color: #004c91;
}

/* === HEADER === */
header {
  background-color: #004c91;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border-radius: 0 0 12px 12px;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo a {
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  color: white;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.main-nav a {
  text-decoration: none;
  color: white;
  font-weight: 500;
  transition: color 0.3s;
}

.main-nav a:hover { color: #ffd700; }

.menu-toggle {
  display: none;
  font-size: 26px;
  cursor: pointer;
}

/* === DROPDOWN === */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  font-weight: 500;
  color: #ffffff;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  min-width: 80px;
  transition: opacity 0.5s ease-in-out;
}

.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  padding: 10px 14px;
  text-decoration: none;
  color: #004c91;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background-color: #f2f6fb;
}

/* responsive menu */
@media (max-width: 900px) {
  .main-nav { display: none; flex-direction: column; background: #004c91; border-radius: 0 0 12px 12px; width: 100%; }
  .main-nav.active { display: flex; }
  .menu-toggle { display: block; color: white; font-size: 1.8rem; }
}

/* === CONTAINER & CARDS === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  padding: 16px;
}

/* === TABLE === */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  padding: 20px;
}

table.index-table {
  max-width: 1000px;
  border-collapse: collapse;
  font-size: 15px;
  text-align: center;
  border-left: 3px solid #004c91;
  border-right: 3px solid #004c91;
  border-top: 3px solid #004c91;
  border-bottom: 3px solid #004c91;
}

table.index-table th, table.index-table td {
  border: 1px solid #ddd;
  padding: 10px 6px;
  background: white;
  text-align: center;
  vertical-align: middle;
}

/* Visually separate match days */
tr.day-separator td {
  border-bottom: 2px solid #004c91; /* thick blue line */
}

table.index-table th {
  background: #004c91;
  border-bottom: 2px solid #004c91;
  color: #ffd700;
  font-weight: 700;
}

/* Fixed column widths */
table.index-table td:nth-child(1) { 
    width: 30px;
    color: #ccc; 
}

table.index-table th:nth-child(2),
table.index-table td:nth-child(2) { width: 110px; }

table.index-table th:nth-child(3),
table.index-table td:nth-child(3) { min-width: 160px; /*text-align: left; padding-left: 8px; */}

table.index-table td:nth-child(4) { 
    width: 80px; 
    background-color: #fff7cc;
    font-weight: 600;
    color: #222;
    border-left: 2px solid #ccc;
    border-right: 2px solid #ccc;
}

/* User columns uniform */
table.index-table th:nth-child(n+5),
table.index-table td:nth-child(n+5) { width: 80px; }

/* Results */
.result-cell {
  background-color: #fff7cc;
  font-weight: bold;
  border-left: 2px solid #ccc;
  border-right: 2px solid #ccc;
}

/* === LEADERBOARD TABLE === */
table.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  text-align: center;
  border-left: 2px solid #004c91;
  border-right: 2px solid #004c91;
  border-top: 2px solid #004c91;
  border-bottom: 2px solid #004c91;
}

table.leaderboard-table th, table.leaderboard-table td {
  border: 1px solid #ddd;
  padding: 10px 6px;
  background: white;
  text-align: center;
  vertical-align: middle;
}

table.leaderboard-table th {
  background: #004c91;
  color: white;
  font-weight: 700;
}

/* Fixed column widths */
table.leaderboard-table td:nth-child(1) { 
    width: 40px; 
    color: #004c91;
    font-weight: 700;
}

table.leaderboard-table th:nth-child(2),
table.leaderboard-table td:nth-child(2) { 
    width: 120px;
    text-align: left; 
    padding-left: 8px;
}

table.leaderboard-table td:nth-child(3) { 
    min-width: 80px; 
    background-color: #fff7cc;
    font-weight: 600;
    color: #222;
    border-left: 2px solid #ccc;
    border-right: 2px solid #ccc;
    /* */
}

table.leaderboard-table td:nth-child(4) { 
    width: 80px; 
}

table.leaderboard-table td:nth-child(5) { 
    width: 60px; 
    border-right: 2px solid #004c91;
}

table.leaderboard-table td:nth-child(n+6) { 
    width: 60px; 
    color: #ccc;
}

/* === FOOTER === */
footer {
  flex-shrink: 0;  
  background-color: #004c91;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: white;
  border-top: 1px solid #e1e4e8;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
  border-radius: 12px 12px 0 0;
  margin-top: 20px;
}
footer a { color: white; text-decoration: none; }

/* === SCORE
.score {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 15px;
  display: inline-block;
} === */

/* === UTILITIES === */
.me-info {
  text-align: right;
  margin-bottom: 8px;
  color: #004c91;
  font-size: 15px;
}

.team-slovakia {
  color: #004c91;
  font-weight: 700;
}

.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #fff;
    color: #222; /* ensure text is dark and readable */
    margin: 10% auto;
    padding: 20px 30px;
    border-radius: 10px;
    max-width: 400px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    position: relative;
    animation: slideDown 0.3s ease;
}

.modal-content h2 {
    margin-top: 0;
    color: #003366;
}

.modal-content label {
    color: #003366; /* deep blue labels */
    display: block;
    margin-top: 10px;
    font-weight: 500;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"] {
    width: 95%;
    padding: 8px;
    margin-top: 6px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #f9fbff;
    color: #003366;
}

.modal-content input[type="submit"] {
    margin-top: 15px;
    width: 100%;
    background: #003366;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

.modal-content input[type="submit"]:hover {
    background: #0055aa;
}

/* Close “X” */
.close {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 22px;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

/* Animations */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes slideDown {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

/* === ALERT MESSAGES === */
.alert {
  max-width: 500px;
  margin: 30px auto;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

.alert-success {
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #005073;
}

.alert-error {
  background-color: #fff1f0;
  border: 1px solid #ffa39e;
  color: #a8071a;
}

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

/* === PWA INSTALL BUTTON === */
.install-app-btn {
  position: fixed;
  top: 60px;
  left: 20px;
  background-color: #004c91;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: none; /* shown only when installable */
  transition: all 0.3s ease;
  z-index: 9999;
}

/* Appear only on small screens */
@media (max-width: 768px) {
  .install-app-btn.show {
    display: block;
  }
}

.install-app-btn:hover {
  background-color: #ffd700;
  color: #004c91;
  transform: scale(1.05);
}

/* === ADMIN page === */
.admin-form, .admin-table {
    margin: 20px auto;
    width: 90%;
    max-width: 900px;
}

.admin-form input, .admin-form select {
    display: block;
    margin: 8px 0 16px 0;
    width: 25%;
    padding: 8px;
}

.admin-table {
    border-collapse: collapse;
    width: 1200px;
    background: white;
}

.admin-table th, .admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.admin-table th {
    background: #003366;
    color: white;
}

.admin-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admin-table button {
    background: #0055aa;
    color: white;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.admin-table button:hover {
    background: #0077cc;
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 20px auto 30px auto;
    width: 90%;
    text-align: center;
}

.summary-card {
    background: #f8f9fc;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.summary-card h2 {
    font-size: 2em;
    color: #003366;
    margin: 0;
}

.summary-card p {
    color: #555;
    margin-top: 6px;
    font-size: 0.9em;
}

.recalc-btn {
    background: #0077cc;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
}

.recalc-btn:hover {
    background: #005fa3;
}

.alert {
    margin: 15px auto;
    padding: 10px 20px;
    border-radius: 6px;
    max-width: 800px;
    text-align: center;
}

.alert.success {
    background-color: #e6f9ec;
    border: 1px solid #6cc86e;
    color: #2f7033;
}

/* === Standings Preview Popup === */
.standings-popup {
  display: none;
  position: absolute;
  background: #ffffff;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 10px;
  min-width: 180px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.standings-popup.fade-in {
  opacity: 1;
}

.standings-popup table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.standings-popup th,
.standings-popup td {
  padding: 4px 8px;
  
}

.standings-popup th {
  background-color: #004c91;
  color: white;
  font-weight: 600;
}

.standings-popup tr:nth-child(even) {
  background-color: #f5f7fb;
}
