/* C:\fourflush_test\fourflush\static\css\style.css */
/* ADMIN ONLY - static/css/style.css */

* { box-sizing: border-box; }

body.admin {
  background: #0b0b0b;
  color: white;
  font-family: Arial, sans-serif;
  padding: 16px;
}

h1 {
  margin: 0 0 14px 0;
  font-size: 22px;
}

/* Cards */
.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
}

.card h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

/* Text helpers */
.label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.muted {
  font-size: 12px;
  opacity: 0.75;
}

/* Layout helpers */
.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Grid blocks */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.miniCard {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px;
  min-width: 0;
}

/* ============================= */
/* INPUT + SELECT + TEXTAREA     */
/* ============================= */

input,
select,
textarea {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 8px 10px;
  color: #fff;
  outline: none;
  width: 100%;
  font-size: 14px;
}

textarea { line-height: 1.35; }

/* Remove OS gray dropdown look */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

/* Hover */
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255,255,255,0.35);
}

/* Focus */
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

/* Dropdown open list colors */
select option,
select optgroup {
  background: #111;
  color: #fff;
}

/* Prevent overflow inside mini cards */
.miniCard input,
.miniCard select,
.miniCard textarea {
  min-width: 0;
}

/* ============================= */
/* Buttons + Links               */
/* ============================= */

button,
.link {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.link:hover {
  background: rgba(255,255,255,0.18);
}

button.danger {
  background: rgba(255,70,70,0.18);
  border-color: rgba(255,70,70,0.35);
}

button.danger:hover {
  background: rgba(255,70,70,0.28);
}

/* ============================= */
/* Status Messages               */
/* ============================= */

.status {
  margin: 10px 0 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  display: none;
}

.status.ok {
  display: block;
  border-color: rgba(80,255,120,0.35);
}

.status.err {
  display: block;
  border-color: rgba(255,80,80,0.45);
}

/* ============================= */
/* Tabs                          */
/* ============================= */

.tabsBar {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px 0;
  flex-wrap: wrap;
}

.tabBtn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
}

.tabBtn.active {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}

.tabPane { display: none; }
.tabPane.active { display: block; }

/* ============================= */
/* Board Rows (Desktop + Mobile) */
/* ============================= */

#board {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Desktop row:
   [#] [Name...............] [S D C H] [Save][Clear]
*/
.adminRow {
  display: grid;
  grid-template-columns: 44px 1fr 260px 220px; /* idx | name | suits | actions */
  gap: 10px;
  align-items: center;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}

.adminRow .idx {
  text-align: center;
  opacity: 0.85;
}

/* Suits area */
.btns {
  display: flex;
  gap: 9px;
  justify-content: flex-start;
  min-width: 0;
}

/* Suit buttons (match display colors + gold outline when ON) */
.sbtn {
  width: 42px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  transition: transform .05s ease, box-shadow .12s ease, border-color .12s ease;
}

.sbtn.S { color: #eaeaea; } /* spade */
.sbtn.D { color: #ff4b4b; } /* diamond */
.sbtn.C { color: #ffffff; } /* club */
.sbtn.H { color: #ff4b4b; } /* heart */

.sbtn.on {
  background: rgba(255,255,255,0.14);
  border-color: rgba(218,165,32,0.95); /* gold */
  box-shadow: 0 0 0 2px rgba(218,165,32,0.35);
}

.sbtn:active { transform: translateY(1px); }

/* Save + Clear grouped (right side) */
.rowActions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  min-width: 0;
}

.rowActions button { min-width: 96px; }

/* Mobile stacked card:
   #, Name, 4 big suits, Save+Clear side-by-side
*/
@media (max-width: 760px) {
  .adminRow {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .adminRow .idx {
    text-align: left;
    font-size: 18px;
    opacity: 0.9;
  }

  .adminRow input {
    width: 100%;
    margin: 0;
  }

  .btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0;
  }

  .sbtn {
    width: 100%;
    height: 64px;
    font-size: 28px;
    border-radius: 18px;
  }

  .rowActions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .rowActions button {
    width: 100%;
    height: 54px;
    font-size: 18px;
    border-radius: 18px;
    min-width: 0;
  }
}

/* ============================= */
/* Tournament Admin Layout        */
/* ============================= */

.tGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payoutGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

/* Big textarea helper used by admin.html */
.bigText {
  width: 100%;
  resize: vertical;
}

/* Responsive Fixes */
@media (max-width: 1100px) {
  .payoutGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .grid3 { grid-template-columns: 1fr; }
  .tGrid { grid-template-columns: 1fr; }
}

/* ============================= */
/* Promo form grid (admin.html)  */
/* ============================= */

.formGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.formGrid label {
  display: block;
  font-size: 12px;
  opacity: .85;
}

.formGrid input {
  margin-top: 6px;
}

@media (max-width: 760px) {
  .formGrid { grid-template-columns: 1fr; }
}

/* ============================= */
/* Background preset grid         */
/* ============================= */

.bgGrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.bgThumb {
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  text-align: left;
}

.bgThumb:hover {
  background: rgba(255,255,255,0.10);
}

.bgThumbImg {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.12);
  background-color: rgba(0,0,0,0.35);
}

.bgThumbName {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.8;
}

@media (max-width: 1100px) { .bgGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 800px)  { .bgGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ================================ */
/* Scoped fixes for specific tabs    */
/* ================================ */

#tab-bonuses input,
#tab-bonuses select {
  width: 100%;
  max-width: 100%;
}

#tab-bonuses .miniCard { overflow: hidden; }

#tab-tournament input,
#tab-tournament select,
#tab-tournament textarea {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
}

#tab-tournament .miniCard { overflow: hidden; }
#tab-tournament .tGrid,
#tab-tournament .payoutGrid { min-width: 0; }

#tab-tournament .tGrid > div,
#tab-tournament .payoutGrid > div { min-width: 0; }