/* widget/assets/sofascore-widgets.css */
:root {
  --ca9-red: #b5121b;
  --ca9-dark: #151515;
  --ca9-border: #e6e6e6;
  --ca9-muted: #777;
  --ca9-card: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f3f5;
  color: #222;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 14px 50px;
}

.page-title {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 900;
  color: var(--ca9-dark);
}

.widgets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.sofa-widget {
  background: var(--ca9-card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.11);
  border: 1px solid var(--ca9-border);
}

.sofa-widget-full { grid-column: 1 / -1; }

.sofa-header {
  color: #fff;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sofa-header.next { background: linear-gradient(135deg, #9d0f18, #d71920); }
.sofa-header.last { background: linear-gradient(135deg, #111827, #374151); }
.sofa-header.today { background: linear-gradient(135deg, #1d4ed8, #2563eb); }
.sofa-header.live { background: linear-gradient(135deg, #047857, #10b981); }

.sofa-header-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sofa-header-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.sofa-header-title span {
  font-size: 13px;
  opacity: 0.92;
}

.sofa-badge {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sofa-body {
  padding: 14px;
  max-height: 720px;
  overflow: auto;
}

.match-card {
  border: 1px solid var(--ca9-border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.match-top {
  background: #fafafa;
  border-bottom: 1px solid var(--ca9-border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ca9-muted);
}

.competition {
  font-weight: 800;
  color: #333;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.round {
  color: var(--ca9-red);
  font-weight: 900;
  white-space: nowrap;
}

.match-main {
  padding: 16px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team.away {
  justify-content: flex-end;
  text-align: right;
}

.team-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f0f0f0;
  border: 1px solid #ddd;
  object-fit: contain;
  padding: 4px;
  flex: 0 0 auto;
}

.team-name {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-code {
  font-size: 11px;
  color: var(--ca9-muted);
  margin-top: 2px;
  font-weight: 800;
}

.match-center {
  min-width: 105px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.match-date {
  font-size: 12px;
  color: var(--ca9-muted);
  font-weight: 800;
}

.match-time {
  font-size: 20px;
  font-weight: 950;
  color: var(--ca9-dark);
}

.match-score {
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
  color: var(--ca9-dark);
}

.match-status {
  font-size: 11px;
  background: #f3f3f3;
  color: #555;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 800;
}

.match-status.live { background: #dcfce7; color: #047857; }
.match-status.finished { background: #e5e7eb; color: #374151; }
.match-status.scheduled { background: #dbeafe; color: #1d4ed8; }

.match-footer {
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid var(--ca9-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ca9-muted);
}

.home-away {
  font-weight: 900;
  color: var(--ca9-red);
}

.loading, .error, .empty {
  padding: 28px;
  text-align: center;
  color: var(--ca9-muted);
  font-weight: 800;
}

.error {
  color: #b5121b;
  line-height: 1.5;
}

.error small {
  color: #7f1d1d;
  display: block;
  margin-top: 8px;
  font-weight: 600;
  word-break: break-word;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}

.toolbar a {
  display: inline-flex;
  text-decoration: none;
  color: #fff;
  background: #222;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
}

.toolbar a:hover { background: var(--ca9-red); }

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

@media (max-width: 620px) {
  .page-shell { padding: 12px; }
  .sofa-widget { border-radius: 14px; }
  .sofa-header { align-items: flex-start; flex-direction: column; }
  .match-main { grid-template-columns: 1fr; gap: 14px; }
  .team, .team.away { justify-content: center; text-align: center; flex-direction: column; }
  .match-center { order: -1; margin: auto; }
  .match-footer { flex-direction: column; text-align: center; }
}
