/* Sports Match Widget styles */

.smw-sports-wrap {
  /* Default color values — overridden by an inline <style> block generated
     from the Colors settings in the WP admin (Sports Matches > Colors). */
  --smw-header-bg-start: #a3103a;
  --smw-header-bg-end: #8a0d31;
  --smw-header-text: #ffffff;
  --smw-title-text: #1a1a2e;
  --smw-subtitle-text: #6b7280;
  --smw-datetime-bg: #fdf3ea;
  --smw-datetime-text: #1a1a2e;
  --smw-live-color: #00c896;
  --smw-badge-bg: #a3103a;
  --smw-badge-text: #ffffff;
  --smw-button-bg: #a3103a;
  --smw-button-text: #ffffff;
}

.smw-sports-wrap * { box-sizing: border-box; }

.smw-sports-wrap {
  margin: 0 auto;
}

.smw-sport-block {
  position: relative;
  margin-bottom: 28px;
}

/* Header ribbon */
.smw-header {
  background: linear-gradient(90deg, var(--smw-header-bg-start) 0%, var(--smw-header-bg-end) 100%);
  color: var(--smw-header-text);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
  width: 62%;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0% 100%);
  position: relative;
  z-index: 2;
}

.smw-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
  position: relative;
}

.smw-icon-cricket {
  background: radial-gradient(circle at 35% 30%, #ff6b6b, #b3122c 60%, #7a0c1f 100%);
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.4);
}
.smw-icon-cricket::after {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.5);
  transform: rotate(-20deg);
}

.smw-icon-football {
  background:
    radial-gradient(circle at 30% 30%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 70% 30%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 50% 65%, #fff 0 3px, transparent 4px),
    #1a1a2e;
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.5);
}

.smw-icon-tennis {
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 35% 30%, #e8f95a, #c7d916 60%, #a3b30f 100%);
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.3);
  overflow: hidden;
}
.smw-icon-tennis::before,
.smw-icon-tennis::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(255,255,255,0.85);
  border-radius: 50%;
  top: 50%;
  left: 50%;
}
.smw-icon-tennis::before { transform: translate(-65%,-50%); }
.smw-icon-tennis::after  { transform: translate(-35%,-50%); }

.smw-icon-generic {
  background: radial-gradient(circle at 35% 30%, #c9c9c9, #8a8a8a 60%, #5c5c5c 100%);
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.4);
}

.smw-label {
  color: var(--smw-header-text);
}

/* Card container */
.smw-card {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-top: -1px;
}

.smw-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  gap: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.smw-match-row:last-child { border-bottom: none; }

.smw-teams {
  flex: 1 1 260px;
  min-width: 220px;
}
.smw-teams .smw-names {
  font-weight: 700;
  font-size: 17px;
  color: var(--smw-title-text);
  line-height: 1.35;
}
.smw-teams .smw-league {
  font-size: 14px;
  color: var(--smw-subtitle-text);
  margin-top: 4px;
}

.smw-live-datetime-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* LIVE indicator with animated green line */
.smw-live-wrap {
  flex: 0 0 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.smw-live-label {
  color: var(--smw-live-color);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  margin-left: 17px;
}
.smw-live-line-track {
  width: 65px;
  height: 3px;
  background: #e5f9f3;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.smw-live-line-track::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent 0%, var(--smw-live-color) 50%, transparent 100%);
  animation: smwLiveSweep 1.6s linear infinite;
}
@keyframes smwLiveSweep {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Date/time box */
.smw-datetime {
  flex: 0 0 210px;
  background: var(--smw-datetime-bg);
  color: var(--smw-datetime-text);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  padding: 14px 12px;
  border-radius: 6px;
  white-space: nowrap;
}

/* TV icon */
.smw-tv-icon {
  flex: 0 0 40px;
  display: flex;
  justify-content: center;
  color: #1a1a2e;
}
.smw-tv-icon svg { width: 26px; height: 26px; }

/* BM badge */
.smw-bm-badge {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--smw-badge-bg);
  color: var(--smw-badge-text);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animated colorful border loop button */
.smw-bet-btn-wrap {
  flex: 0 0 auto;
  position: relative;
  padding: 3px;
  border-radius: 30px;
  background: conic-gradient(
    from 0deg,
    #ff2d55, #ff9f0a, #ffd60a, #34c759, #00c7be, #30b0ff, #5e5ce6, #ff2d55
  );
  background-size: 300% 300%;
  animation: smwRotateBorder 2.5s linear infinite;
}
@keyframes smwRotateBorder {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.smw-bet-btn {
  display: block;
  background: var(--smw-button-bg);
  color: var(--smw-button-text);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 34px;
  border-radius: 28px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  width: 100%;
}
.smw-bet-btn:hover {
  filter: brightness(1.08);
}

.smw-empty-notice {
  color: #6b7280;
  font-style: italic;
}

/* ===================== MOBILE LAYOUT ===================== */
@media (max-width: 640px) {

  .smw-header {
    width: 100%;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
    padding: 14px 20px;
    font-size: 18px;
    border-radius: 4px 4px 0 0;
  }

  .smw-card {
    border-radius: 0 0 6px 6px;
  }

  .smw-match-row {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 16px 20px;
    gap: 10px;
  }

  .smw-teams {
    flex: 0 0 auto;
    min-width: 0;
  }
  .smw-teams .smw-names { font-size: 15.5px; }
  .smw-teams .smw-league { font-size: 13px; }

  .smw-live-datetime-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    width: 100%;
  }
  .smw-live-wrap {
    flex: 0 0 auto;
    align-items: flex-start;
  }
  .smw-live-line-track { width: 36px; }
  .smw-datetime {
    flex: 1 1 auto;
    white-space: nowrap;
    font-size: 13.5px;
    padding: 12px 10px;
  }

  .smw-tv-icon { display: none; }

  .smw-bet-btn-wrap {
    width: 100%;
    flex: 0 0 auto;
    margin-top: 4px;
  }
  .smw-bet-btn {
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .smw-live-line-track::before,
  .smw-bet-btn-wrap {
    animation: none;
  }
}
