/* Modal Container Styles */
.modal-content {
  padding: 20px;
  position: relative;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 90%;
  height: 90vh;
  color: var(--text-color);
  margin: auto;
  overflow-y: auto;
  border: 2px solid var(--border-color);
}

/* Close Button Styles */
.close-comment {
  position: absolute;
  right: 10px;
  top: 10px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  z-index: 2;
}

.close-comment:hover {
  color: var(--primary-color);
}

/* Upgrade Modal Content Styles */
.upgrade-modal-title {
  margin: 15px 0;
  color: #fff;
  font-size: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 2px;
}

.upgrade-modal-content {
  margin: 20px 0;
  flex: 1;
  overflow-y: auto;
}

/* Upgrade Option Button Styles */
.upgrade-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.upgrade-option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-color);
}

.upgrade-option-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Unlock Icon Styles */
.unlock-icon {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
  flex-shrink: 0;
}

/* Upgrade Option Content Styles */
.upgrade-option-content {
  text-align: left;
  flex-grow: 1;
}

.upgrade-option-title {
  font-size: 1.1em;
  font-weight: 600;
  margin: 0 0 5px 0;
  color: var(--primary-color);
}

.upgrade-option-description {
  margin: 3px 0;
  font-size: 0.9em;
  color: var(--text-color);
  opacity: 0.8;
}

/* New upgrade line styles */
.upgrade-line-1, .upgrade-line-2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  position: relative;
}

.upgrade-text {
  font-size: 0.9em;
  color: var(--text-color);
  font-weight: 500;
  letter-spacing: 1.2px;
  width: 200px;
}

.tier-arrow {
  flex-shrink: 0;
  margin-left: 20px;
}

.tier-number {
  font-size: 0.9em;
  color: var(--primary-color);
  font-weight: 900;
  letter-spacing: 1px;
}

.tier-text {
  font-size: 0.9em;
  color: var(--text-color);
  font-weight: 500;
  letter-spacing: 1.2px;
}

.price-display {
  font-size: 1.3em;
  color: white;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
  padding: 0 15px;
}

/* Upgrade Dropdown Styles */
.upgrade-dropdown {
  width: 90%;
  float: right;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  margin: 0;
}

.upgrade-dropdown.show {
  max-height: 500px;
  transition: max-height 0.5s ease-in;
}

.upgrade-dropdown-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  padding: 10px 15px;
  margin: 5px 0 15px 0;
}

.upgrade-dropdown-content h4 {
  color: var(--primary-color);
  margin: 0 0 10px 0;
  font-size: 1.1em;
}

.upgrade-dropdown-content-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.upgrade-dropdown-content-item span {
  width: 90px;
  font-size: 0.85rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Player Search Styles */
.player-search-container {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.player-search-input {
  width: 100%;
  padding: 4px 8px !important;
  background: rgba(255, 255, 255, 0.05);
  border: 0.8px solid var(--border-color) !important;
  border-radius: 2px;
  color: var(--text-color);
  font-size: 0.85rem !important;
}

.player-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.player-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.player-search-dropdown.show {
  display: block;
}

.player-search-item {
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.player-search-item:last-child {
  border-bottom: none;
}

.player-search-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.player-search-item.hover-equivalent {
  background: rgba(255, 255, 255, 0.1);
}

.player-search-item .rank-hint {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 0.9rem;
  margin-left: 10px;
}

/* Custom Scrollbar Styles */
.player-search-dropdown::-webkit-scrollbar {
  width: 8px;
}

.player-search-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.player-search-dropdown::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.player-search-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Tier Update Arrow Styles */
.tier-update-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
  width: 80px;
}

.tier-update-arrow .tier-current,
.tier-update-arrow .tier-upgraded {
  width: 20px;
  text-align: center;
}

.tier-update-arrow .tier-upgraded {
  color: #6EC139;
}

/* Proceed Button Styles */
.proceed-btn {
  width: 40%;
  align-self: flex-end;
  padding: 12px;
  background: var(--secondary-color);
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.proceed-btn:hover {
  background: var(--primary-color);
}

.proceed-btn:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

.proceed-btn:disabled:hover {
  background: #666;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
  .modal-content {
    width: 95%;
    height: 95vh;
    padding: 15px;
  }

  .upgrade-modal-title {
    font-size: 1.3rem;
    margin: 10px 0;
  }

  .upgrade-option-btn {
    padding: 12px;
    gap: 10px;
  }

  .upgrade-dropdown-content {
    padding: 12px;
  }

  .upgrade-dropdown-content-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .upgrade-dropdown-content-item span {
    width: 100%;
    margin-bottom: 5px;
  }

  .player-search-container {
    width: 100%;
    min-width: unset;
  }

  .tier-update-arrow {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }

  .proceed-btn {
    width: 100%;
    margin-top: 15px;
  }
}

@media screen and (max-width: 480px) {
  .modal-content {
    width: 90%;
    margin: 0 auto;
    height: 100vh;
    padding: 10px;
    border-radius: 0;
  }

  .upgrade-dropdown {
    width: 100%;
  }

  .upgrade-modal-title {
    font-size: 1.2rem;
  }

  .upgrade-option-description {
    font-size: 0.85em;
  }

  .player-search-input {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .player-search-item {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .tier-update-arrow {
    font-size: 0.85rem;
  }
}

/* Ensure modal is centered and has proper backdrop */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Ensure proper scrolling behavior */
body.modal-open {
  overflow: hidden;
}
