/* ===== Global base styles ===== */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #111827;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #111827;
  color: #d1d5db;
}

/* ===== Sticky footer layout ===== */

body.stats-page,
body.matches-page,
body.admin-page,
body.admin-panel-page {
  display: flex;
  flex-direction: column;
}

body.stats-page main,
body.matches-page main,
body.admin-page main,
body.admin-panel-page main {
  flex: 1 0 auto;
}

.app-footer {
  flex-shrink: 0;
}

/* ===== Common links/buttons behavior ===== */

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* ===== Loader ===== */

.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;

  width: 40px;
  height: 40px;
  margin-top: -20px;
  margin-left: -20px;

  display: none;

  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;

  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ===== Toast notifications ===== */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;

  max-width: min(420px, calc(100vw - 40px));
  padding: 1rem 1.5rem;

  color: #ffffff;
  font-size: 1rem;
  line-height: 1.4;

  border-radius: 0.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);

  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);

  transition:
    opacity 0.3s,
    visibility 0.3s,
    transform 0.3s;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast-success {
  background-color: #16a34a;
}

.toast-error {
  background-color: #dc2626;
}

.toast-info {
  background-color: #0284c7;
}

/* ===== Shared mobile fixes ===== */

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    text-align: center;
  }
}