/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  background: #e9f0ff;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  position: relative;
  background: linear-gradient(135deg, #0077ff, #00b0ff);
  color: #fff;
  padding: 12px 16px 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.app-header-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

/* no image overlay for header now */

.app-top-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 8px;
}

.app-top-nav-left {
  font-size: 22px;
  background: transparent;
  border: none;
  color: #fff;
  padding: 0;
}

.app-top-nav-center {
  font-weight: 700;
  font-size: 16px;
}

.app-top-nav-right {
  display: flex;
  gap: 8px;
  font-size: 18px;
}

.app-menu {
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
}

.app-menu-item {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: #1565c0;
  text-decoration: none;
  border-top: 1px solid #e0e0e0;
}

.filter-bar {
  background: #fff8e1;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  border-bottom: 1px solid #ffe082;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  background: #ffe082;
  border-radius: 999px;
  padding: 4px 10px;
}

.filter-pill-select {
  flex: 1;
  background: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #e0e0e0;
}

.filter-pill-select select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  padding: 4px 0;
}

.filter-text-input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #c5cae9;
  font-size: 13px;
}

.filter-search-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: #1976d2;
  color: #fff;
  font-size: 13px;
}

.tournament-list {
  padding: 8px 12px 16px;
  display: grid;
  grid-template-columns: 1fr; /* mobile: 1 card ต่อแถว */
  gap: 12px;
}

@media (min-width: 768px) {
  .app-shell {
    max-width: 960px;
  }

  .tournament-list {
    padding: 16px 24px 32px;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* tablet/desktop: 2 card ต่อแถว */
  }

  .tournament-card {
    margin-bottom: 0;
    font-size: 13px;
  }

  .tournament-title {
    font-size: 16px;
  }

  .tournament-meta {
    font-size: 12px;
    line-height: 1.4;
  }

  .tournament-footer-text {
    font-size: 12px;
  }
}

.tournament-card {
  position: relative;
  background: #000;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.tournament-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.8);
}

.tournament-card--bg1::before {
  background-image: url(/assets/banner2-799d6396e84a909c9eed748ce0a4f5d78ac2d4d2d0b13b2e6246ae98fdef700c.png);
}

.tournament-card--bg2::before {
  background-image: url(/assets/banner2-799d6396e84a909c9eed748ce0a4f5d78ac2d4d2d0b13b2e6246ae98fdef700c.png);
}

.tournament-card-body,
.tournament-footer {
  position: relative;
}

.tournament-card-body {
  padding: 10px 12px 12px;
}

.tournament-card-compact {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.tournament-card-compact-image {
  width: 96px;
  min-width: 96px;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: right center;
}

.tournament-card-compact-image.tournament-card--bg1 {
  background-image: url(/assets/banner2-799d6396e84a909c9eed748ce0a4f5d78ac2d4d2d0b13b2e6246ae98fdef700c.png);
}

.tournament-card-compact-image.tournament-card--bg2 {
  background-image: url(/assets/banner2-799d6396e84a909c9eed748ce0a4f5d78ac2d4d2d0b13b2e6246ae98fdef700c.png);
}

.tournament-card-compact-body {
  flex: 1;
  padding: 8px 10px;
}

.tournament-card-compact .tournament-title {
  color: #0d47a1;
  margin-bottom: 4px;
}

.tournament-card-compact .tournament-meta {
  color: #37474f;
}

.tournament-card-compact-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.tournament-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.tournament-meta {
  font-size: 12px;
  color: #ffffff;
  line-height: 1.4;
}

.tournament-meta-divider {
  margin: 4px 0;
  height: 1px;
  width: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.tournament-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.9);
}

.tournament-actions {
  display: flex;
  gap: 6px;
}

.btn-pill {
  border-radius: 999px;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-like {
  background: #ffe4e6;
  color: #c62828;
}

.btn-apply {
  background: #e3f2fd;
  color: #1565c0;
}

.btn-share {
  background: #e8f5e9;
  color: #2e7d32;
}

.province-filter-form {
  padding: 8px 16px 0;
}

.province-filter-form label {
  font-size: 12px;
  color: #37474f;
}

.province-filter-form input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid #cfd8dc;
  font-size: 13px;
}

.link-button {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1976d2;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}

.link-button--secondary {
  background: #ffffff;
  color: #1976d2;
  border: 1px solid #1976d2;
}

.tournaments-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: #78909c;
}

.pagination {
  padding: 8px 16px 16px;
  text-align: center;
}

.pagination-link {
  display: inline-block;
  margin: 0 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #90caf9;
  color: #1565c0;
  font-size: 12px;
  text-decoration: none;
}

.pagination-link--active {
  background: #1565c0;
  color: #fff;
}

.share-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
}

.share-dialog {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.25);
  padding: 8px 0 12px;
  z-index: 1001;
}

.share-dialog-title {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.share-dialog-item,
.share-dialog-cancel {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: #fff;
  text-align: left;
  font-size: 14px;
}

.share-dialog-item {
  border-top: 1px solid #eceff1;
}

.share-dialog-cancel {
  margin-top: 4px;
  border-top: 6px solid #eceff1;
}

.tournament-show-header {
  position: relative;
  height: 140px;
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 12px 16px;
  background: #000;
  overflow: hidden;
}

.tournament-show-title {
  font-size: 18px;
  font-weight: 800;
}

.tournament-show-subtitle {
  font-size: 12px;
}

.tournament-show-body {
  padding: 12px 12px 48px;
}

/* main tabs on tournament pages stay visible while scrolling */
#tournament-main-tabs {
  position: sticky;
  top: 72px;
  z-index: 20;
  background: #e9f0ff;
  padding-top: 4px;
}

.tournament-info-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: 13px;
}

.tournament-info-card .label {
  color: #78909c;
}

.tournament-description {
  margin-bottom: 8px;
}

.tournament-description-label {
  font-size: 12px;
  color: #78909c;
  margin-bottom: 2px;
}

.tournament-description-body {
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
}

.team-list-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.team-list-header {
  padding: 8px 12px;
  background: #e3f2fd;
  font-size: 13px;
  font-weight: 600;
}

.team-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  border-top: 1px solid #eceff1;
}

.team-list-row:nth-child(even) {
  background: #fafafa;
}

.team-status-badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.team-status-badge--interested {
  background: #fff3e0;
  color: #ef6c00;
}

.team-status-badge--applied {
  background: #eceff1;
  color: #455a64;
}

.team-status-badge--confirmed {
  background: #e8f5e9;
  color: #2e7d32;
}

.team-status-badge--paid {
  background: #f3e5f5;
  color: #6a1b9a;
}

/* Toggle-style switch for team status (สมัครแล้ว/ยืนยันแล้ว) */
.team-status-toggle {
  position: relative;
  border-radius: 999px;
  border: none;
  padding: 3px 10px 3px 6px;
  font-size: 11px;
  cursor: pointer;
  min-width: 80px;
  text-align: left;
}

.team-status-toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}

.team-status-toggle--off {
  background: #eceff1;
  color: #455a64;
}

.team-status-toggle--off::before {
  transform: translateX(2px);
}

.team-status-toggle--on {
  background: #e8f5e9;
  color: #2e7d32;
}

.team-status-toggle--on::before {
  transform: translateX(32px);
}

/* Tabs for teams grouped by division on show page */
.team-tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 6px 8px 4px;
  border-bottom: 1px solid #eceff1;
  background: #fafafa;
}

.team-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid #bbdefb;
  background: #ffffff;
  color: #1565c0;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.team-tab-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1565c0;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.team-tab--active {
  background: #1565c0;
  color: #ffffff;
  border-color: #1565c0;
}

.team-tab--active .team-tab-count {
  background: #0d47a1;
  color: #ffffff;
}

.tournament-show-bottom-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  max-width: 480px;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  padding: 8px 12px 12px;
  display: flex;
  justify-content: center;
}

.tournament-show-bottom-bar .link-button {
  width: 100%;
  text-align: center;
}

.tournament-form {
  padding: 12px 16px 24px;
}

.tournament-form-group {
  margin-bottom: 14px;
}

.tournament-form-inline {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.tournament-form-inline .tournament-form-group {
  flex: 1;
}

.tournament-form-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #cfd8dc;
  font-size: 13px;
}

/* ใช้กับช่องตัวเลขที่ไม่ควรยาวเกินไป เช่น จำนวนผู้เล่นต่อทีม */
.tournament-form-input--narrow {
  max-width: 120px;
}

/* ใช้กับช่องที่ควรมีความกว้างปานกลาง เช่น สนาม / สถานที่ */
.tournament-form-input--medium {
  max-width: 260px;
}

.description-helper {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.description-helper-label {
  font-size: 11px;
  color: #78909c;
  margin-right: 4px;
}

.description-chip {
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

/* ปุ่มลบรุ่น: ถังขยะสีแดง */
.division-remove-button {
  border-color: #ffcdd2;
  background: #ffebee;
  color: #c62828;
}

.tournament-form-errors {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffebee;
  color: #b71c1c;
  font-size: 12px;
}

.tournament-form-errors ul {
  padding-left: 18px;
  margin: 4px 0 0;
}

.tournament-form-actions {
  margin-top: 16px;
}

/* ทำให้ placeholder ดูจาง ไม่เหมือนข้อความที่กรอกแล้ว */
input::placeholder,
textarea::placeholder,
.form-control::placeholder,
.tournament-form-input::placeholder {
  color: #b0bec5;
  opacity: 1; /* บาง browser ต้องตั้ง opacity ให้เห็นผลเต็มที่ */
}
