/* ═══════════════════════════════════════════════════════
   Cricket Events  —  ESPN-style series listing page
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800&family=Noto+Serif:ital,wght@0,700;1,600&family=JetBrains+Mono:wght@500&display=swap');

/* ── Reset ── */
.ce-app, .ce-app * { box-sizing:border-box; margin:0; padding:0; }
.ce-app a { text-decoration:none; }
.ce-app button { cursor:pointer; font-family:inherit; }

/* ── Root ── */
.ce-app {
  --bg:          #f5f5f5;
  --surface:     #ffffff;
  --surface2:    #fafafa;
  --border:      #e0e0e0;
  --border2:     #eeeeee;
  --text:        #1a1a1a;
  --text2:       #444444;
  --sub:         #757575;
  --live:        #d32f2f;
  --live-bg:     #ffebee;
  --intl:        #1565c0;
  --intl-bg:     #e3f2fd;
  --dom:         #2e7d32;
  --dom-bg:      #e8f5e9;
  --women:       #6a1b9a;
  --women-bg:    #f3e5f5;
  --youth:       #e65100;
  --youth-bg:    #fff3e0;
  --upcoming:    #f57f17;
  --upcoming-bg: #fffde7;
  --completed:   #546e7a;
  --completed-bg:#eceff1;
  --accent:      #cc0000;
  --gold:        #f9a825;

  --font:  'Noto Sans',  sans-serif;
  --serif: 'Noto Serif', serif;
  --mono:  'JetBrains Mono', monospace;

  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  min-height:  600px;
  width:       100%;
  max-width:   1280px;
  margin:      0 auto;
}

/* ══════════ HEADER ══════════ */
.ce-header {
  background: #1a1a2e;
  color: #fff;
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ce-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  gap: 16px;
  flex-wrap: wrap;
}

.ce-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ce-header-icon {
  font-size: 32px;
  line-height: 1;
}

.ce-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.ce-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
  font-weight: 400;
}

/* Search */
.ce-search-wrap {
  position: relative;
}

.ce-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
}

.ce-search {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 8px 14px 8px 34px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  width: 260px;
  outline: none;
  transition: background .2s, border .2s;
}

.ce-search::placeholder { color: rgba(255,255,255,0.4); }
.ce-search:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
}

/* Tabs */
.ce-tabs {
  display: flex;
  padding: 0 20px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.ce-tabs::-webkit-scrollbar { display:none; }

.ce-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  letter-spacing: .2px;
}

.ce-tab:hover { color: rgba(255,255,255,0.9); }

.ce-tab-active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* ══════════ BODY ══════════ */
.ce-body {
  padding: 20px 20px 0;
}

/* ══════════ SECTION ══════════ */
.ce-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  animation: ce-fadein .3s ease both;
}

@keyframes ce-fadein {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.ce-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.ce-section-title {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ce-section-icon {
  font-size: 15px;
}

.ce-section-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  background: var(--border2);
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--mono);
}

/* ══════════ ROW ══════════ */
.ce-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border2);
  transition: background .15s;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.ce-row:last-child { border-bottom: none; }
.ce-row:hover { background: #f8f9fa; }

.ce-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ce-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Flags strip */
.ce-flags {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.ce-flag {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,.1);
  display: block;
}

.ce-flag-ph {
  width: 24px;
  height: 16px;
  background: #e8eaed;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  color: #757575;
  border: 1px solid rgba(0,0,0,.08);
}

.ce-teams-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.ce-team-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
}

.ce-vs {
  font-size: 9px;
  color: var(--sub);
  font-weight: 500;
  padding: 0 2px;
  align-self: center;
}

.ce-series-info {
  flex: 1;
  min-width: 0;
}

.ce-series-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.ce-series-meta {
  font-size: 11px;
  color: var(--sub);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges */
.ce-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.ce-badge-live      { background:var(--live-bg);      color:var(--live);      }
.ce-badge-upcoming  { background:var(--upcoming-bg);   color:var(--upcoming);  }
.ce-badge-completed { background:var(--completed-bg);  color:var(--completed); }
.ce-badge-intl      { background:var(--intl-bg);       color:var(--intl);      }
.ce-badge-dom       { background:var(--dom-bg);        color:var(--dom);       }
.ce-badge-women     { background:var(--women-bg);      color:var(--women);     }
.ce-badge-youth     { background:var(--youth-bg);      color:var(--youth);     }
.ce-badge-t20       { background:#e8f5e9; color:#2e7d32; }
.ce-badge-odi       { background:#e3f2fd; color:#1565c0; }
.ce-badge-test      { background:#fce4ec; color:#880e4f; }

/* Date range */
.ce-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--sub);
  white-space: nowrap;
  text-align: right;
}

.ce-date-range {
  display: block;
  font-size: 11px;
  color: var(--sub);
}

/* Live pulse */
.ce-live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 4px;
  vertical-align: middle;
  animation: ce-pulse 1.1s ease-in-out infinite;
}
@keyframes ce-pulse {
  0%,100%{opacity:1;transform:scale(1)}
  50%{opacity:.35;transform:scale(1.5)}
}

/* Score line on live matches */
.ce-score-line {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.ce-score-status {
  font-size: 11px;
  color: var(--live);
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* Match type strip inside a row */
.ce-type-strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ══════════ DETAIL MODAL ══════════ */
.ce-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: ce-fadein .2s ease;
}

.ce-modal {
  background: var(--surface);
  border-radius: 10px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.ce-modal-header {
  background: #1a1a2e;
  color: #fff;
  padding: 16px 20px;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ce-modal-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.ce-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  transition: color .2s;
  flex-shrink: 0;
}
.ce-modal-close:hover { color: #fff; }

.ce-modal-body { padding: 20px; }

.ce-modal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.ce-meta-item { display: flex; flex-direction: column; gap: 3px; }
.ce-meta-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--sub); }
.ce-meta-value { font-size: 13px; font-weight: 600; color: var(--text); }

.ce-modal-matches-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sub);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.ce-modal-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  margin-bottom: 6px;
  gap: 12px;
  background: var(--surface2);
}

.ce-modal-match:hover { background: #f0f4ff; }

.ce-mm-teams {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ce-mm-score {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  text-align: right;
  flex-shrink: 0;
}

.ce-mm-status {
  font-size: 10px;
  color: var(--live);
  margin-top: 1px;
}

.ce-mm-date {
  font-size: 11px;
  color: var(--sub);
}

/* ══════════ SKELETON ══════════ */
.ce-row-skel { pointer-events:none; }

.sk {
  background: linear-gradient(90deg,#e8eaed 25%,#f5f5f5 50%,#e8eaed 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.sk-title  { height:14px; width:160px; }
.sk-flag   { width:24px;  height:16px; border-radius:2px; flex-shrink:0; }
.sk-name   { height:14px; width:200px; }
.sk-badge  { height:18px; width:56px; border-radius:4px; }
.sk-date   { height:11px; width:80px; }

/* ══════════ EMPTY ══════════ */
.ce-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--sub);
  font-size: 14px;
}
.ce-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ══════════ FOOTER ══════════ */
.ce-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 12px;
  color: var(--sub);
  font-family: var(--mono);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ══════════ LOAD MORE ══════════ */
.ce-load-more {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.ce-load-btn {
  background: #1a1a2e;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  transition: background .2s, transform .1s;
}
.ce-load-btn:hover   { background: #2d2d4e; }
.ce-load-btn:active  { transform: scale(.97); }
.ce-load-btn:disabled{ opacity:.5; cursor:default; }

/* ══════════ SPINNER ══════════ */
.ce-spinner {
  display:inline-block;
  width:16px; height:16px;
  border:2px solid rgba(255,255,255,.3);
  border-top-color:#fff;
  border-radius:50%;
  animation:ce-spin .6s linear infinite;
  vertical-align:middle;
  margin-right:6px;
}
@keyframes ce-spin { to{transform:rotate(360deg)} }

/* ══════════ ERROR ══════════ */
.ce-error-box {
  background:#fff5f5;
  border:1px solid #fca5a5;
  border-radius:8px;
  padding:20px;
  color:#991b1b;
  font-size:13px;
  margin-bottom:20px;
}
.ce-error-box strong { display:block; margin-bottom:4px; font-size:14px; }

/* ══════════ RESPONSIVE ══════════ */
@media(max-width:768px){
  .ce-header-inner { padding:12px 14px 8px; }
  .ce-title { font-size:18px; }
  .ce-search { width:180px; }
  .ce-body { padding:12px 12px 0; }
  .ce-row { padding:10px 12px; }
  .ce-series-name { font-size:13px; }
  .ce-modal-meta { grid-template-columns:1fr; }
}

@media(max-width:480px){
  .ce-search { width:140px; font-size:12px; }
  .ce-tabs   { padding:0 12px; }
  .ce-tab    { padding:8px 10px; font-size:12px; }
  .ce-score-status { max-width:160px; }
}
