/* ============================================================
   Billiards Finder – Frontend CSS  v1.0
   Mobile-first, bright & energetic
   ============================================================ */

/* ── Variables ── */
:root {
  --bf-green:      #00c06b;
  --bf-green-d:    #009952;
  --bf-red:        #ff4444;
  --bf-orange:     #ff8c00;
  --bf-blue:       #0099ff;
  --bf-gold:       #ffb800;
  --bf-text:       #1a1a2e;
  --bf-muted:      #666;
  --bf-bg:         #f4f7fb;
  --bf-card:       #ffffff;
  --bf-border:     #e2e8f0;
  --bf-radius:     12px;
  --bf-radius-sm:  8px;
  --bf-shadow:     0 2px 12px rgba(0,0,0,.09);
  --bf-shadow-lg:  0 8px 32px rgba(0,0,0,.16);
  --bf-font:       'Segoe UI', 'Inter', system-ui, sans-serif;
}

/* ── Reset scope ── */
.bf-wrap *, .bf-wrap *::before, .bf-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.bf-wrap {
  font-family: var(--bf-font);
  color: var(--bf-text);
  background: var(--bf-bg);
  min-height: 60vh;
  padding: 0 0 40px;
}

/* ── Buttons ── */
.bf-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border: none; border-radius: var(--bf-radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.bf-btn-primary  { background: var(--bf-green);  color: #fff; }
.bf-btn-primary:hover  { background: var(--bf-green-d); transform: translateY(-1px); }
.bf-btn-secondary{ background: #e8f4ff; color: var(--bf-blue); border: 1px solid #b3d9ff; }
.bf-btn-secondary:hover{ background: #d0eaff; }
.bf-btn-danger   { background: #fff0f0; color: var(--bf-red); border: 1px solid #ffc9c9; }
.bf-btn-danger:hover { background: var(--bf-red); color: #fff; }
.bf-btn-gps      { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.bf-btn-gps:hover{ opacity:.9; }
.bf-btn-block    { width: 100%; justify-content: center; padding: 14px; font-size: 16px; }
.bf-btn-sm       { padding: 6px 12px; font-size: 13px; }
.bf-btn-open     { background: var(--bf-green); color: #fff; }
.bf-btn-close    { background: var(--bf-red);   color: #fff; }

/* ── Input ── */
.bf-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--bf-border);
  border-radius: var(--bf-radius-sm);
  font-size: 14px;
  font-family: var(--bf-font);
  transition: border-color .2s;
  background: #fff;
}
.bf-input:focus { outline: none; border-color: var(--bf-green); }
.bf-textarea { min-height: 90px; resize: vertical; }

/* ── Finder Header ── */
.bf-finder-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 32px 20px 28px;
  text-align: center;
}
.bf-finder-logo  { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.bf-finder-sub   { font-size: 14px; opacity: .75; margin-bottom: 20px; }

.bf-search-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: 640px; margin: 0 auto;
}
.bf-search-bar input {
  flex: 1; min-width: 160px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  color: #fff; border-radius: var(--bf-radius-sm);
  padding: 11px 16px; font-size: 14px;
}
.bf-search-bar input::placeholder { color: rgba(255,255,255,.5); }
.bf-search-bar input:focus { outline: none; border-color: var(--bf-green); background: rgba(255,255,255,.18); }

.bf-gps-status {
  margin-top: 10px; font-size: 13px;
  background: rgba(0,192,107,.2); border-radius: 6px;
  padding: 6px 14px; display: inline-block;
}

/* ── Promo Strip ── */
.bf-promo-strip {
  background: linear-gradient(90deg, #ff6b35, #f7c59f, #ff6b35);
  background-size: 200% 100%;
  animation: bf-slide-bg 4s linear infinite;
  padding: 10px 20px;
  overflow: hidden;
}
@keyframes bf-slide-bg { 0%{background-position:0%} 100%{background-position:200%} }
.bf-promo-strip-inner {
  display: flex; gap: 40px; white-space: nowrap;
  animation: bf-marquee 30s linear infinite;
}
@keyframes bf-marquee { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.bf-promo-strip-inner span {
  font-size: 13px; font-weight: 700; color: #fff;
}

/* ── Filter bar ── */
.bf-filter-bar {
  padding: 14px 16px;
  display: flex; gap: 8px; align-items: center;
  background: #fff; border-bottom: 1px solid var(--bf-border);
  flex-wrap: wrap;
}
.bf-filter-label { font-size: 13px; color: var(--bf-muted); }
.bf-filter-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  border: 1.5px solid var(--bf-border); background: #fff;
  cursor: pointer; font-weight: 500; transition: all .2s;
}
.bf-filter-btn.active { background: var(--bf-green); color: #fff; border-color: var(--bf-green); }

/* ── Club Cards Grid ── */
.bf-clubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  padding: 16px;
}
.bf-club-card {
  background: var(--bf-card);
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.bf-club-card:hover { transform: translateY(-3px); box-shadow: var(--bf-shadow-lg); }

.bf-card-thumb {
  height: 160px; overflow: hidden; background: #1a1a2e;
  display: flex; align-items: center; justify-content: center;
}
.bf-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bf-no-thumb { font-size: 56px; }

.bf-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.bf-card-top  { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bf-card-name { font-size: 16px; font-weight: 700; color: var(--bf-text); flex: 1; }
.bf-card-addr { font-size: 12px; color: var(--bf-muted); line-height: 1.4; }
.bf-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }

.bf-status {
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.bf-status.available { background: #e6fbf0; color: var(--bf-green); }
.bf-status.full      { background: #fff0f0; color: var(--bf-red); }

.bf-price { font-size: 13px; font-weight: 600; color: var(--bf-blue); }
.bf-dist  { font-size: 12px; color: var(--bf-muted); }
.bf-badge-promo {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  background: linear-gradient(135deg, #ff8c00, #ffb800);
  color: #fff; border-radius: 20px;
}

/* ── Loading / Empty ── */
.bf-loading, .bf-empty {
  text-align: center; padding: 40px 20px;
  color: var(--bf-muted); font-size: 15px;
}
.bf-loading::before { content: '⏳ '; }

/* ── Modal ── */
.bf-modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  animation: bf-fade-in .2s;
}
@media (min-width:600px) {
  .bf-modal-overlay { align-items: center; }
}
@keyframes bf-fade-in { from{opacity:0} to{opacity:1} }

.bf-modal {
  background: var(--bf-card);
  border-radius: var(--bf-radius) var(--bf-radius) 0 0;
  width: 100%; max-width: 720px;
  max-height: 92vh; overflow-y: auto;
  padding: 24px 20px;
  position: relative;
  animation: bf-slide-up .25s ease;
}
@media (min-width:600px) {
  .bf-modal { border-radius: var(--bf-radius); max-height: 85vh; }
}
@keyframes bf-slide-up { from{transform:translateY(40px);opacity:0} to{transform:translateY(0);opacity:1} }

.bf-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: #f0f0f0; border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 16px;
  cursor: pointer; font-weight: 700;
}
.bf-modal-close:hover { background: #ddd; }

/* Modal content */
.bf-detail-header { margin-bottom: 16px; }
.bf-detail-name   { font-size: 22px; font-weight: 800; }
.bf-detail-addr   { color: var(--bf-muted); font-size: 14px; margin-top: 4px; }
.bf-detail-phone  a { color: var(--bf-blue); font-weight: 600; }

/* Slideshow */
.bf-slideshow { position: relative; border-radius: var(--bf-radius); overflow: hidden;
  margin-bottom: 16px; background: #1a1a2e; aspect-ratio: 16/7; }
.bf-slideshow img { width: 100%; height: 100%; object-fit: cover; }
.bf-slide-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.4); color: #fff; border: none;
  border-radius: 50%; width: 34px; height: 34px; font-size: 16px;
  cursor: pointer;
}
.bf-slide-prev { left: 8px; }
.bf-slide-next { right: 8px; }

/* Sections */
.bf-section       { margin-bottom: 20px; }
.bf-section h4    { font-size: 15px; font-weight: 700; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--bf-green); display: inline-block; }

/* Tables grid in modal */
.bf-tables-status { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 8px; }
.bf-table-pill {
  padding: 10px 12px; border-radius: var(--bf-radius-sm);
  text-align: center; font-size: 13px; font-weight: 600;
}
.bf-table-pill.available { background: #e6fbf0; color: var(--bf-green); border: 1.5px solid #b3f0d0; }
.bf-table-pill.occupied  { background: #fff0f0; color: var(--bf-red);   border: 1.5px solid #ffc9c9; }
.bf-table-pill .pill-price { font-size: 11px; font-weight: 400; margin-top: 3px; }

/* Menu in modal */
.bf-menu-cat  { margin-bottom: 12px; }
.bf-menu-cat h5 { font-size: 13px; font-weight: 700; color: var(--bf-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.bf-menu-item { display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.bf-menu-item:last-child { border-bottom: none; }
.bf-menu-price { font-weight: 700; color: var(--bf-blue); white-space: nowrap; }

/* Promo banners */
.bf-promo-cards { display: flex; flex-direction: column; gap: 8px; }
.bf-promo-card  {
  border-radius: var(--bf-radius-sm); overflow: hidden;
  border: 1.5px solid #ffe58f; background: #fffbf0;
}
.bf-promo-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.bf-promo-card-body { padding: 10px 12px; }
.bf-promo-card-body h5 { font-size: 14px; font-weight: 700; color: var(--bf-orange); }
.bf-promo-card-body p  { font-size: 13px; color: var(--bf-text); margin-top: 4px; }
.bf-promo-dates { font-size: 11px; color: var(--bf-muted); margin-top: 4px; }

/* Google Map embed */
.bf-map-embed { width: 100%; height: 220px; border-radius: var(--bf-radius); border: none; }

/* ── LOGIN ── */
.bf-login-wrap {
  display: flex; justify-content: center; align-items: center;
  min-height: 70vh; padding: 20px;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
}
.bf-login-box {
  background: #fff; border-radius: 18px; padding: 36px 32px;
  width: 100%; max-width: 420px;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 14px;
}
.bf-login-logo { text-align: center; font-size: 48px; }
.bf-login-box h2 { text-align: center; font-size: 22px; font-weight: 800; }
.bf-center { text-align: center; font-size: 14px; }
.bf-center a { color: var(--bf-green); font-weight: 600; text-decoration: none; }
.bf-login-box hr { border: none; border-top: 1px solid var(--bf-border); }

/* ── DASHBOARD ── */
.bf-dashboard-wrap { background: #f0f4f9; padding: 0 0 60px; }

.bf-dash-topbar {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff; padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.bf-dash-logo { font-size: 18px; font-weight: 800; }
.bf-dash-user { font-size: 13px; }
.bf-dash-user a { color: #ff8c8c; text-decoration: none; }

.bf-dash-tabs {
  display: flex; flex-wrap: wrap; gap: 0;
  background: #fff; border-bottom: 2px solid var(--bf-border);
  padding: 0 12px;
  overflow-x: auto;
}
.bf-tab {
  padding: 13px 16px; font-size: 13px; font-weight: 600;
  border: none; background: none; cursor: pointer;
  color: var(--bf-muted); border-bottom: 3px solid transparent;
  transition: all .15s; white-space: nowrap; margin-bottom: -2px;
}
.bf-tab.active, .bf-tab:hover { color: var(--bf-green); border-bottom-color: var(--bf-green); }

.bf-tab-pane { padding: 20px 16px; }
.bf-tab-pane h3 { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
.bf-tab-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.bf-tab-head h3 { margin: 0; }
.bf-hint { font-size: 13px; color: var(--bf-muted); margin-bottom: 14px; }

/* Form grid */
.bf-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.bf-form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.bf-full { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .bf-form-grid { grid-template-columns: 1fr; }
  .bf-full { grid-column: 1; }
}
.bf-form-actions { display: flex; gap: 10px; }

/* Card form (inline panel) */
.bf-card-form {
  background: #fff; border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow); padding: 20px;
  margin-top: 16px;
}
.bf-card-form h4 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

/* Tables list in dashboard */
.bf-tables-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 12px; }
.bf-table-card {
  background: #fff; border-radius: var(--bf-radius); padding: 14px;
  box-shadow: var(--bf-shadow); border-left: 4px solid var(--bf-green);
}
.bf-table-card.occupied { border-left-color: var(--bf-red); }
.bf-table-card h5 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.bf-table-card .bf-tc-type  { font-size: 12px; color: var(--bf-muted); }
.bf-table-card .bf-tc-price { font-size: 13px; font-weight: 600; color: var(--bf-blue); margin: 6px 0; }
.bf-table-card .bf-tc-actions { display: flex; gap: 6px; margin-top: 8px; }

/* Sessions grid */
.bf-sessions-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 12px; }
.bf-session-card {
  background: #fff; border-radius: var(--bf-radius);
  padding: 16px; box-shadow: var(--bf-shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.bf-session-card.occupied { border: 2px solid #ffb3b3; }
.bf-session-card.available { border: 2px solid #b3f0d0; }
.bf-session-card h5 { font-size: 16px; font-weight: 700; }
.bf-session-meta { font-size: 12px; color: var(--bf-muted); }
.bf-session-timer { font-size: 22px; font-weight: 800; color: var(--bf-orange); font-variant-numeric: tabular-nums; }
.bf-session-amount { font-size: 15px; font-weight: 700; color: var(--bf-blue); }

/* Close result box */
.bf-close-result {
  background: #f0fff8; border: 1.5px solid #00c06b;
  border-radius: 10px; padding: 12px 16px; margin-top: 10px;
  font-size: 14px;
}
.bf-close-result strong { font-size: 20px; color: var(--bf-green); }

/* Menu list in dashboard */
.bf-menu-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #fff; margin-bottom: 4px;
  border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.bf-menu-row .name { font-weight: 600; font-size: 14px; }
.bf-menu-row .cat  { font-size: 11px; color: var(--bf-muted); }
.bf-menu-row .price{ font-weight: 700; color: var(--bf-blue); font-size: 14px; }
.bf-menu-row .actions { display: flex; gap: 6px; }
.bf-menu-cat-header {
  font-size: 12px; font-weight: 700; color: var(--bf-muted);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 8px 14px 4px; background: none;
}

/* Promos grid */
.bf-promos-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 12px; }
.bf-promo-mgr-card {
  background: #fff; border-radius: var(--bf-radius); box-shadow: var(--bf-shadow);
  overflow: hidden;
}
.bf-promo-mgr-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.bf-promo-mgr-body { padding: 12px; }
.bf-promo-mgr-body h5 { font-size: 14px; font-weight: 700; }
.bf-promo-mgr-body p  { font-size: 12px; color: var(--bf-muted); margin: 4px 0; }
.bf-promo-mgr-actions { display: flex; gap: 6px; margin-top: 8px; }

/* Images grid */
.bf-images-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 10px; margin-bottom: 16px; }
.bf-img-item { position: relative; border-radius: var(--bf-radius-sm); overflow: hidden; aspect-ratio: 4/3; background: #ddd; }
.bf-img-item img { width: 100%; height: 100%; object-fit: cover; }
.bf-img-delete {
  position: absolute; top: 4px; right: 4px;
  background: rgba(255,0,0,.75); color: #fff; border: none;
  border-radius: 50%; width: 24px; height: 24px; font-size: 12px;
  cursor: pointer; font-weight: 700;
}

.bf-upload-area { text-align: center; padding: 20px; }
.bf-upload-label {
  display: inline-block; padding: 12px 24px;
  background: var(--bf-blue); color: #fff;
  border-radius: var(--bf-radius-sm); font-weight: 600; cursor: pointer;
  font-size: 14px;
}
.bf-upload-label:hover { opacity: .9; }
#bf-upload-status { display: block; margin-top: 8px; font-size: 13px; color: var(--bf-muted); }

/* History table */
.bf-history-table { margin-top: 14px; overflow-x: auto; }
.bf-history-table table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: var(--bf-radius); overflow: hidden;
  box-shadow: var(--bf-shadow); font-size: 13px;
}
.bf-history-table th { background: #1a1a2e; color: #fff; padding: 10px 12px; text-align: left; }
.bf-history-table td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; }
.bf-history-table tr:last-child td { border-bottom: none; }
.bf-history-table tr:hover td { background: #f7faff; }

/* Messages */
.bf-msg {
  padding: 10px 14px; border-radius: 8px; font-size: 14px;
}
.bf-msg-ok, .bf-msg.ok { background: #e6fbf0; color: #006b35; border: 1px solid #b3f0d0; }
.bf-msg-err, .bf-msg.err { background: #fff0f0; color: #b00020; border: 1px solid #ffc9c9; }
.bf-msg-error { background: #fff0f0; color: var(--bf-red); padding: 12px 16px; border-radius: 8px; font-size: 14px; }

/* Responsive */
@media (max-width: 480px) {
  .bf-finder-logo { font-size: 22px; }
  .bf-clubs-grid  { grid-template-columns: 1fr; }
  .bf-detail-name { font-size: 18px; }
  .bf-dash-tabs   { gap: 0; }
  .bf-tab         { padding: 10px 12px; font-size: 12px; }
  .bf-sessions-grid, .bf-tables-grid { grid-template-columns: 1fr; }
}
