* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
fieldset {
  padding: 16px;
}
body {
  font-family: Arial, sans-serif;
  padding: 20px 20px 40px;
  background: #f0f0f0;
}
h1 {
  color: #333;
  margin-bottom: 20px;
}
h2 {
  margin-bottom: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 0 6px #ccc;
}
th,
td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}
th {
  background: #f9f9f9;
}
a,
button {
  color: #007bff;
  text-decoration: none;
  cursor: pointer;
  font-size: inherit;
  display: inline-block;
}
.checklist {
  font-size: 14px;
  color: #333;
}
.container {
  max-width: 600px;
  margin: auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px #ccc;
}
.container-wide {
  max-width: 1300px;
  margin: auto;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  font-family: inherit;
  font-size: inherit;
}
input + small {
  margin: -10px 0 10px 0;
  display: block;
  padding-top: 3px;
}
input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
}
.error-message {
  color: red;
  font-weight: bold;
  margin-bottom: 10px;
  margin-top: 10px;
}
.message {
  background: #121212;
  color: white;
  font-weight: bold;
  margin-bottom: 24px;
  margin-top: 10px;
  display: inline-block;
  padding: 10px 16px;
}
.ready {
  color: green;
  font-weight: bold;
}

/* Buttons */
button,
.button {
  background: #007bff;
  padding: 10px 16px;
  border: none;
  cursor: pointer;
  font-size: 1em;
  color: white;
  outline: none;
  border-radius: 5px;
}
button.small-button,
.button.small-button {
  padding: 8px 16px;
  font-size: 1em;
}
button.xsmall,
.button.xsmall {
  padding: 4px 10px;
  font-size: 1em;
}
button:hover,
.button:hover {
  background: #0056b3;
}

button.green,
.button.green {
  background: #28a745;
  color: white;
}

button.green:hover,
.button.green:hover {
  background: #218838;
}

button.pink,
.button.pink {
  background: #e83e8c;
  color: white;
}

button.pink:hover,
.button.pink:hover {
  background: #d63384;
}

button.purple,
.button.purple {
  background: #a67dff;
  color: white;
}

button.purple:hover,
.button.purple:hover {
  background: #8a5be3;
}

button.grey,
.button.grey {
  background: #668;
  color: white;
}
button.grey:hover,
.button.grey:hover {
  background: #333;
}

button.white,
.button.white {
  background: #fff;
  color: #000;
}
button.white:hover,
.button.white:hover {
  background: rgba(255, 255, 255, 0.8);
}

button.black,
.button.black {
  background: #121212;
  color: white;
}
button.black:hover,
.button.black:hover {
  background: #000;
}

button.red,
.button.red {
  background: #dc3545;
  color: white;
}
button.red:hover,
.button.red:hover {
  background: #b3202f;
}

table button,
table .button {
  font-size: 0.8em;
  padding: 8px 16px;
}

/* Links */
.links {
  text-align: center;
  margin-top: 20px;
}
.links a {
  text-decoration: none;
  color: #007bff;
}

/* Buttons grouping */
.button-group {
  margin-top: 20px;
}
.button-group a {
  padding: 10px 15px;
  margin-right: 10px;
  background-color: #28a745;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  display: inline-block;
}
.button-group a:hover {
  background-color: #218838;
}
.field {
  margin-bottom: 18px;
}

.field input,
.field select,
.field textarea {
  margin: 0;
}

.event-block {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 32px;
  box-shadow: 0 0 6px #ccc;
}

.event-block table {
  box-shadow: none;
}

.event-block h3 {
  margin-top: 0;
}

.event-block p {
  margin-top: 12px;
  margin-bottom: 12px;
}

/* Floating fields */
.form-group {
  position: relative;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group label {
  order: 0;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: white;
  margin: 0;
  order: 1;
}
.form-group label input {
  width: auto;
}

/* .form-group {
	position: relative;
	margin-bottom: 32px;
}
.form-group input,
.form-group select {
	width: 100%;
	padding: 14px 10px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 5px;
	background: white;
	margin: 0;
}
.form-group label {
	position: absolute;
	top: 16px;
	left: 10px;
	padding: 0 4px;
	color: #666;
	transition: 0.2s ease all;
	pointer-events: none;
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label {
	top: -18px;
	left: 4px;
	font-size: 14px;
	color: #000;
} */

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 24px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Main menu */
.main-nav {
  background-color: #212529;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  position: relative;
  margin-bottom: 32px;
  z-index: 10;
}
.main-nav .logo {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
}
.main-nav .logo img {
  display: block;
  width: 80px;
  position: absolute;
  left: 20px;
  top: -15px;
}
.main-nav .menu-toggle {
  display: none;
  font-size: 26px;
  background: none;
  color: white;
  border: none;
  cursor: pointer;
}
.main-nav .nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}
.main-nav .nav-links a {
  color: #f1f1f1;
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  padding: 8px 10px;
  border-radius: 5px;
}
.main-nav .nav-links a span {
  margin-left: 6px;
}
.main-nav .nav-links a:hover {
  background: #343a40;
  color: #17c964;
}
.main-nav .nav-links a.active {
  background-color: #17c964;
  color: white;
}

@media (max-width: 768px) {
  .main-nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .main-nav .menu-toggle {
    display: block;
    margin-left: auto;
  }
  .main-nav .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #2c2f33;
    margin-top: 10px;
    padding: 10px 0;
    border-radius: 5px;
  }
  .main-nav .nav-links.active {
    display: flex;
  }
  .main-nav .nav-links a {
    padding: 12px 20px;
    font-size: 15px;
  }
}

/* Fight records */
#fight-records-container {
  margin-top: 24px;
}

#fight-records-container .form-group {
  margin-bottom: 0;
}

.fight-record-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.fight-record-row:not(:last-child) {
  margin-bottom: 12px;
}

.fight-record-row:not(:first-child) label {
  display: none;
}

.fight-record-row .form-group {
  flex: 1 1 120px;
  min-width: 120px;
}

.fight-record-row .remove-wrap {
  flex: 0 0 auto;
}

.remove-record-button,
.add-record-button {
  background-color: #dc3545;
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  margin: 0;
  display: inline-block;
  max-width: 60px;
}

.add-record-button {
  background-color: #007bff;
  font-weight: bold;
}

.add-record-button:hover {
  background-color: #0062cc;
}

.remove-record-button:hover {
  background-color: #b92d3b;
}

.hide-close-button .remove-record-button {
  display: none;
}

@media (max-width: 600px) {
  .fight-record-row {
    flex-direction: column;
    align-items: stretch;
  }
  .remove-record-button {
    width: 100%;
    margin-top: 10px;
  }
}

.heading-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.event-cards {
  margin-top: 20px;
}

.event-cards,
.cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.event-cards.cols-4,
.cols.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.event-cards.cols-2,
.cols.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.event-cards.cols-1,
.cols.cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.event-card {
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.event-card h3 {
  margin-top: 0;
  font-size: 20px;
}

.event-card p {
  margin: 5px 0;
}

.card-actions {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions form {
  display: inline;
}

.card-actions a,
.card-actions button {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}

.card-actions .green {
  background-color: #4caf50;
  color: white;
}

.card-actions .red {
  background-color: #e53935;
  color: white;
}

.card-event-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  padding: 15px 0 0;
  border-top: 1px solid #ddd;
  margin-top: 15px;
}

.card-event-actions a.button,
.card-event-actions button {
  background: #f4f4f4;
  border: 1px solid #ccc;
  color: #333;
  text-decoration: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-block;
  cursor: pointer;
}

.card-event-actions a.button:hover,
.card-event-actions button:hover {
  background: #e0e0e0;
  color: #000;
  border-color: #999;
}

.card-event-actions form {
  margin: 0;
}

.form-row {
  display: flex;
  gap: 20px;
  width: 100%;
}

.form-group {
  flex: 1;
}

.documents-list {
  font-size: 14px;
}

.documents-list .tag {
  margin-bottom: 4px;
}

.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  background: #eee;
  padding: 4px 8px;
  border-radius: 4px;
  margin-right: 4px;
  font-weight: 400;
  font-size: 14px;
}

.ready {
  background: #d4edda;
  color: darkgreen;
}

.not-ready {
  background: #f8d7da;
  color: darkred;
}

.warning {
  background-color: #ffe5b4;
  color: #cc6600;
}

.ready {
  color: green;
}

.logo-preview {
  display: block;
  width: 120px;
  height: auto;
  margin-top: 10px;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 4px;
  background-color: #f9f9f9;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
}

.section {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fcfcfc;
}

.section legend {
  font-weight: bold;
  padding: 0 6px;
  font-size: 1.1em;
}

.two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.two-col .form-group {
  flex: 1 1 45%;
  min-width: 250px;
}

.fighter-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}
.fighter-table th,
.fighter-table td {
  padding: 10px;
  border: 1px solid #ccc;
}
.fighter-table th {
  background: #f5f5f5;
}
.fighter-photo {
  width: 54px;
  height: 68px;
  object-fit: cover;
  display: block;
}

.fighter-photo-td,
.fighter-table .fighter-photo-td {
  padding: 0;
  width: 54px;
  height: 68px;
}

.fighter-photo-td a {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.table-button-group {
  display: flex;
  gap: 6px;
}

.details-list,
.doc-list {
  flex-direction: column;
  display: flex;
  gap: 8px;
}

.doc-list {
  margin-top: 12px;
}

.details-list strong {
  display: inline-block;
  margin-right: 12px;
}

.fighter-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.fighter-info .profile-photo {
  margin-left: 0;
}

.fighter-info table {
  box-shadow: none;
}

.download-profile-picture {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fight-records-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns by default */
  gap: 1rem;
  margin-top: 1rem;
  order: 1;
}

@media (max-width: 768px) {
  .fight-records-container {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets and phones */
  }
}

.fight-record-card,
.fight-record-summary {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  background-color: #f9f9f9;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  order: 1;
  flex: 1;
}

.fight-record-card h4 {
  margin-top: 0;
  color: #333;
  margin-bottom: 8px;
}

.fight-record-summary {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  border: 2px solid #afd1aa;
  background-color: #c8e6c4;
  padding: 1rem;
  width: 100%;
  order: 0;
  flex: 1;
}

.fight-record-summary h3 {
  margin-bottom: 0.5rem;
}

/* Toggle Switch */
/* Toggle Switch with Yes/No */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin-left: 10px;
  vertical-align: middle;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 30px;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.toggle-switch .text-toggle::after {
  content: "No";
  color: white;
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 12px;
  font-family: sans-serif;
  pointer-events: none;
}

.toggle-switch input:checked + .text-toggle {
  background-color: #28a745; /* Green */
}

.toggle-switch input:checked + .text-toggle:before {
  transform: translateX(30px);
}

.toggle-switch input:checked + .text-toggle::after {
  content: "Yes";
  left: 10px;
  right: auto;
}

.buttons-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* Custom upload button */

.upload-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.upload-button {
  background-color: #555;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.3s ease;
  gap: 8px;
  text-decoration: none;
}

.upload-button:hover {
  background-color: #222;
}

.upload-icon {
  font-size: 18px;
}

.auto-replace-button {
  background: #333;
  padding: 10px 16px;
  border: none;
  cursor: pointer;
  font-size: 1em !important;
  color: white;
  outline: none;
  border-radius: 5px;
  display: inline-block;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: none;
}

.auto-replace-button.xsmall {
  padding: 4px 10px;
  font-size: 0.8em;
}

.auto-replace-button input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.inline-fight-record {
  font-size: 0.85em;
  color: #000;
  border: solid 1px #aaa;
  background-color: #f3f3f3;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
}

.document-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.document-list li {
  align-items: center;
  display: flex;
  gap: 4px;
}

.document-list a {
  margin-right: auto;
  padding-right: 8px;
  display: block;
}

th.red-corner {
  background-color: #a44848ff;
  color: white;
}

th.blue-corner {
  background-color: #316398ff;
  color: white;
}

td.blue-corner {
  background-color: #6d8fb3ff;
  color: #000;
}

td.red-corner {
  background-color: #c88f8fff;
  color: #000;
}

.event-logo {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px;
  background: #fafafa;
}

.event-card-summary {
  display: flex;
  gap: 16px;
}

@media print {
  .no-print,
  .button-group,
  .button,
  .main-nav {
    display: none !important;
  }
  .container-wide,
  .container {
    max-width: 100% !important;
  }
}
