/* ============================================================
   ErevuPredict - main stylesheet
   Font: Bookman Old Style (fallbacks for systems without it)
   ============================================================ */

:root {
  --font: 'Bookman Old Style', 'Bookman', Georgia, 'Times New Roman', serif;

  /* Theme palette */
  --terra: #172033;        /* primary accent (midnight navy) */
  --terra-2: #101826;      /* darker accent / hover */
  --ochre: #D9A441;        /* secondary accent (golden ochre) */
  --sand: #E9DED1;         /* cards & borders */
  --white: #FFFFFF;
  --warm: #FCF7F0;         /* background */

  --navy: #172033;         /* primary brand / dark surfaces */
  --navy-2: #101826;       /* gradient end / hover */
  --accent: #172033;       /* primary actions */
  --accent-dark: #101826;
  --bg: #FCF7F0;           /* background page color */
  --surface: #E9DED1;      /* cards & panels */
  --text: #2D2926;         /* main text */
  --muted: #6E645B;        /* muted warm grey */
  --border: #E9DED1;       /* cards & borders */
  --danger: #D64545;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(23, 32, 51, .08);
  --shadow-lg: 0 14px 34px rgba(23, 32, 51, .16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

a { color: var(--accent-dark); }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 18px;
}

.main { padding-top: 26px; padding-bottom: 46px; min-height: 65vh; }

/* ---------------- Buttons: never wrap, shrink on small screens ------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;          /* text must NOT wrap */
  font-family: var(--font);
  font-size: clamp(0.72rem, 3.4vw, 1rem);  /* shrinks instead of wrapping */
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1;
  padding: clamp(8px, 2.4vw, 13px) clamp(12px, 4vw, 26px);
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(23, 32, 51, .30); }
.btn-primary:hover { background: var(--accent-dark); }

.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }

.btn-gold { background: var(--ochre); color: #ffffff; }
.btn-gold:hover { filter: brightness(.96); }

.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.btn-sm { font-size: clamp(0.66rem, 3vw, 0.85rem); padding: clamp(6px, 2vw, 9px) clamp(10px, 3vw, 16px); }

/* Card buttons are 10% wider: the extra inline padding scales with the button's
   own font-size and base padding, so the button grows exactly ~10% at every
   breakpoint, keeps white-space:nowrap and never overflows the card. */
.j-card .foot .btn {
  padding-inline: calc(0.391em + 1.1 * clamp(10px, 3vw, 16px));
  flex-shrink: 0;
}

/* ---------------- Header ---------------- */
.site-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--ochre);
  color: var(--terra);
  font-weight: 700;
  border-radius: 12px;
  font-size: .95rem;
}
.brand-text { font-size: clamp(1rem, 4vw, 1.3rem); font-weight: 700; letter-spacing: .5px; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: clamp(8px, 3vw, 20px); }
.nav a {
  color: #F6E7D8;
  text-decoration: none;
  font-size: clamp(0.75rem, 3.2vw, 1rem);
  white-space: nowrap;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active { color: #fff; border-bottom-color: var(--ochre); }
.nav-btn {
  background: var(--ochre);
  color: var(--terra) !important;
  font-weight: 700;
  border-radius: 999px;
  padding: clamp(7px, 2vw, 10px) clamp(12px, 3.5vw, 20px) !important;
  border-bottom: none !important;
}

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(135deg, #172033 0%, #101826 55%, #D9A441 165%);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(22px, 5vw, 44px);
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 10px; font-size: clamp(1.4rem, 5.5vw, 2.3rem); line-height: 1.2; }
.hero p { margin: 0 0 18px; color: #F6E7D8; font-size: clamp(0.9rem, 3.4vw, 1.05rem); max-width: 620px; }

/* ---------------- Section titles ---------------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 0 18px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: clamp(1.15rem, 4.4vw, 1.6rem); }
.section-head .count { color: var(--muted); font-size: clamp(.8rem, 3.2vw, .95rem); }

/* ---------------- Prediction cards ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr));
  gap: clamp(14px, 3vw, 24px);
}

.j-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 26px rgba(23, 32, 51, .18), rgba(0, 0, 0, 0.16) 0px 1px 4px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.j-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(23, 32, 51, .26), rgba(0, 0, 0, 0.16) 0px 1px 4px; }

.j-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #F3E7DB;
  overflow: hidden;
}
.j-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.j-card .thumb .badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--ochre); color: var(--terra);
  font-size: clamp(.62rem, 2.8vw, .78rem);
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.j-card .thumb .badge.live { background: var(--terra); color: #fff; }

.j-card .body {
  padding: clamp(14px, 3.5vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.j-card .company {
  color: var(--accent-dark);
  font-size: clamp(.68rem, 3vw, .82rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.j-card h3 {
  margin: 0;
  font-size: clamp(1rem, 4vw, 1.2rem);
  line-height: 1.3;
}
.j-card .meta { color: var(--muted); font-size: clamp(.75rem, 3vw, .88rem); }
.j-card .meta span { white-space: nowrap; }

.j-card .foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
  row-gap: 8px;
}
.j-card .price {
  font-size: clamp(0.95rem, 4vw, 1.15rem);
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}
.j-card .price small { display: block; font-size: .68em; color: var(--muted); font-weight: 400; }

/* ---------------- Panels / forms ---------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 30px);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 22px; }
.panel h1, .panel h2 { margin-top: 0; font-size: clamp(1.15rem, 4.5vw, 1.5rem); }

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-weight: 700;
  font-size: clamp(.8rem, 3.3vw, .92rem);
  margin-bottom: 6px;
}
.form-row .hint { display: block; color: var(--muted); font-size: clamp(.72rem, 3vw, .84rem); margin-top: 5px; }

input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=url], select, textarea {
  width: 100%;
  font-family: var(--font);
  font-size: clamp(0.9rem, 3.6vw, 1rem);
  padding: clamp(9px, 2.6vw, 13px) 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 32, 51, .14);
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
input[type=file] { width: 100%; font-family: var(--font); font-size: clamp(.8rem, 3.3vw, .92rem); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 18px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.form-actions .btn { flex: 0 1 auto; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: clamp(.8rem, 3.3vw, .93rem); margin-bottom: 16px; }
.alert-success { background: #E9F3EC; color: #1F6B45; border: 1px solid #BFE0CC; }
.alert-error { background: #fdecec; color: #a12f2f; border: 1px solid #f4c4c4; }
.alert-info { background: #E9ECF5; color: #22305A; border: 1px solid #C9D0E4; }
.alert b { white-space: nowrap; }

/* ---------------- Auth ---------------- */
.auth-wrap { max-width: 430px; margin: 34px auto; }
.auth-wrap .brand-line { text-align: center; margin-bottom: 18px; }
.auth-wrap .brand-line .brand-mark { margin: 0 auto 10px; width: 52px; height: 52px; font-size: 1.15rem; border-radius: 16px; }
.auth-wrap h1 { text-align: center; font-size: clamp(1.2rem, 5vw, 1.6rem); margin: 0 0 4px; }
.auth-wrap .sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: clamp(.82rem, 3.4vw, .95rem); }

/* ---------------- Jackpot detail ---------------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 22px; align-items: start; }
.detail-grid .panel h1 { margin-bottom: 6px; }

.match-list { list-style: none; margin: 0; padding: 0; }
.match-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: clamp(.82rem, 3.4vw, .95rem);
}
.match-list li:last-child { border-bottom: none; }
.match-list .no {
  background: var(--navy); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .78rem; flex: none;
}
.match-list .fix { flex: 1; }
.match-list .pred {
  background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-weight: 700; white-space: nowrap;
  font-size: clamp(.72rem, 3vw, .85rem);
}

/* payment status */
.pay-status { text-align: center; padding: 14px 0 6px; }
.pay-status .spinner {
  width: 46px; height: 46px; margin: 0 auto 14px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pay-status p { margin: 4px 0; font-size: clamp(.85rem, 3.5vw, 1rem); }
.pay-status .phone { font-weight: 700; white-space: nowrap; }

/* ---------------- Admin dashboard ---------------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } }

.side-nav {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 86px;
}
@media (max-width: 860px) { .side-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.side-nav a {
  text-decoration: none; color: var(--navy);
  padding: clamp(8px, 2.5vw, 11px) 14px;
  border-radius: 10px;
  font-size: clamp(.78rem, 3.3vw, .93rem);
  white-space: nowrap;
}
.side-nav a:hover { background: #F3E9DE; }
.side-nav a.active { background: var(--navy); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(14px, 3.5vw, 20px);
  box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: clamp(.72rem, 3vw, .85rem); text-transform: uppercase; letter-spacing: .8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value { font-size: clamp(1.3rem, 6vw, 1.9rem); font-weight: 700; color: var(--navy); margin-top: 4px; white-space: nowrap; }
.stat .value.green { color: var(--accent-dark); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(.78rem, 3.2vw, .92rem);
  min-width: 560px;
}
table.data th, table.data td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { background: #DEE3F0; color: var(--navy); font-size: clamp(.7rem, 3vw, .82rem); text-transform: uppercase; letter-spacing: .7px; white-space: nowrap; }
table.data tr:hover td { background: #F3E9DE; }
table.data .actions { display: flex; gap: 8px; white-space: nowrap; }
table.data img.tthumb { width: 62px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: clamp(.66rem, 2.8vw, .8rem); font-weight: 700; white-space: nowrap; }
.pill.active { background: #E9ECF5; color: #22305A; }
.pill.sold_out { background: #fff3e0; color: #a35f00; }
.pill.expired { background: #fdecec; color: #a12f2f; }
.pill.paid { background: #E9ECF5; color: #22305A; }
.pill.pending { background: #fff3e0; color: #a35f00; }
.pill.failed { background: #fdecec; color: #a12f2f; }

.preview-img { max-width: 240px; border-radius: 10px; margin-top: 10px; border: 1px solid var(--border); }

.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar h1 { margin: 0; font-size: clamp(1.2rem, 5vw, 1.6rem); }

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--navy); color: #F6E7D8;
  padding: 26px 0;
  margin-top: 40px;
}
.footer-inner { display: flex; justify-content: center; align-items: center; text-align: center; gap: 10px; font-size: clamp(.76rem, 3.2vw, .9rem); flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-link { color: var(--ochre); text-decoration: none; }
.footer-link:hover { color: #fff; }

/* ---------------- Misc ---------------- */
.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 700;
}
.checkbox-row input[type=checkbox] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: none;
  margin: 0;
}
.free-tag {
  color: var(--accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.empty {
  text-align: center; padding: clamp(30px, 8vw, 60px) 16px;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--muted);
}
.empty h3 { color: var(--navy); margin: 0 0 6px; }

.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* Small & medium screens: price and button stack in a column, centered on the card */
@media (max-width: 768px) {
  .j-card .foot {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  .j-card .price { text-align: center; }
  .j-card .foot .btn { width: 100%; max-width: 100%; }
}
