

body { font-family: Arial, sans-serif; direction: rtl; }
.container { width: 90%; margin: 1rem auto; }

/* Predictions page custom background and layout */
/* Gradient background used on prediction/matches pages */
.predictions-bg {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 25%, #fbc2eb 50%, #a6c1ee 75%, #cfd9df 100%);
  min-height: 100vh;
  direction: rtl;
}

/* User-specific predictions background (spor.jpg) with overlay for legibility */
.predictions-user-bg {
  background-image: url('/static/img/spor.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  position: relative;
}
.predictions-user-bg::before {
  content: '';
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,0.36);
  pointer-events: none;
  z-index: 0;
}
.predictions-user-bg > .container, .predictions-user-bg .topbar { position: relative; z-index: 1; }

.predictions-wrapper { max-width: 860px; margin: 0 auto 24px auto; }

.round-title { text-align: center; font-size: 18px; color: #2c5282; margin: 6px 0 12px 0; font-weight: 700; }

/* Centered medium-width wrapper for prediction tables */
.predictions-wrapper,
.container {
  max-width: 860px;
  margin: 18px auto;
}

.round-title {
  font-size: 20px;
  font-weight: 700;
  color: #243b55;
  margin-bottom: 8px;
}

/* Team logo small */
.team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Top navbar */
.topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  background: rgba(255,255,255,0.9);
  padding: 12px 18px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  gap:12px;
}
.topbar .brand { font-weight:800; color:#2c5282; font-size:18px; }
.topbar nav a{ margin-left:12px; text-decoration:none; color:#2c5282; font-weight:600 }

/* Smaller, airy tables */
.match-table { width:100%; border-collapse: collapse; background: rgba(255,255,255,0.95); }
.match-table th, .match-table td { padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.match-table tbody tr:last-child td{ border-bottom:none }

/* Login Page Styling */
.login-page {
  background: linear-gradient(135deg, #a8d8f0 0%, #b8e6fc 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
  color: #333;
}

.login-header h1 {
  font-size: 32px;
  margin: 0 0 10px 0;
  font-weight: bold;
}

.login-header p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 420px;
}

.login-card h2 {
  text-align: center;
  color: #333;
  margin: 0 0 8px 0;
  font-size: 24px;
}

.login-subtitle {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #333;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #2c5282;
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.btn-login, .btn-register {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.btn-login {
  background: #2c5282;
  color: white;
}

.btn-login:hover {
  background: #1e3a5f;
}

.btn-register {
  background: #f0f0f0;
  color: #2c5282;
}

.btn-register:hover {
  background: #e0e0e0;
}

.error-box {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* Predictions Page Styling */
.predictions-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.predictions-table .team-cell { display:flex; align-items:center; gap:10px; justify-content:flex-end; }
.predictions-table .team-logo { width:28px; height:28px; border-radius:4px; object-fit:cover; }

/* Team name consistent appearance */
.team-name {
  display: inline-block;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Match result centered between teams */
.match-result {
  min-width: 68px;
  text-align: center;
  font-weight: 700;
  color: #243b55;
}

.predictions-table th {
  background: #2c5282;
  color: white;
  padding: 12px;
  text-align: right;
  font-weight: 600;
}

.predictions-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  text-align: right;
}

/* Center prediction result column */
.predictions-table td:nth-child(2) {
  text-align: center;
  vertical-align: middle;
  font-weight: 800;
  font-size: 16px;
  color: #243b55;
  width: 120px;
}

/* Ensure first column (teams) uses space-between layout */
.predictions-table td:first-child > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Left and right team containers for consistent alignment - CENTERED */
.team-left { display:flex; align-items:center; gap:8px; justify-content:center; direction:rtl; }
.team-right { display:flex; align-items:center; gap:8px; justify-content:center; direction:rtl; }

/* Styled prediction pill in the center */
.prediction-pill {
  display: inline-block;
  min-width: 90px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(44,82,130,0.08);
  color: #243b55;
  font-weight: 800;
  text-align: center;
}

.predictions-table tr:last-child td {
  border-bottom: none;
}

.predictions-table tr:hover {
  background: #f9f9f9;
}

.user-predictions {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-predictions h3 {
  margin: 0 0 12px 0;
  color: #2c5282;
  border-bottom: 2px solid #2c5282;
  padding-bottom: 8px;
}

/* Match Table: style similar to admin predictions table for user view */
.match-table { width:100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px; }
.match-table th, .match-table td { padding: 12px; border-bottom: 1px solid #eee; text-align: center; vertical-align: middle; }
.match-table th { background: #2c5282; color: white; font-weight:600; padding: 12px; text-align: center; }
input[type=number] { width: 64px; padding:8px; border-radius:6px; border:1px solid #ddd; text-align:center; }
.match-inputs { display:flex; gap:12px; justify-content:center; align-items:center; }
.match-score { width:64px; padding:8px; border-radius:6px; border:1px solid #ddd; text-align:center; }
.match-table td:nth-child(2) { background: transparent; }

button { padding: 6px 12px; }
.error { color: red; }
.header { text-align: left; padding: 10px; }

/* Admin Action Buttons - displayed horizontally */
.admin-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.edit-btn, .delete-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}

.edit-btn {
  background: #2c5282;
  color: white;
}

.edit-btn:hover {
  background: #1e3a5f;
}

.delete-btn {
  background: #c00;
  color: white;
}

.delete-btn:hover {
  background: #900;
}

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.2s;
}

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

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s;
}

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

.modal-content h2 {
  margin: 0 0 20px 0;
  color: #333;
  text-align: center;
}

.close {
  color: #aaa;
  float: left;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  margin-top: -8px;
}

.close:hover {
  color: #000;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.modal-buttons .btn-save {
  background: #2c5282;
  color: white;
}

.modal-buttons .btn-save:hover {
  background: #1e3a5f;
}

.modal-buttons .btn-cancel {
  background: #ddd;
  color: #333;
}

.modal-buttons .btn-cancel:hover {
  background: #ccc;
}

.match-list { display: flex; flex-direction: column; gap: 10px; }
.match-card {
  background: white;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  gap: 12px;
  font-size: 14px;
}
.match-team { display:flex; align-items:center; justify-content:center; gap:8px; min-width: 28%; max-width: 42%; }
.match-team .team-logo { width:24px; height:24px; border-radius:6px; object-fit:contain; }
.match-team .team-name { font-weight:600; color:#243b55; max-width:140px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:13px; }
.score-box { min-width:72px; background: #ffffff; border-radius: 18px; padding:6px 10px; text-align:center; font-weight:800; color:#243b55; border:1px solid rgba(0,0,0,0.06); box-shadow: 0 1px 4px rgba(0,0,0,0.04); display:flex; align-items:center; justify-content:center; }
.score-box.small { min-width:64px; padding:4px 8px; border-radius:14px; font-size:13px; }
.match-meta { font-size:12px; color:#6b7280; }
.competition-logo { width:20px; height:20px; object-fit:contain; margin-left:8px; }
.competition-text { font-weight:600; color:#475569; margin-left:8px; }
.match-datetime { color:#6b7280; margin-left:8px; font-size:12px; }

/* compact pill for numbers inside score box */
.score-pill { display:flex; gap:8px; align-items:center; justify-content:center; }
.score-num { display:inline-block; min-width:28px; padding:6px 8px; border-radius:8px; background:#f0f0f2; color:#243b55; font-weight:800; font-size:14px; }
.score-dash { color:#94a3b8; font-weight:800; }

/* visual outcome colors used in results comparisons */
.score-badge--perfect { background: #d5f4e6; color:#27ae60; }
.score-badge--partial { background: #fdebd0; color:#d68910; }
.score-badge--wrong { background: #fadbd8; color:#c0392b; }

.login-bg {
  background: url('/static/img/login_bg.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
}

.matches-bg {
  background-image: url('/static/img/matches_bg.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  position: relative;
}
.result-bg {
  background-image: url('/static/img/matches.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  position: relative;
}

/* dark overlay for readability */
body.matches-bg::before {
  content: '';
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,0.36);
  pointer-events: none;
  z-index: 0;
}

/* ensure content sits above overlay */
body.matches-bg > .container, body.matches-bg .topbar { position: relative; z-index: 1; }
