/* Tournament View Styles */
:root {
  /* Color Palette */
  --dark-blue: #1a1e4b;
  --medium-blue: #242873;
  --bright-blue: #4549e0;
  --light-blue: #6f74f7;
  --yellow: #f7b928;
  --green: #10b981;
  --red: #ef4444;
  --white: #ffffff;
  --light-gray: #f3f4f6;
  --gray: #9ca3af;

  /* Specific UI Colors */
  --background: #1a1e4b;
  --card-bg: #242873;
  --card-bg-darker: #1f2266;
  --win-bg: #10b981;
  --win-bg-light: rgba(16, 185, 129, 0.1);
  --lose-bg: #ef4444;
  --lose-bg-light: rgba(239, 68, 68, 0.1);
  --odds-yellow: #f7b928;
}

body {
  background-color: var(--background);
  font-family: "Poppins", sans-serif;
  color: var(--white);
}

/* Back Button */
.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--bright-blue);
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--light-blue);
}

.back-link i {
  margin-right: 0.5rem;
}

/* Tournament Header */
.tournament-header {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.tournament-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--yellow);
}

.tournament-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.tournament-game {
  font-size: 1.125rem;
  color: var(--light-gray);
  opacity: 0.8;
}

/* Tournament Stats */
.tournament-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--card-bg-darker);
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-icon {
  color: var(--bright-blue);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray);
}

/* Tournament Description */
.tournament-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--white);
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 800px;
}

/* Tournament Banner */
.tournament-banner {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.tournament-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Tournament Layout */
.tournament-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 992px) {
  .tournament-layout {
    grid-template-columns: 2fr 1fr;
  }
}

.tournament-info-container {
  display: flex;
  flex-direction: column;
}

.betting-form-container {
  align-self: start;
}

/* Betting Form */
.betting-form {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 2rem;
}

.betting-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.betting-form-title i {
  color: var(--yellow);
  margin-right: 0.75rem;
}

.betting-form-subtitle {
  font-size: 0.875rem;
  color: var(--light-gray);
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.75rem;
}

/* Team Selection */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.team-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--card-bg-darker);
  border-radius: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: 1px solid transparent;
}

.team-option:hover {
  background-color: rgba(79, 73, 224, 0.2);
}

.team-option.selected {
  border-color: var(--bright-blue);
  background-color: rgba(79, 73, 224, 0.3);
}

.team-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.team-radio {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--gray);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.team-radio.selected {
  border-color: var(--bright-blue);
}

.team-radio.selected::after {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background-color: var(--bright-blue);
  position: absolute;
}

.team-odds {
  font-weight: 700;
  color: var(--odds-yellow);
}

/* Bet Amount */
.bet-amount-container {
  margin-bottom: 1.5rem;
}

.bet-input-group {
  position: relative;
  margin-bottom: 0.5rem;
}

.bet-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.bet-input-prefix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--yellow);
  font-weight: 600;
  z-index: 2;
  pointer-events: none;
}

.bet-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 0.5rem;
  background-color: var(--card-bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1rem;
  padding-right: 1rem; /* Reduced from 2.5rem */
}

/* Hide spinner buttons in Chrome, Safari, Edge, Opera */
.bet-input::-webkit-outer-spin-button,
.bet-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.bet-input {
  -moz-appearance: textfield;
}

.bet-input:focus {
  outline: none;
  border-color: var(--bright-blue);
}

.balance-info {
  font-size: 0.875rem;
  color: var(--gray);
}

/* Place Bet Button */
.place-bet-btn {
  width: 100%;
  padding: 0.875rem;
  background-color: var(--yellow);
  color: var(--dark-blue);
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.place-bet-btn:hover {
  background-color: #e6a800;
}

.place-bet-btn:disabled {
  background-color: var(--gray);
  cursor: not-allowed;
}

/* Results Section */
.results-section {
  margin-top: 2rem;
}

.results-card {
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.results-header {
  padding: 1.5rem;
  color: var(--white);
}

.results-header.win {
  background-color: var(--win-bg);
}

.results-header.lose {
  background-color: var(--lose-bg);
}

.results-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.results-message {
  font-size: 1rem;
}

.results-details {
  background-color: var(--light-gray);
  padding: 1.5rem;
  color: var(--dark-blue);
}

.result-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.result-label {
  font-weight: 500;
  color: var(--dark-blue);
  opacity: 0.7;
}

.result-value {
  font-weight: 600;
  color: var(--dark-blue);
}

.result-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

.result-outcome {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.result-outcome.win {
  color: var(--win-bg);
}

.result-outcome.lose {
  color: var(--lose-bg);
}

.winnings-card {
  background-color: var(--win-bg);
  padding: 2rem;
  text-align: center;
  border-radius: 0.5rem;
  color: var(--white);
}

.winnings-amount {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Final Standings */
.standings-section {
  margin-top: 2rem;
}

.standings-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--light-blue);
  margin-bottom: 1rem;
}

.standings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.standing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--card-bg-darker);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
}

.standing-position {
  font-weight: 700;
  margin-right: 1rem;
}

.standing-team {
  flex-grow: 1;
  font-weight: 500;
}

.standing-prize {
  font-weight: 700;
  color: var(--yellow);
}

/* Winner Display */
.winner-card {
  background-color: var(--card-bg-darker);
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
}

.winner-icon {
  color: var(--yellow);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.winner-team {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.winner-label {
  font-size: 0.875rem;
  color: var(--light-blue);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-all-tournaments {
  flex: 1;
  padding: 0.875rem;
  background-color: var(--bright-blue);
  color: var(--white);
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.btn-all-tournaments:hover {
  background-color: var(--light-blue);
}

.btn-home {
  flex: 1;
  padding: 0.875rem;
  background-color: var(--yellow);
  color: var(--dark-blue);
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.btn-home:hover {
  background-color: #e6a800;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .tournament-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .tournament-stats {
    grid-template-columns: 1fr;
  }

  .tournament-title {
    font-size: 1.75rem;
  }
}

/* Bet Summary */
.bet-summary {
  background-color: rgba(46, 50, 145, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.summary-item .label {
  color: var(--light-gray);
  opacity: 0.8;
}

.summary-item .value {
  font-weight: 500;
  color: var(--white);
}

.summary-item.total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item.total .label {
  font-weight: 600;
}

.summary-item.total .value {
  font-weight: 700;
  color: var(--yellow);
}

/* Confirm Bet Modal */
.confirm-bet-modal {
  max-width: 500px;
  background-color: var(--card-bg);
  border: 1px solid rgba(247, 185, 40, 0.3);
}

.bet-confirmation-details {
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.confirmation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.confirmation-item:last-child {
  margin-bottom: 0;
}

.confirmation-label {
  color: var(--light-gray);
  font-weight: 500;
}

.confirmation-value {
  font-weight: 600;
  color: var(--white);
}

.confirmation-value.team-name {
  color: var(--bright-blue);
}

.confirmation-value.odds {
  color: var(--yellow);
}

.confirmation-value.bet-amount {
  color: var(--white);
}

.confirmation-value.potential-winnings {
  color: var(--yellow);
  font-size: 1.1rem;
}

.confirmation-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 1rem 0;
}

.confirmation-item.total {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
}

.balance-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: var(--light-gray);
}

.btn-confirm-bet {
  background-color: var(--yellow);
  color: var(--dark-blue);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.btn-confirm-bet:hover {
  background-color: #e6a800;
}

/* Insufficient Funds Modal */
.insufficient-funds-modal {
  max-width: 500px;
  background-color: var(--card-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.insufficient-funds-header {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.insufficient-funds-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.insufficient-funds-icon i {
  font-size: 3rem;
  color: var(--red);
}

.insufficient-funds-title {
  text-align: center;
  color: var(--red);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.insufficient-funds-message {
  text-align: center;
  color: var(--white);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.bet-amount-highlight {
  color: var(--red);
  font-weight: 700;
}

.balance-highlight {
  color: var(--bright-blue);
  font-weight: 700;
}

.funds-breakdown {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.breakdown-item:last-child {
  margin-bottom: 0;
}

.breakdown-item.shortage {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.breakdown-label {
  color: var(--light-gray);
  font-weight: 500;
}

.breakdown-value {
  font-weight: 600;
}

.breakdown-value.balance {
  color: var(--bright-blue);
}

.breakdown-value.bet-amount {
  color: var(--white);
}

.breakdown-value.shortage-amount {
  color: var(--red);
  font-weight: 700;
}

.btn-adjust {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-adjust:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-add-funds {
  background-color: var(--yellow);
  color: var(--dark-blue);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.btn-add-funds:hover {
  background-color: #e6a800;
}

/* Existing Bet Modal */
.existing-bet-modal {
  max-width: 500px;
  background-color: var(--card-bg);
  border: 1px solid rgba(247, 185, 40, 0.3);
}

.existing-bet-header {
  background-color: rgba(247, 185, 40, 0.1);
  color: var(--yellow);
  border-bottom: 1px solid rgba(247, 185, 40, 0.2);
}

.existing-bet-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.existing-bet-icon i {
  font-size: 3rem;
  color: var(--yellow);
}

.existing-bet-title {
  text-align: center;
  color: var(--yellow);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.existing-bet-message {
  text-align: center;
  color: var(--white);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.existing-bet-details {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--yellow);
}

.bet-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bet-detail-item:last-child {
  margin-bottom: 0;
}

.detail-label {
  color: var(--light-gray);
  font-weight: 500;
}

.detail-value {
  font-weight: 600;
  color: var(--white);
}

.detail-value.bet-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bet-info .bet-amount {
  color: var(--yellow);
  font-weight: 700;
}

.bet-info .bet-on {
  color: var(--light-gray);
  font-size: 0.875rem;
}

.bet-info .team-name {
  color: var(--bright-blue);
  font-weight: 600;
}

.detail-value.potential-winnings {
  color: var(--yellow);
  font-weight: 700;
}

.btn-close-modal {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-close-modal:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-browse-tournaments {
  background-color: var(--bright-blue);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.btn-browse-tournaments:hover {
  background-color: var(--light-blue);
}

/* Modal Common Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  border-radius: 0.75rem;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: currentColor;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.modal-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.btn-cancel {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-cancel:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
