/* Modern Shared Components - Glassmorphism Design System */

.modern-card {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-card.mb-0 {
  margin-bottom: 0 !important;
}

.modern-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
}

.modern-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
}

.modern-card-header h5 {
  font-weight: 800;
  margin: 0;
  color: #1a1a1a;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modern-card-header>i,
.modern-card-header .d-flex>i {
  color: #0d6efd;
  font-size: 1rem;
}

.modern-card-body {
  padding: 1.5rem;
}

/* Modern List Group for Ranking */
.modern-list-group {
  margin: 0;
  padding: 0;
}

.modern-list-item,
.modern-list-item-sm {
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modern-list-item {
  padding: 1.25rem 1.5rem;
}

.modern-list-item-sm {
  padding: 0.75rem 1rem;
}

.modern-list-item:last-child,
.modern-list-item-sm:last-child {
  border-bottom: none;
}

.modern-list-item:hover,
.modern-list-item-sm:hover {
  background: rgba(13, 110, 253, 0.03);
}

.ranking-position {
  font-size: 1.25rem;
  font-weight: 900;
  color: #adb5bd;
  min-width: 40px;
  text-align: center;
}

.ranking-position-1 {
  color: #ffc107;
}

/* Gold */
.ranking-position-2 {
  color: #adb5bd;
}

/* Silver */
.ranking-position-3 {
  color: #cd7f32;
}

/* Bronze */

.ranking-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ranking-info {
  flex-grow: 1;
}

.ranking-name {
  font-weight: 700;
  color: #212529;
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.ranking-score-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  background: #f1f3f5;
  color: #495057;
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Modern Table for Matches Today & Awards */
.modern-table {
  width: 100%;
  margin-bottom: 0;
}

.modern-table th {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #adb5bd;
  letter-spacing: 0.05em;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-table td {
  padding: 1.25rem 1.5rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.modern-table tr:last-child td {
  border-bottom: none;
}

.modern-table-sm td,
.modern-table-sm th {
  padding: 0.75rem 1rem;
}

.modern-table-xs td,
.modern-table-xs th {
  padding: 0.5rem 0.4rem;
}

.match-row-modern {
  transition: all 0.2s ease;
  scroll-margin-top: 100px;
}

.match-row-modern:hover {
  background: rgba(13, 110, 253, 0.02);
}

.match-time-link {
  font-weight: 800;
  color: #0d6efd;
  font-size: 0.9rem;
  text-decoration: none;
}

.team-flag-modern {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

.match-score-modern {
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 20px;
  display: inline-block;
}

/* Awards Specific */
.awards-row td:first-child {
  font-weight: 700;
  color: #495057;
}

.awards-value {
  font-weight: 800;
  color: #198754;
  font-size: 1.1rem;
}

/* Footer Actions */
.modern-card-footer {
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-modern-expand {
  width: 100%;
  background: transparent;
  border: none;
  color: #adb5bd;
  padding: 0.5rem;
  transition: all 0.2s ease;
}

.btn-modern-expand:hover {
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.05);
}

.btn-modern-expand .fa-chevron-down {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-modern-expand[aria-expanded="true"] .fa-chevron-down {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .modern-card {
    border-radius: 1.25rem;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
  }

  .modern-card.mb-0 {
    margin-bottom: 0 !important;
  }

  .modern-card-header {
    padding: 1rem 1.25rem;
  }

  .modern-list-item,
  .modern-list-item-sm,
  .modern-table:not(.modern-table-sm):not(.modern-table-xs) td {
    padding: 1rem 1.25rem;
  }

  .modern-table-sm td,
  .modern-table-sm th {
    padding: 0.5rem 0.5rem;
  }

  .ranking-position {
    min-width: 30px;
    font-size: 1.1rem;
  }

  .ranking-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
    min-width: 0;
  }

  .ranking-name {
    margin-bottom: 0;
    min-width: 0;
    flex-shrink: 1;
  }
}

/* Today match row background and opacity fallback support */
.match-row-today {
  background-color: rgba(13, 110, 253, 0.08) !important;
}

.match-row-modern.match-row-today:hover {
  background-color: rgba(13, 110, 253, 0.12) !important;
}

/* Light primary badge */
.badge-primary-light {
  background-color: rgba(13, 110, 253, 0.1) !important;
  color: #0d6efd !important;
}

/* Hide Number Input Spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.guess-username {
  display: inline-block;
  vertical-align: middle;
  max-width: 90px;
}

@media (min-width: 768px) {
  .guess-username {
    max-width: none;
  }
}

/* Sticky Table Columns (Excel style) */
.sticky-col-1 {
  position: sticky !important;
  left: 0 !important;
  z-index: 3 !important;
  background-color: #ffffff !important;

  /* Mobile defaults */
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
}

.sticky-col-2 {
  position: sticky !important;
  z-index: 3 !important;
  background-color: #ffffff !important;
  border-right: 2px solid rgba(0, 0, 0, 0.08) !important;

  /* Mobile defaults */
  left: 50px !important;
  width: 85px !important;
  min-width: 85px !important;
  max-width: 85px !important;
}

@media (min-width: 768px) {
  .sticky-col-1 {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
  }

  .sticky-col-2 {
    left: 80px !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
  }
}

/* Dark mode support */
body.dark-mode .sticky-col-1 {
  background-color: #1e1e1e !important;
}

body.dark-mode .sticky-col-2 {
  background-color: #1e1e1e !important;
  border-right: 2px solid rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .sticky-col-1 {
  background-color: #1e1e1e !important;
}

[data-bs-theme="dark"] .sticky-col-2 {
  background-color: #1e1e1e !important;
  border-right: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.small-mobile {
  font-size: 0.72rem;
  line-height: 1.1;
  word-break: break-word;
}

@media (min-width: 768px) {
  .small-mobile {
    font-size: 0.95rem;
    line-height: inherit;
    word-break: normal;
    display: inline-block;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
}

/* Indicadores de mudança de posição no Ranking */
.position-change-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  line-height: 1;
  gap: 2px;
  min-width: 28px;
}

.position-change-up {
  background-color: rgba(25, 135, 84, 0.15);
  color: #198754;
}

.position-change-down {
  background-color: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

/* Audit Filter Layout styles */
.audit-filter-wrapper {
  position: relative;
}

.audit-filter-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 10;
}

.audit-filter-input {
  height: 38px;
  font-size: 0.85rem;
  box-shadow: none;
  border-radius: 12px !important;
  padding: 0.4rem 1rem 0.4rem 2.2rem !important;
}

.audit-log-list {
  max-height: 400px;
  overflow-y: auto;
}

/* Admin score input width/height wrapper */
.admin-score-wrapper {
  width: 60px;
}

.admin-score-input {
  height: 50px;
  border-radius: 12px;
  padding: 0.5rem;
}

/* Unified Search Bar styling */
.unified-search-wrapper {
  position: relative;
  width: 100%;
}

.unified-search-input {
  height: 48px;
  font-size: 0.9rem;
  box-shadow: none;
  border-radius: 12px !important;
  padding-left: 1.5rem !important;
  padding-right: 3.5rem !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background-color: #fff !important;
}

.unified-search-input:focus {
  border-color: #0d6efd !important;
  background-color: #fff !important;
  box-shadow: 0 10px 20px rgba(13, 110, 253, 0.08) !important;
}

.unified-search-button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none !important;
  border-radius: 10px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: #0d6efd !important;
  color: #fff !important;
  transition: all 0.2s ease !important;
  z-index: 10;
}

.unified-search-button:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 15px rgba(13, 110, 253, 0.35) !important;
  background: #0b5ed7 !important;
}