/* ============================================================
   Live Cricket Score Pro — Frontend Styles
   Aesthetic: Dark sports dashboard · neon accents
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --lcsp-bg:           #0d1117;
  --lcsp-surface:      #161b22;
  --lcsp-surface-2:    #21262d;
  --lcsp-border:       #30363d;
  --lcsp-text:         #e6edf3;
  --lcsp-text-muted:   #8b949e;
  --lcsp-accent:       #00d4aa;
  --lcsp-live-red:     #ff4757;
  --lcsp-upcoming:     #0097e6;
  --lcsp-completed:    #a8b2d8;
  --lcsp-gold:         #f9ca24;
  --lcsp-radius:       12px;
  --lcsp-radius-sm:    6px;
  --lcsp-shadow:       0 4px 24px rgba(0,0,0,.45);
  --lcsp-shadow-hover: 0 8px 40px rgba(0,0,0,.65);
  --lcsp-transition:   0.22s ease;
  --lcsp-font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --lcsp-font-mono:    'Fira Code', 'Cascadia Code', monospace;
}

/* Light mode override */
@media (prefers-color-scheme: light) {
  :root {
    --lcsp-bg:        #f0f4f8;
    --lcsp-surface:   #ffffff;
    --lcsp-surface-2: #f6f8fa;
    --lcsp-border:    #d0d7de;
    --lcsp-text:      #1f2937;
    --lcsp-text-muted:#6b7280;
    --lcsp-shadow:    0 4px 16px rgba(0,0,0,.10);
  }
}

/* ── Base Wrapper ───────────────────────────────────────────── */
.lcsp-wrapper {
  font-family: var(--lcsp-font);
  color: var(--lcsp-text);
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

.lcsp-wrapper *,
.lcsp-wrapper *::before,
.lcsp-wrapper *::after {
  box-sizing: border-box;
}

/* ── Loading Overlay ────────────────────────────────────────── */
.lcsp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: var(--lcsp-text-muted);
  font-size: 14px;
}

.lcsp-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--lcsp-border);
  border-top-color: var(--lcsp-accent);
  border-radius: 50%;
  animation: lcsp-spin 0.7s linear infinite;
}

@keyframes lcsp-spin {
  to { transform: rotate(360deg); }
}

/* ── Fallback / Error ───────────────────────────────────────── */
.lcsp-fallback {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  background: var(--lcsp-surface);
  border: 1px solid var(--lcsp-border);
  border-radius: var(--lcsp-radius);
  color: var(--lcsp-text-muted);
  font-size: 14px;
}

.lcsp-fallback-icon {
  font-size: 22px;
}

/* ── Status Badges ──────────────────────────────────────────── */
.lcsp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.lcsp-status-live {
  background: rgba(255, 71, 87, 0.15);
  color: var(--lcsp-live-red);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.lcsp-status-upcoming {
  background: rgba(0, 151, 230, 0.12);
  color: var(--lcsp-upcoming);
  border: 1px solid rgba(0, 151, 230, 0.25);
}

.lcsp-status-recent {
  background: rgba(168, 178, 216, 0.10);
  color: var(--lcsp-completed);
  border: 1px solid rgba(168, 178, 216, 0.2);
}

/* Pulsing dot for LIVE */
.lcsp-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lcsp-live-red);
  animation: lcsp-pulse 1.4s ease-in-out infinite;
}

@keyframes lcsp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Format Badge */
.lcsp-format-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--lcsp-radius-sm);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

/* ╔══════════════════════════════════════════════════════════╗
   ║  CARD LAYOUT                                             ║
   ╚══════════════════════════════════════════════════════════╝ */
.lcsp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.lcsp-match-card {
  background: var(--lcsp-surface);
  border: 1px solid var(--lcsp-border);
  border-radius: var(--lcsp-radius);
  overflow: hidden;
  transition: transform var(--lcsp-transition), box-shadow var(--lcsp-transition);
  box-shadow: var(--lcsp-shadow);
  cursor: pointer;
}

.lcsp-match-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--lcsp-shadow-hover);
  border-color: var(--lcsp-accent);
}

.lcsp-status-live.lcsp-match-card {
  border-color: rgba(255, 71, 87, 0.35);
}

.lcsp-status-live.lcsp-match-card:hover {
  border-color: var(--lcsp-live-red);
}

/* Card Header */
.lcsp-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--lcsp-surface-2);
  border-bottom: 1px solid var(--lcsp-border);
  flex-wrap: wrap;
}

.lcsp-series {
  margin: 0;
  font-size: 11px;
  color: var(--lcsp-text-muted);
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Teams */
.lcsp-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px 14px;
  gap: 10px;
}

.lcsp-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.lcsp-team-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--lcsp-surface-2);
  border: 1px solid var(--lcsp-border);
}

.lcsp-team-monogram {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lcsp-surface-2), var(--lcsp-border));
  border: 2px solid var(--lcsp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--lcsp-accent);
  letter-spacing: -1px;
}

.lcsp-team-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--lcsp-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.lcsp-score {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--lcsp-font-mono);
  color: var(--lcsp-accent);
  text-align: center;
}

.lcsp-status-upcoming .lcsp-score {
  font-size: 12px;
  color: var(--lcsp-text-muted);
  font-weight: 500;
}

.lcsp-vs {
  font-size: 12px;
  font-weight: 800;
  color: var(--lcsp-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* Card Footer */
.lcsp-card-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--lcsp-border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lcsp-venue,
.lcsp-toss {
  margin: 0;
  font-size: 11px;
  color: var(--lcsp-text-muted);
}

.lcsp-result {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--lcsp-gold);
}

.lcsp-detail-btn {
  margin-top: 8px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--lcsp-accent);
  color: var(--lcsp-accent);
  border-radius: var(--lcsp-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--lcsp-transition), color var(--lcsp-transition);
  font-family: var(--lcsp-font);
  align-self: flex-start;
}

.lcsp-detail-btn:hover {
  background: var(--lcsp-accent);
  color: #000;
}

/* ╔══════════════════════════════════════════════════════════╗
   ║  LIST LAYOUT                                             ║
   ╚══════════════════════════════════════════════════════════╝ */
.lcsp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--lcsp-border);
  border-radius: var(--lcsp-radius);
  overflow: hidden;
}

.lcsp-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--lcsp-surface);
  border-bottom: 1px solid var(--lcsp-border);
  transition: background var(--lcsp-transition);
  cursor: pointer;
}

.lcsp-list-row:last-child {
  border-bottom: none;
}

.lcsp-list-row:hover {
  background: var(--lcsp-surface-2);
}

.lcsp-list-row.lcsp-status-live {
  border-left: 3px solid var(--lcsp-live-red);
}

.lcsp-list-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--lcsp-text-muted);
  min-width: 60px;
}

.lcsp-status-live .lcsp-list-status {
  color: var(--lcsp-live-red);
}

.lcsp-list-match {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lcsp-list-teams {
  font-size: 14px;
  font-weight: 700;
  color: var(--lcsp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lcsp-list-scores {
  font-size: 12px;
  font-family: var(--lcsp-font-mono);
  color: var(--lcsp-accent);
}

.lcsp-list-format {
  font-size: 11px;
  font-weight: 700;
  color: var(--lcsp-text-muted);
  min-width: 35px;
  text-align: right;
}

/* ╔══════════════════════════════════════════════════════════╗
   ║  TICKER LAYOUT                                           ║
   ╚══════════════════════════════════════════════════════════╝ */
.lcsp-ticker {
  background: var(--lcsp-surface);
  border: 1px solid var(--lcsp-border);
  border-radius: var(--lcsp-radius-sm);
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
  position: relative;
}

.lcsp-ticker::before {
  content: '🏏 LIVE';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--lcsp-live-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 2;
  white-space: nowrap;
}

.lcsp-ticker-track {
  display: flex;
  gap: 40px;
  animation: lcsp-ticker-scroll 35s linear infinite;
  padding-left: calc(80px + 20px);
  white-space: nowrap;
}

@keyframes lcsp-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.lcsp-ticker:hover .lcsp-ticker-track {
  animation-play-state: paused;
}

.lcsp-ticker-item {
  font-size: 13px;
  color: var(--lcsp-text);
  cursor: pointer;
  flex-shrink: 0;
}

.lcsp-ticker-item:hover {
  color: var(--lcsp-accent);
}

.lcsp-ticker-live {
  background: var(--lcsp-live-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  margin-right: 4px;
}

/* ╔══════════════════════════════════════════════════════════╗
   ║  MATCH DETAIL / SCORECARD MODAL                         ║
   ╚══════════════════════════════════════════════════════════╝ */
.lcsp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  animation: lcsp-fade-in 0.2s ease;
}

@keyframes lcsp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lcsp-modal {
  background: var(--lcsp-surface);
  border: 1px solid var(--lcsp-border);
  border-radius: var(--lcsp-radius);
  width: 100%;
  max-width: 860px;
  box-shadow: var(--lcsp-shadow-hover);
  animation: lcsp-slide-up 0.25s ease;
  overflow: hidden;
}

@keyframes lcsp-slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.lcsp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--lcsp-surface-2);
  border-bottom: 1px solid var(--lcsp-border);
}

.lcsp-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--lcsp-text);
}

.lcsp-modal-close {
  background: none;
  border: none;
  color: var(--lcsp-text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--lcsp-transition), color var(--lcsp-transition);
}

.lcsp-modal-close:hover {
  background: var(--lcsp-border);
  color: var(--lcsp-text);
}

.lcsp-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 70vh;
}

/* Detail */
.lcsp-detail { }

.lcsp-detail-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--lcsp-text);
}

.lcsp-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--lcsp-text-muted);
}

.lcsp-innings {
  margin-bottom: 28px;
}

.lcsp-innings-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--lcsp-text);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--lcsp-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lcsp-innings-total {
  font-family: var(--lcsp-font-mono);
  font-size: 16px;
  color: var(--lcsp-accent);
}

/* Tables */
.lcsp-scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}

.lcsp-scorecard-table thead th {
  text-align: left;
  padding: 7px 10px;
  background: var(--lcsp-surface-2);
  color: var(--lcsp-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--lcsp-border);
}

.lcsp-scorecard-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--lcsp-border);
  color: var(--lcsp-text);
  vertical-align: middle;
}

.lcsp-scorecard-table tbody tr:last-child td {
  border-bottom: none;
}

.lcsp-scorecard-table tbody tr:hover td {
  background: var(--lcsp-surface-2);
}

.lcsp-player-name {
  font-weight: 600;
  color: var(--lcsp-text);
}

.lcsp-dismissal {
  font-size: 11px;
  color: var(--lcsp-text-muted);
  max-width: 180px;
}

.lcsp-wickets {
  font-weight: 700;
  color: var(--lcsp-live-red);
}

.lcsp-fow {
  font-size: 12px;
  color: var(--lcsp-text-muted);
  background: var(--lcsp-surface-2);
  padding: 10px 12px;
  border-radius: var(--lcsp-radius-sm);
  line-height: 1.6;
}

/* Bowling table alignment */
.lcsp-bowling-table thead th:not(:first-child),
.lcsp-bowling-table tbody td:not(:first-child) {
  text-align: center;
}

/* ── Elementor placeholder ──────────────────────────────── */
.lcsp-elementor-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px;
  background: var(--lcsp-surface);
  border: 2px dashed var(--lcsp-border);
  border-radius: var(--lcsp-radius);
  text-align: center;
  color: var(--lcsp-text-muted);
  font-size: 24px;
}

.lcsp-elementor-placeholder p {
  font-size: 14px;
  margin: 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .lcsp-cards-grid {
    grid-template-columns: 1fr;
  }

  .lcsp-list-row {
    flex-wrap: wrap;
  }

  .lcsp-scorecard-table { font-size: 12px; }
  .lcsp-dismissal       { display: none; }
  .lcsp-modal           { max-width: 100%; }
  .lcsp-modal-overlay   { padding: 0; align-items: flex-end; }
  .lcsp-modal           { border-radius: var(--lcsp-radius) var(--lcsp-radius) 0 0; }
}
