/* static/css/style.css */

/* Grundlayout */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #0b1a33; /* mörkblå bakgrundsinspiration */
  color: #f5f5f5;
}

/* LOGIN */
.body-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  background-color: #12254a;
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-container h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.login-container h2 {
  margin-top: 0;
  color: #ff4c4c; /* röd accent */
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.login-form label {
  text-align: left;
  font-size: 0.9rem;
  color: #d0d8ea;
}

.login-form input {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #314673;
  background-color: #09142b;
  color: #f5f5f5;
}

.login-form input:focus {
  outline: none;
  border-color: #ff4c4c;
}

.btn {
  border: none;
  border-radius: 0.75rem;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-primary {
  background-color: #ff4c4c;
  color: #fff;
}

.btn-primary:hover {
  background-color: #ff6666;
}

.btn-secondary {
  background-color: #1b325e;
  color: #f5f5f5;
}

.btn-secondary:hover {
  background-color: #254173;
}

.alert {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  text-align: left;
}

.alert-error {
  background-color: #61132a;
  color: #ffd9e1;
}

/* MAIN */
.body-main {
  min-height: 100vh;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #0f2141, #071224);
  border-bottom: 2px solid #ff4c4c;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.header-text h1 {
  margin: 0;
}

.header-text .subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: #d0d8ea;
}

.header-meta {
  text-align: right;
  font-size: 0.9rem;
}

.link-logout {
  color: #ffb3b3;
  text-decoration: none;
  margin-left: 0.5rem;
}

.link-logout:hover {
  text-decoration: underline;
}

/* Main content */
.main-content {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Info panel */
.info-panel {
  margin-bottom: 1rem;
  background-color: #12254a;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.info-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.info-item {
  background-color: #0b1833;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* Matches */
.matches-section {
  background-color: #12254a;
  border-radius: 0.75rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.matches-section h2 {
  margin-top: 0;
}

.hint-text {
  font-size: 0.85rem;
  color: #d0d8ea;
}

.matches-container {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(60px, 80px) 1.5fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  background-color: #0b1833;
}

.match-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.match-name {
  font-weight: 600;
}

.match-subinfo {
  font-size: 0.8rem;
  color: #c0c8da;
}

.match-buttons {
  display: flex;
  gap: 0.3rem;
}

.sign-btn {
  min-width: 36px;
  padding: 0.3rem 0.3rem;
  border-radius: 0.5rem;
  border: 1px solid #314673;
  background-color: #09142b;
  color: #f5f5f5;
  font-weight: 600;
  cursor: pointer;
}

.sign-btn:hover {
  background-color: #132245;
}

.sign-btn.selected-1 {
  background-color: #1f7a34; /* grönaktig för 1 */
  border-color: #2cab4e;
}

.sign-btn.selected-X {
  background-color: #b27b00; /* gul/orange för X */
  border-color: #ffb300;
}

.sign-btn.selected-2 {
  background-color: #a01b1b; /* röd för 2 */
  border-color: #ff4c4c;
}

/* Controls */
.controls-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Messages */
.message-section {
  min-height: 1.5rem;
  margin-bottom: 1rem;
}

.message-section .msg {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.msg-error {
  background-color: #61132a;
  color: #ffd9e1;
}

.msg-info {
  background-color: #133261;
  color: #d0e5ff;
}

.msg-success {
  background-color: #14502b;
  color: #d4ffe4;
}

/* Coupons */
.coupons-section {
  background-color: #12254a;
  border-radius: 0.75rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.coupons-section h2 {
  margin-top: 0;
}

.coupons-meta {
  font-size: 0.9rem;
  color: #d0d8ea;
  margin-bottom: 0.5rem;
}

.coupons-container {
  overflow-x: auto;
}

.coupons-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.coupons-table th,
.coupons-table td {
  border: 1px solid #314673;
  padding: 0.3rem 0.4rem;
  text-align: center;
}

.coupons-table th {
  background-color: #0b1833;
}

/* Responsivitet */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .header-meta {
    text-align: left;
  }

  .match-row {
    grid-template-columns: 1fr;
  }

  .match-buttons {
    justify-content: flex-start;
  }

  .info-line {
    flex-direction: column;
  }
}



/* NAV + FOOTER */
.top-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 1rem;
}

.nav-link {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: #d0d8ea;
  border: 1px solid #314673;
  background-color: rgba(9, 20, 43, 0.35);
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-link:hover {
  background-color: rgba(19, 34, 69, 0.7);
}

.nav-link-active {
  border-color: #ff4c4c;
  color: #ffffff;
}

.header-note {
  margin: 0;
  color: #d0d8ea;
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #314673;
  color: #d0d8ea;
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a {
  color: #ffb3b3;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Publika länkar på login */
.public-links {
  margin-top: 1rem;
  font-size: 0.9rem;
}
.link-public {
  color: #ffb3b3;
  text-decoration: none;
}
.link-public:hover {
  text-decoration: underline;
}

/* Rätta */
.ratta-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.ratta-label {
  font-size: 0.9rem;
  color: #d0d8ea;
}

.ratta-date {
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #314673;
  background-color: #09142b;
  color: #f5f5f5;
}

.ratta-matches {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ratta-match {
  background-color: #0b1833;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #314673;
}

.ratta-match-title {
  font-weight: 700;
}

.ratta-match-sub {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: #d0d8ea;
}

.ratta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.ratta-upload {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ratta-results {
  margin-top: 1rem;
  overflow-x: auto;
}

.ratta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ratta-table th, .ratta-table td {
  border: 1px solid #314673;
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.ratta-table th {
  background-color: #0b1833;
}

.ratta-total {
  margin-top: 0.75rem;
  font-weight: 800;
  color: #ffffff;
}
